Lucas Murray ME 305 Portfolio
|
Runs a user interface for someone to run the encoder. More...
Functions | |
def | taskUser.taskUserFcn (taskName, period, zFlag, mFlag, MFlag, cFlag, wFlag, data, delta, duty, controlParameters, cLoopFeedback) |
A generator to implement the UI task as an FSM. More... | |
def | taskUser.printUI () |
Prints the command screen for the user interface. | |
Runs a user interface for someone to run the encoder.
Uses a function to accept user input and run the desired method. Uses the shared variables to read data written by the encoder and motor tasks and to send flags that will tell either of the functions to perform a certain action.
The State Transition Diagram for taskUser can be seen here.
Source Code: https://bitbucket.org/lmurray03/me305_lucas_murray/src/master/Lab%200x02/taskUser.py
def taskUser.taskUserFcn | ( | taskName, | |
period, | |||
zFlag, | |||
mFlag, | |||
MFlag, | |||
cFlag, | |||
wFlag, | |||
data, | |||
delta, | |||
duty, | |||
controlParameters, | |||
cLoopFeedback | |||
) |
A generator to implement the UI task as an FSM.
The task runs as a generator function and requires a task name, interval and zFlag status to be specified.
taskName | The name of the task as a string. |
period | The task interval or period specified as an integer number of microseconds. |
zFlag | Boolean variable shared between taskUser and taskEncoder for the zero command |
mFlag | Boolean variable shared between taskUser and taskMotor for the motor1 duty cycle command |
MFlag | Boolean variable shared between taskUser and taskMotor for the motor2 duty cycle command |
cFlag | Boolean variable shared between taskUser and taskMotor for the reset fault command |
wFlag | Boolean variable shared between taskUser and taskMotor for the closed loop control toggle command |
data | Tuple data shared between taskUser and taskEncoder for data collection |
delta | Tuple shared between taskUser and taskEncoder that stores delta data |
duty | Tuple shared between taskUser and taskMotor that stores the input duty value |
controlParameters | Tuple shared between taskUser and taskMotor that stores the input reference velocity and proportional gain |
cLoopFeedback | Tuple shared between taskUser and taskMotor that stores the closed loop error feedback from each update |