ME305Lab
|
User Interface FSM code. More...
Functions | |
def | taskUser.taskUserFcn (taskName, period, ENABLE, KEYFLAG, TASKFIN, KPSHARE, KDSHARE) |
Generator function to run the UI task as an FSM. More... | |
User Interface FSM code.
User Interface for Encoder FSM.
The task uses the USB VCP (Virtual COM Port) to cooperatively take character input from the user working at a serial terminal such as PuTTY. Using the keyboard, the user can perform the following functions: enable/disable motor control (e), begin touch panel calibration (c), input proportional gain for inner controller (p), input derivative gain for inner controller(d), input proportional gain for outer controller (n), input derivative gain for outer controller(m).
The task uses the USB VCP (Virtual COM Port) to cooperatively take character input from the user working at a serial terminal such as PuTTY. Using the keyboard, the user can perform the following functions: zero encoder 1 (z), print position of encoder (p), print delta for encoder (d), collect data for 30 seconds and print to PuTTY as comma separated list (g), or end data collection early (s).
def taskUser.taskUserFcn | ( | taskName, | |
period, | |||
ENABLE, | |||
KEYFLAG, | |||
TASKFIN, | |||
KPSHARE, | |||
KDSHARE | |||
) |
Generator function to run the UI task as an FSM.
The task runs as a generator function and requires a task name and interval 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. |
ENABLE | Share used to communicate when motor control is enabled/disabled |
KEYFLAG | Flag containing value of user inputted key command |
TASKFIN | Share telling if task has finished across task files, similar to acknowledge bit in I2C communication |
KPSHARE | Share holding value of proportional gain for inner control loop |
KDSHARE | Share holding value of derivative gain for inner control loop |