ME 305 Group 6 Documentation
|
Sets up and calls the closed loop controller class for the inner loop. More...
Functions | |
def | taskMotorController.taskMotorControllerFcn (str taskName, int period, shares.Share euler_angles, shares.Share angular_velocities, shares.Share roll_target_pos, shares.Share roll_target_deriv, shares.Share pitch_target_pos, shares.Share pitch_target_deriv, shares.Share prop_gain_roll, shares.Share deriv_gain_roll, shares.Share int_gain_roll, shares.Share cont_enable, shares.Share roll_target_duty, shares.Share pitch_target_duty, shares.Share prop_gain_pitch, shares.Share deriv_gain_pitch, shares.Share int_gain_pitch) |
Sets up and calls the closed loop controller class. More... | |
Sets up and calls the closed loop controller class for the inner loop.
Configures a PID controller object and continuously updates the controller output value and assigns to the proper motor duty cycle. In this case, the derivative of position for derivative control is drawn directly from the gyroscope data. This is more accurate than a numerical derivative.
def taskMotorController.taskMotorControllerFcn | ( | str | taskName, |
int | period, | ||
shares.Share | euler_angles, | ||
shares.Share | angular_velocities, | ||
shares.Share | roll_target_pos, | ||
shares.Share | roll_target_deriv, | ||
shares.Share | pitch_target_pos, | ||
shares.Share | pitch_target_deriv, | ||
shares.Share | prop_gain_roll, | ||
shares.Share | deriv_gain_roll, | ||
shares.Share | int_gain_roll, | ||
shares.Share | cont_enable, | ||
shares.Share | roll_target_duty, | ||
shares.Share | pitch_target_duty, | ||
shares.Share | prop_gain_pitch, | ||
shares.Share | deriv_gain_pitch, | ||
shares.Share | int_gain_pitch | ||
) |
Sets up and calls the closed loop controller class.
Every period, this task resets the gains using set_Kx() and updates the controller. Saturation limits are set to 100 and -100.
taskName | Task name label for debugging purposes. |
period | Period to run taskControllerFcn |
euler_angles | Shared variable to store the euler angles being recorded by the IMU. |
angular_velocities | Shared variable to store angular velocities being recorded by the IMU. |
roll_target_pos | Shared variable to store the roll target position output from the angle controller. |
roll_target_deriv | Shared variable to store the roll target velocity output from the angle controller (0). |
pitch_target_pos | Shared variable to store the pitch target position output from the angle controller. |
pitch_target_deriv | Shared variable to store the pitch target velocity output from the angle controller (0). |
prop_gain_roll | Shared variable for the roll controller proportional gain |
deriv_gain_roll | Shared variable for the roll controller derivative gain. |
int_gain_roll | Shared variable for the roll controller integral gain. |
cont_enable | Shared variable for whether or not the controller is enabled. |
roll_target_duty | Shared variable for the roll motor target duty cycle. |
pitch_target_duty | Shared variable for the pitch motor target duty cycle. |
prop_gain_pitch | Shared variable for the pitch controller proportional gain. |
deriv_gain_pitch | Shared variable for the pitch controller derivative gain. |
int_gain_pitch | Shared variable for the pitch controller integral gain. |