Motor task that creates variables for motor driver functions and parameters. More...
Public Member Functions | |
| def | __init__ (self, period_motor, motor_obj, motor_drv, L, balance_flag, state_vect_x, state_vect_y, disable_flag, closedloop) |
| Constructs a motor task. More... | |
| def | run (self) |
| Runs one iteration of the FSM. | |
| def | transition_to (self, new_state) |
| Transitions the FSM to a new state. More... | |
Public Attributes | |
| motor_obj | |
| The motor object that calls motors 1 or 2. More... | |
| motor_drv | |
| The motor driver object that calls DRV8847. More... | |
| L | |
| Variable used to define actuation level. More... | |
| balance_flag | |
| A boolean flag used to start balancing the platform and/or ball. More... | |
| disable_flag | |
| A boolean flag used to disable motors. More... | |
| state_vect_x | |
| A shared list used to define state vector x. More... | |
| state_vect_y | |
| A shared list used to define state vector y. More... | |
| period_motor | |
| The frequency of the task. More... | |
| state | |
| Initializes starting state to be state 2. More... | |
| runs | |
| Sets the number of runs to 0. More... | |
| closedloop | |
| The controller object that refers to closedloop.py. More... | |
Motor task that creates variables for motor driver functions and parameters.
Implements a finite state machine for the motor driver
| def LabFF_task_motor.Task_Motor.__init__ | ( | self, | |
| period_motor, | |||
| motor_obj, | |||
| motor_drv, | |||
| L, | |||
| balance_flag, | |||
| state_vect_x, | |||
| state_vect_y, | |||
| disable_flag, | |||
| closedloop | |||
| ) |
Constructs a motor task.
The motor task is implemented as a finite state machine.
| period | The period, in microseconds, between runs of the task |
| motor_obj | The motor object that calls motors 1 or 2 |
| motor_drv | The motor driver object that calls DRV8847 |
| enable_flag | A boolean flag used to enable a corresponding motor |
| step_flag | A boolean flag used to start step response |
| L | Variable used to define actuation level |
| def LabFF_task_motor.Task_Motor.transition_to | ( | self, | |
| new_state | |||
| ) |
Transitions the FSM to a new state.
A function that transitions the FSM to a new state
| new_state | The state to transition to |
| LabFF_task_motor.Task_Motor.balance_flag |
A boolean flag used to start balancing the platform and/or ball.
Works with the motor task and user interface to implement closed-loop control that balances the platform and ball
| LabFF_task_motor.Task_Motor.closedloop |
The controller object that refers to closedloop.py.
Creates the controller object used to perform closed loop speed control of the motors
| LabFF_task_motor.Task_Motor.disable_flag |
A boolean flag used to disable motors.
Works with the motor task and user interface to halt motor movement
| LabFF_task_motor.Task_Motor.L |
Variable used to define actuation level.
This value is calculated using gain, measured angular velocity, and reference angular velocity
| LabFF_task_motor.Task_Motor.motor_drv |
The motor driver object that calls DRV8847.
This motor driver was defined in the main.py file
| LabFF_task_motor.Task_Motor.motor_obj |
The motor object that calls motors 1 or 2.
Motors 1 or 2 were defined in the main.py file
| LabFF_task_motor.Task_Motor.period_motor |
The frequency of the task.
Defines variable that specifies timer frequency
| LabFF_task_motor.Task_Motor.runs |
Sets the number of runs to 0.
Defines a variable to keep track of runs
| LabFF_task_motor.Task_Motor.state |
Initializes starting state to be state 2.
Motors begin in the stop state
| LabFF_task_motor.Task_Motor.state_vect_x |
A shared list used to define state vector x.
Contains variables for x position, theta y, x velocity, and angular velocity (theta y dot)
| LabFF_task_motor.Task_Motor.state_vect_y |
A shared list used to define state vector y.
Contains variables for y position, theta x, y velocity, and angular velocity (theta x dot)