ME 305 Group 6 Documentation
Functions | Variables
taskMotor.py File Reference

Creates and controls motor objects. More...

Functions

def taskMotor.taskMotorFcn (str taskName, int period, shares.Share roll_target_duty, shares.Share pitch_target_duty)
 Function to execute the state management functionality for the motor tasks. More...
 

Variables

 taskMotor.S0_INIT = micropython.const(0)
 State 0. More...
 
 taskMotor.S1_COMMAND = micropython.const(1)
 State 1. More...
 

Detailed Description

Creates and controls motor objects.

Continuously updates the motors with desired duty cycles after initialization. This task initializes the X (roll) motor to be on pins B0 and B1, and timer channels 3 and 4. The Y (pitch) motor is configured on pins B4 and B5, and timer channels 1 and 2. This task also saturates duty cycles to a maximum of +/-100, printing a warning if this saturation limit is reached.

Author
Caleb Savard
Chris Linthacum
Date
February 23, 2022

Function Documentation

◆ taskMotorFcn()

def taskMotor.taskMotorFcn ( str  taskName,
int  period,
shares.Share  roll_target_duty,
shares.Share  pitch_target_duty 
)

Function to execute the state management functionality for the motor tasks.

Function manages states for the management of motor functions. Performs all motor related processes including setting motor duty cycle, initialization, and clearing faults.

Parameters
taskNameBrief string to describe the instance of the function. Useful for debug purposes.
periodPeriod with which to run the function and update/execute state logic.
roll_target_dutyShared data object to encapsulate the desired duty cycle of motor 1.
pitch_target_dutyShared data object to encapsulate the desired duty cycle of motor 2.

Variable Documentation

◆ S0_INIT

taskMotor.S0_INIT = micropython.const(0)

State 0.

Maps state 0 to a more readable const S0_INIT

◆ S1_COMMAND

taskMotor.S1_COMMAND = micropython.const(1)

State 1.

Maps state 1 to a more readable const S1_COMMAND