ME 305 Group 6 Documentation
Public Member Functions | List of all members
closedloop_05.ClosedLoop_05 Class Reference

Driver class for a Closed Loop Controller. More...

Public Member Functions

def __init__ (self, shares_05.Share position_signal, shares_05.Share deriv_signal, shares_05.Share target_pos, shares_05.Share target_deriv, float prop_gain, float deriv_gain, int sat_limit_low, int sat_limit_high)
 Initializes the ClosedLoop object. More...
 
def update (self)
 Returns an output signal based on the initialized share variables. More...
 
def set_Kp (self, new_Kp)
 Sets the Kp to a new value. More...
 
def set_Kd (self, new_Kd)
 Sets the Kd to a new value. More...
 

Detailed Description

Driver class for a Closed Loop Controller.

Used to control a signal and provide output to achieve desired steady state

Constructor & Destructor Documentation

◆ __init__()

def closedloop_05.ClosedLoop_05.__init__ (   self,
shares_05.Share  position_signal,
shares_05.Share  deriv_signal,
shares_05.Share  target_pos,
shares_05.Share  target_deriv,
float  prop_gain,
float  deriv_gain,
int  sat_limit_low,
int  sat_limit_high 
)

Initializes the ClosedLoop object.


Objects of this class act as a Proportional Controller, taking in an input signal and target value, along with a proportional gain.

Parameters
position_signalShare object containing the position input signal to the controller.
deriv_signalShare object containing the input derivative signal for the controller.
target_posShare object containing the desired reference value for the controller position.
target_derivShare object containing the desired reference value for controller velocity.
prop_gainFloat value for the Kp for the controller.
deriv_gainFloat value for the Kd for the controller
sat_limit_lowMinimum value to saturate the controller output at.
sat_limit_highMaximum value to saturate the controller output at.

Member Function Documentation

◆ set_Kd()

def closedloop_05.ClosedLoop_05.set_Kd (   self,
  new_Kd 
)

Sets the Kd to a new value.

Replaces the existing Kd with a new value.

Parameters
new_KdThe new value of Kd (derivative gain) to be set.

◆ set_Kp()

def closedloop_05.ClosedLoop_05.set_Kp (   self,
  new_Kp 
)

Sets the Kp to a new value.

Replaces the existing Kp with a new value.

Parameters
new_KpThe new value of Kp (proportional gain) to be set.

◆ update()

def closedloop_05.ClosedLoop_05.update (   self)

Returns an output signal based on the initialized share variables.

Multiplies the error signal by the proportional gain and adds the velocity/derivitive error signal to obtain an output signal. If the output signal exceeds the saturation limits, return the saturation limit instead.


The documentation for this class was generated from the following file: