ME 305 Group 6 Documentation
Functions
taskAngleController.py File Reference

Sets up and calls the closed loop controller class. More...

Functions

def taskAngleController.taskAngleControllerFcn (str taskName, int period, shares.Share roll_target_pos, shares.Share pitch_target_pos, shares.Share x_position_signal, shares.Share x_pos_deriv_signal, shares.Share x_target_position, shares.Share x_pos_deriv_target, shares.Share y_position_signal, shares.Share y_pos_deriv_signal, shares.Share y_target_position, shares.Share y_pos_deriv_target, shares.Share positionx_prop_gain, shares.Share positionx_deriv_gain, shares.Share positionx_int_gain, shares.Share cont_enable, shares.Share ball_detected, PrintQueue print_queue, shares.Share positiony_prop_gain, shares.Share positiony_deriv_gain, shares.Share positiony_int_gain, shares.Share controller_signalsx, shares.Share controller_signalsy)
 Sets up and calls the closed loop controller class. More...
 

Detailed Description

Sets up and calls the closed loop controller class.

Configures a PID controller object and continuously updates the controller output value which represents the desired angle of the platform. This functions as the outer loop of the control system.

Author
Caleb Savard
Chris Linthacum
Date
March 18, 2022

Function Documentation

◆ taskAngleControllerFcn()

def taskAngleController.taskAngleControllerFcn ( str  taskName,
int  period,
shares.Share  roll_target_pos,
shares.Share  pitch_target_pos,
shares.Share  x_position_signal,
shares.Share  x_pos_deriv_signal,
shares.Share  x_target_position,
shares.Share  x_pos_deriv_target,
shares.Share  y_position_signal,
shares.Share  y_pos_deriv_signal,
shares.Share  y_target_position,
shares.Share  y_pos_deriv_target,
shares.Share  positionx_prop_gain,
shares.Share  positionx_deriv_gain,
shares.Share  positionx_int_gain,
shares.Share  cont_enable,
shares.Share  ball_detected,
PrintQueue  print_queue,
shares.Share  positiony_prop_gain,
shares.Share  positiony_deriv_gain,
shares.Share  positiony_int_gain,
shares.Share  controller_signalsx,
shares.Share  controller_signalsy 
)

Sets up and calls the closed loop controller class.

Every period, this task resets the Kp using set_Kp and updates the controller. Saturation limits are set to 100 and -100.

Parameters
taskNameTask name label for debugging purposes.
periodPeriod to run taskControllerFcn
roll_target_posShared variable to pass out the desired platform roll angle.
pitch_target_posShared variable to pass out the desired platform pitch angle.
x_position_signalShared variable to pass in the current X position of the ball.
x_pos_deriv_signalShared variable to pass in the current X velocity of the ball.
x_target_positionShared variable to pass in the desired X position of the ball.
x_pos_deriv_targetShared variable to pass in the desired X velocity of the ball.
y_position_signalShared variable to pass in the current Y position of the ball.
y_pos_deriv_signalShared variable to pass in the current Y velocity of the ball.
y_target_positionShared variable to pass in the desired Y position of the ball.
y_pos_deriv_targetShared variable to pass in the desired Y velocity of the ball.
positionx_prop_gainShared variable to pass in Kp for the X direction.
positionx_deriv_gainShared variable to pass in Kd for the X direction.
positionx_int_gainShared variable to pass in Ki for the X direction.
cont_enableShared variable to store a boolean whether to enable or disable the controller.
ball_detectedShared variable to store a boolean to indicate if the ball is on the platform.
print_queuePrint queue object for handling print statements.
positiony_prop_gainShared variable to pass in Kp for the Y direction.
positiony_deriv_gainShared variable to pass in Kd for the Y direction.
positiony_int_gainShared variable to pass in Ki for the Y direction.
controller_signalsxShared variable to pass in the X controller gains as a single object.
controller_signalsyShared variable to pass in the Y controller gains as a single object.