Mechatronics Portfolio
Logan Williamson's Mechatronics Portfolio and Documentation Repository
Functions | Variables
Lab0x05_taskIMU.py File Reference

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...
 

Detailed Description

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.

Author
Logan Williamson
Brianna Roberts
Date
01/23/2022

Function Documentation

◆ taskBNO055Fcn()

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.

Parameters
taskNameThe name of the task as a string.
periodThe task interval or period specified as an integer number of microseconds.
zFlagShared flag variable which causes FSM to enter zeroing state.
timDATAShared 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.
posDATAShared data for printing the position of the encoder upon 'p' or 'P' press.
delDATAShared data for printing the delta value of the encoder upon 'd' or 'D' press.
DATAShared data for data recording upon 'g' or 'G' press.

Variable Documentation

◆ S0_INIT

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.

◆ S1_Update

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.

◆ S2_CAL

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.