ME 305 Group 6 Documentation
|
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... | |
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.
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.
taskName | Brief string to describe the instance of the function. Useful for debug purposes. |
period | Period with which to run the function and update/execute state logic. |
roll_target_duty | Shared data object to encapsulate the desired duty cycle of motor 1. |
pitch_target_duty | Shared data object to encapsulate the desired duty cycle of motor 2. |
taskMotor.S0_INIT = micropython.const(0) |
State 0.
Maps state 0 to a more readable const S0_INIT
taskMotor.S1_COMMAND = micropython.const(1) |
State 1.
Maps state 1 to a more readable const S1_COMMAND