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

Runs tasks sent by the taskUser file and keeps the IMU measurement data updated. More...

Functions

def taskIMU.taskIMUFcn (taskName, period, cFlag, duty, Eang, Vang, Cast)
 Controls the IMU as determined by the taskUser file. More...
 

Variables

 taskIMU.S0_INIT = micropython.const(0)
 Defines the State 0 Initiate variable as the constant 0.
 
 taskIMU.S1_UPDATE = micropython.const(1)
 Defines the State 1 Update variable as the constant 1.
 
 taskIMU.S2_CAL = micropython.const(2)
 Defines the State 2 Calibration variable as the constant 2.
 

Detailed Description

Runs tasks sent by the taskUser file and keeps the IMU measurement data updated.

Acts as a background function file controlling the IMU for the primary user interface so that the user interface does not have to perform IMU updating directly. It will provide the euler angle and angular velocity as a shared variable for use in other files and can calibrate the IMU when told to by the user task. It will continuously update the IMU every 10 milliseconds when run from main.


The State Transition Diagram for taskIMU can be seen here.


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

Author
Lucas Murray
Max Cassady
Date
March 3, 2022

Function Documentation

◆ taskIMUFcn()

def taskIMU.taskIMUFcn (   taskName,
  period,
  cFlag,
  duty,
  Eang,
  Vang,
  Cast 
)

Controls the IMU as determined by the taskUser file.

Interfaces with the taskUser file through the use of the shared flag and tuple parameters, keeping the IMU updated and performing calibration when told to.

Parameters
taskNameThe name of the task a string
periodThe period of the task in microseconds as an integer
cFlagBoolean variable shared between taskUser and taskIMU for the IMU calibration command
dutyTuple data shared between taskUser and taskEncoder for the motor duty
EangTuple shared between taskUser and taskEncoder that stores the euler angle data from the IMU
VangTuple shared between taskUser and taskEncoder that stores the angular velocity data from the IMU
CastTuple shared between taskUser and taskEncoder that would have allowed for the automated calibration of the IMU