ME 305
|
Directly interfaces with motors. More...
Functions | |
def | task_motor.taskMotor (taskname, period, motor_drv, mFlag, MFlag, duty, eFlag) |
Task that is in charge of any alterations to drivers or motors. More... | |
Directly interfaces with motors.
Task file to set duty cycle of motor 1 or motor 2. Interfaces with motor.py driver file to interact with the motors. Contains logic to ensure there are no improper duty cycle inputs. Operates for a duration of time specified in main.py
See Term Project for state transition diagrams, task diagrams, plots and video demonstrating the balancing of the ball on the platform along with how the UI was implemented.
def task_motor.taskMotor | ( | taskname, | |
period, | |||
motor_1, | |||
motor_2, | |||
duty_1, | |||
duty_2, | |||
mode | |||
) |
Task that is in charge of any alterations to drivers or motors.
This task sets the duty cycle for both mototr as well as enables driver to allow said motors to operate
taskname | The name of the task |
period | This task is designed to work cooperatively with other tasks. The period is how long it should take for the code to circle back and do this task |
motor_drv | The motor driver name, used to refernce the motors being used in this task |
mFlag | A flag that is active when the m button was pressed in task user. |
MFlag | A flag that is active when the M button was pressed in task user. Holds True or False value dependinf the input from the user in task_user.py. initiates the input duty cycle to motor2 |
duty | A shared variable that hold the duty cycle value for either motor in the driver |
eFlag | A flag that is active when the e button was pressed in task user. Used to tell this task to enable the driver. |
This task sets the duty cycle for both mototr as well as enables driver to allow said motors to operate
taskname | The name of the task |
period | This task is designed to work cooperatively with other tasks. The period is how long it should take for the code to circle back and do this task |
motor_1 | Object to control duty cycle of motor 1 |
motor_2 | Object ot control duty cycle of motor 2 |
duty_1 | Shared variable containing duty cycle for motor 1 |
duty_2 | Shared variable containing duty cycle for motor 2 |
mode | Flag that only allows program to run when ball balancing mode is enabled. |