![]() |
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 | Lab0x05_taskIMU.taskBNO055Fcn (taskName, period, zFlag, posDATA, calDATA, DATA, speedDATA) |
A generator to implement the Encoder task as an FSM. More... | |
Variables | |
Lab0x05_taskIMU.S0_INIT = micropython.const(0) | |
creates object S0_INIT connected to constant 0 More... | |
Lab0x05_taskIMU.S1_Update = micropython.const(1) | |
creates object S1_Update connected to constant 1 More... | |
Lab0x05_taskIMU.S2_CAL = micropython.const(2) | |
creates object S2_CAL connected to constant 2 More... | |
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 Lab0x05_taskIMU.taskBNO055Fcn | ( | taskName, | |
period, | |||
zFlag, | |||
posDATA, | |||
calDATA, | |||
DATA, | |||
speedDATA | |||
) |
A generator to implement the Encoder 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. |
timDATA | Shared data for the time during a data recording session. This is not currently utilized by taskUser.py (instead, it is immediately fed into DATA); however, this is shared to taskUser for debugging purposes. |
posDATA | Shared data for printing the position of the encoder upon 'p' or 'P' press. |
delDATA | Shared data for printing the delta value of the encoder upon 'd' or 'D' press. |
DATA | Shared data for data recording upon 'g' or 'G' press. |
Lab0x05_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.
Lab0x05_taskIMU.S1_Update = micropython.const(1) |
creates object S1_Update connected to constant 1
S1_Update is the running state for the taskIMU.py finite state machine. This state is where the IMU object(s) managed by taskIMU.py is/are updated with data read from the physical IMU.
Lab0x05_taskIMU.S2_CAL = micropython.const(2) |
creates object S2_CAL connected to constant 2
S2_CAL is the calibration state for the taskIMU.py finite state machine. This state is where the IMU object(s) managed by taskIMU.py is/are calibrated upon startup to ensure the data being read from the IMU is an accurate reflection of the actual IMU position and dynamics.