ME 305 Group 6 Documentation
|
Driver class for a Closed Loop Controller. More...
Public Member Functions | |
def | __init__ (self, shares_04.Share_04 input_signal, shares_04.Share_04 target_val, int prop_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... | |
Driver class for a Closed Loop Controller.
Used to control a signal and provide output to achieve desired steady state
def closedloop_04.ClosedLoop_04.__init__ | ( | self, | |
shares_04.Share_04 | input_signal, | ||
shares_04.Share_04 | target_val, | ||
int | prop_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.
input_signal | Share object containing the input signal to the controller. |
target_val | Share object containing the desired reference value for the controller. |
prop_gain | Share object containing the Kp for the controller. |
sat_limit_low | Minimum value to saturate the controller output at. |
sat_limit_high | Maximum value to saturate the controller output at. |
def closedloop_04.ClosedLoop_04.set_Kp | ( | self, | |
new_Kp | |||
) |
Sets the Kp to a new value.
Replaces the existing Kp with a new value.
new_Kp | The new value of Kp (proportional gain) to be set. |
def closedloop_04.ClosedLoop_04.update | ( | self | ) |
Returns an output signal based on the initialized share variables.
Multiplies the error signal by the proportional gain to obtain an output signal. If the output signal exceeds the saturation limits, return the saturation limit instead.