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

Runs tasks sent by the taskUser file and collects the desired data. More...

Functions

def taskData.taskDataFcn (taskName, period, dFlag, sFlag, Eang, Vang, Cart)
 Collects the data as determined by the taskUser file. More...
 

Variables

 taskData.S0_INIT = micropython.const(0)
 Defines the State 0 Initiate variable as the constant 0.
 
 taskData.S1_DATA = micropython.const(1)
 Defines the State 1 Data variable as the constant 1.
 
 taskData.S2_POSITION = micropython.const(2)
 Defines the State 2 Position variable as the constant 2.
 
 taskData.S3_VELOCITY = micropython.const(3)
 Defines the State 3 Velocity variable as the constant 3.
 
 taskData.S4_ANGLE = micropython.const(4)
 Defines the State 4 Angle variable as the constant 4.
 
 taskData.S5_OMEGA = micropython.const(5)
 Defines the State 5 Omega variable as the constant 5.
 
 taskData.S6_WRITE = micropython.const(6)
 Defines the State 6 Write variable as the constant 6.
 

Detailed Description

Runs tasks sent by the taskUser file and collects the desired data.

Acts as a background function file controlling the IMU for the primary user interface so that the user interface does not have to perform data collection directly. It will write the chosen data to a file for 20 seconds that can be used to plot or just saved for later.

Sample Data Plots The platform can gather various different forms of data through this task, including the ball position, the ball velocity, the platform angular position, and the platform angular velocity. Sample plots from the file created by each of these data collections can be seen below. The data collected has no real meaning, it was just us moving the ball and platform around, but it acts as proof that our data collection works.



The State Transition Diagram for taskData can be seen here.


Source Code: https://bitbucket.org/lmurray03/me305_lucas_murray/src/master/Term%20Project/taskData.py

Author
Lucas Murray
Max Cassady
Date
March 17, 2022

Function Documentation

◆ taskDataFcn()

def taskData.taskDataFcn (   taskName,
  period,
  dFlag,
  sFlag,
  Eang,
  Vang,
  Cart 
)

Collects the data as determined by the taskUser file.

Interfaces with the taskUser file through the use of the shared flag and tuple parameters, reading the chosen data for 20 seconds and writing it to a file unless told to stop by the userTask.

Parameters
taskNameThe name of the task a string
periodThe period of the task in microseconds as an integer
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
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
CartTuple shared between taskData and taskPanel that contains the touch panel position and velocity data values