Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
|
Implementation of inertial measurement unit calibration and data reading as a finite state machine. More...
Functions | |
def | taskIMU.taskBNO055Fcn (taskName, period, zFlag, posDATA, calDATA, DATA, speedDATA) |
A generator to implement the IMU task as an FSM. More... | |
Variables | |
taskIMU.S0_INIT = micropython.const(0) | |
creates object S0_INIT connected to constant 0 More... | |
taskIMU.S1_Update = micropython.const(1) | |
taskIMU.S2_CAL = micropython.const(2) | |
Implementation of inertial measurement unit calibration and data reading as a finite state machine.
This file calls the BNO055.BNO055 class to generate an inertial measurement unit (IMU) object. This file is called iteratively from the main.py program management file to calibrate the IMU. Once calibrated, this file is used to update the output data from the IMU regularly for use in a closed-loop controller file.
def taskIMU.taskBNO055Fcn | ( | taskName, | |
period, | |||
zFlag, | |||
posDATA, | |||
calDATA, | |||
DATA, | |||
speedDATA | |||
) |
A generator to implement the IMU task as an FSM.
The task runs as a generator function and requires a task name and interval to be specified.
taskName | The name of the task as a string. |
period | The task interval or period specified as an integer number of microseconds. |
zFlag | Shared flag variable which causes FSM to enter zeroing state. |
posDATA | Shared data array for printing the angular positions of the IMU upon 'p' or 'P' press. |
calDATA | Shared data array for printing the position of the encoder upon 'c' or 'C' press. |
DATA | Shared data for data recording upon 'g' or 'G' press. This |
speedDATA | Shared data array for printing the angular velocities of the IMU upon 'd' or 'D' press. |
taskIMU.S0_INIT = micropython.const(0) |
creates object S0_INIT connected to constant 0
S0_INIT is used to initialize the FSM. Simply transitions from S0 to S1.