Lucas Murray ME 305 Portfolio
Functions | Variables
taskUser_F.py File Reference

Runs a user interface for someone to run the encoder. More...

Functions

def taskUser_F.taskUserFcn (taskName, period, wFlag, cFlag, pFlag, kFlag, dFlag, sFlag, duty, Eang, Vang, controlParameters)
 A generator to implement the UI task as an FSM. More...
 
def taskUser_F.printUI ()
 Prints the command screen for the user interface.
 

Variables

 taskUser_F.S0_INIT = micropython.const(0)
 Defines the State 0 Initiate variable as the constant 0.
 
 taskUser_F.S1_CMD = micropython.const(1)
 Defines the State 1 Command variable as the constant 1.
 
 taskUser_F.S2_POSITION = micropython.const(2)
 Defines the State 2 Print variable as the constant 2.
 
 taskUser_F.S3_VELOCITY = micropython.const(3)
 Defines the State 3 Velocity variable as the constant 3.
 
 taskUser_F.S4_INPUT = micropython.const(4)
 Defines the State 4 Duty Cycle variable as the constant 4.
 
 taskUser_F.S5_REF = micropython.const(5)
 Defines the State 5 Reference Velocity variable as the constant 5.
 
 taskUser_F.S6_SETGAIN = micropython.const(6)
 Defines the State 6 Set Gain variable as the constant 6.
 
 taskUser_F.S7_CLOOP = micropython.const(7)
 Defines the State 7 Closed Loop Control variable as the constant 7.
 
 taskUser_F.S8_CAL = micropython.const(8)
 Defines the State 8 Calibration variable as the constant 8.
 

Detailed Description

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/Term%20Project/taskUser_F.py

Author
Lucas Murray
Max Cassady
Date
February 24, 2022

Function Documentation

◆ taskUserFcn()

def taskUser_F.taskUserFcn (   taskName,
  period,
  wFlag,
  cFlag,
  pFlag,
  kFlag,
  dFlag,
  sFlag,
  duty,
  Eang,
  Vang,
  controlParameters 
)

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.

Parameters
taskNameThe name of the task as a string.
periodThe task interval or period specified as an integer number of microseconds.
wFlagBoolean variable shared between taskUser and taskMotor for the closed loop control toggle command
cFlagBoolean variable shared between taskUser and taskIMU for the IMU calibration command
pFlagTuple variable shared between taskUser and taskPanel for the calibration and read commands
kFlagTuple variable shared between taskUser and taskMotor for the change gains command
dFlagTuple variable shared between taskUser and taskData for the collect data command
sFlagBoolean variable shared between taskUser and taskData for the stop data collection early command
dutyTuple shared between taskUser and taskMotor that stores the input duty value
EangTuple shared between taskIMU, taskUser, taskData, and taskMotor that stores euler angle values
VangTuple shared between taskIMU, taskUser, taskData, and taskMotor that stores angular velocity values
controlParametersTuple shared between taskUser and taskMotor that stores the input reference velocity and proportional gain