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

Runs tasks sent by the taskUser file. More...

Functions

def taskMotor.taskMotorFcn (taskName, period, mFlag, MFlag, cFlag, wFlag, duty, delta, controlParameters, cLoopFeedback)
 Performs the tasks as determined by the taskUser file. More...
 

Variables

 taskMotor.S0_INIT = micropython.const(0)
 Defines the State 0 Initiate variable as the constant 0.
 
 taskMotor.S1_WAIT = micropython.const(1)
 Defines the State 1 Wait variable as the constant 1.
 
 taskMotor.S2_mDUTY = micropython.const(2)
 Defines the State 7 Duty Cycle variable as the constant 7.
 
 taskMotor.S3_FAULT = micropython.const(3)
 Defines the State 9 Fulat variable as the constant 9.
 
 taskMotor.S4_TOGGLE = micropython.const(4)
 

Detailed Description

Runs tasks sent by the taskUser file.

Acts as a background function file controlling the motor for the primary user interface so that the user interface does not have to perform tasks directly.


The State Transition Diagram for taskUser can be seen here.


Source Code: https://bitbucket.org/lmurray03/me305_lucas_murray/src/master/Lab%200x03/taskMotor.py

Author
Lucas Murray
Max Cassady
Date
February 16, 2022

Function Documentation

◆ taskMotorFcn()

def taskMotor.taskMotorFcn (   taskName,
  period,
  mFlag,
  MFlag,
  cFlag,
  wFlag,
  duty,
  delta,
  controlParameters,
  cLoopFeedback 
)

Performs the tasks as determined by the taskUser file.

Interfaces with the taskUser file through the use of the shared flag parameters and shared values, being able to change the motor duty cycles and clear faults as well as toggling and updating the closed loop controller.

Parameters
taskNameThe name of the task a string
mFlagBoolean variable shared between taskUser and taskMotor for the motor1 duty cycle command
MFlagBoolean variable shared between taskUser and taskMotor for the motor2 duty cycle command
cFlagBoolean variable shared between taskUser and taskMotor for the reset fault command
wFlagBoolean variable shared between taskUser and taskMotor for the closed loop control toggle command
dutyTuple shared between taskUser and taskMotor that stores the input duty value
deltaTuple shared between taskUser and taskEncoder that stores delta data
controlParametersTuple shared between taskUser and taskMotor that stores the input reference velocity and proportional gain
cLoopFeedbackTuple shared between taskUser and taskMotor that stores the closed loop error feedback from each update