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

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)
 

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

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.
posDATAShared data array for printing the angular positions of the IMU upon 'p' or 'P' press.
calDATAShared data array for printing the position of the encoder upon 'c' or 'C' press.
DATAShared data for data recording upon 'g' or 'G' press. This
speedDATAShared data array for printing the angular velocities of the IMU upon 'd' or 'D' press.

Variable Documentation

◆ S0_INIT

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.