Lucas Murray ME 305 Portfolio
|
Runs tasks sent by the taskUser file and performs ball balancing. More...
Functions | |
def | taskMotor_F.taskMotorFcn (taskName, period, wFlag, kFlag, hFlag, cFlag, duty, Eang, Vang, Poxy, Voxy, Cart, Cast, controlParameters) |
Runs the relevant motor tasks as determined by taskUser and runs closed loop control. More... | |
Runs tasks sent by the taskUser file and performs ball balancing.
Acts as a background function file controlling the platform motors for the primary user interface so that the user interface does not have to motor actuation and closed loop control by itself. When closed loop control is activated by the taskUser, it will actively perform closed loop control to balance the ball and board. When there is no contact with the touch panel on the platform, it will only run the inner loop control and solely balance the platform, but when there is contact, the outer loop and inner loop will run sequentially, attempting to balance the ball in response to the touch panel position data.
The State Transition Diagram for taskMotor_F can be seen here.
Source Code: https://bitbucket.org/lmurray03/me305_lucas_murray/src/master/Term%20Project/taskMotor_F.py
def taskMotor_F.taskMotorFcn | ( | taskName, | |
period, | |||
wFlag, | |||
kFlag, | |||
hFlag, | |||
cFlag, | |||
duty, | |||
Eang, | |||
Vang, | |||
Poxy, | |||
Voxy, | |||
Cart, | |||
Cast, | |||
controlParameters | |||
) |
Runs the relevant motor tasks as determined by taskUser and runs closed loop control.
Interfaces with the taskUser file through the use of the shared flag parameters and shared tuples, being able to change the gain coefficients of either closed loop controller as well as toggling and updating each closed loop controller actively depending on whether there is contact with the board.
taskName | The name of the task a string |
period | The period of the task in microseconds as an integer |
wFlag | Boolean variable shared between taskUser and taskMotor for the closed loop control toggle command |
kFlag | Tuple variable shared between taskUser and taskMotor for the change gains command |
hFlag | Boolean variable shared between taskPanel and taskMotor for the haptic feedback command |
cFlag | Boolean variable shared between taskUser and taskIMU for the IMU calibration command |
Eang | Tuple shared between taskIMU, taskUser, taskData, and taskMotor that stores euler angle values |
Vang | Tuple shared between taskIMU, taskUser, taskData, and taskMotor that stores angular velocity values |
Poxy | Tuple shared between taskMotor and taskPanel that stores the touch panel xy position values |
Voxy | Tuple shared between taskMotor and taskPanel that stores the touch panel xy velocity values |
Cart | Tuple shared between taskData and taskPanel that contains the touch panel position and velocity data values |
Cast | Tuple shared between taskUser and taskEncoder that would have allowed for the automated calibration of the IMU |
controlParameters | Tuple shared between taskUser and taskMotor that stores the input reference velocity and proportional gain |