ME305Lab
Functions | Variables
taskUser.py File Reference

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...
 

Variables

 taskUser.S0_INIT = micropython.const(0)
 
 taskUser.S1_WAIT = micropython.const(1)
 
 taskUser.S2_CALTP = micropython.const(2)
 
 taskUser.S3_NUMIN = micropython.const(3)
 
 taskUser.S4_GAIN = micropython.const(4)
 

Detailed Description

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).

Author
Theo Philliber
Ruodolf Rumbaoa
Date
03/10/2022

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).

Author
Theo Philliber
Ruodolf Rumbaoa
Date
02/2/2022

Function Documentation

◆ taskUserFcn()

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.

Parameters
taskNameThe name of the task as a string.
periodThe task interval or period specified as an integer number of microseconds.
ENABLEShare used to communicate when motor control is enabled/disabled
KEYFLAGFlag containing value of user inputted key command
TASKFINShare telling if task has finished across task files, similar to acknowledge bit in I2C communication
KPSHAREShare holding value of proportional gain for inner control loop
KDSHAREShare holding value of derivative gain for inner control loop