|
|
| state |
| | The state to run on the next iteration of the task.
|
| |
|
| interval |
| | The amount of time in microseconds between runs of the task.
|
| |
|
| start_time |
| | The timestamp for the first iteration.
|
| |
|
| next_time |
| | The "timestamp" for when the task should run next.
|
| |
| | User_Button |
| | Defining nucleo user input button as external interrupt self.Fault_Interrupt = pyb.ExtInt(pyb.Pin.board.PB2, pyb.ExtInt.IRQ_FALLING, pyb.Pin.PULL_UP, self.Fault_Detection) More...
|
| |
|
| mot1 |
| | Define motor 2, controls rotation about X axis.
|
| |
|
| mot2 |
| | Define motor 1, controls rotation about Y axis.
|
| |
|
| Touch_Panel |
| | Define touch panel driver.
|
| |
|
| Platform |
| | Define Initialized Platform Controller.
|
| |
|
| Platform_Ball |
| | Define Initialized Platform and Ball Controller.
|
| |
|
| IMU |
| | Define BNO055 sensor object.
|
| |
|
| pos_X |
| | Variable storing two most recent X contact positions.
|
| |
|
| pos_Y |
| | Variable storing two most recent Y contact positions.
|
| |
|
| theta_X |
| | Variable storing two most recent angles about X.
|
| |
|
| theta_Y |
| | Variable storing two most recent angles about Y.
|
| |
|
| runs |
| | Variable storing number of loops through Platform/Ball control.
|
| |
|
| curr_time |
| | Updates current time.
|
| |
|
| Touch_Data |
| | Variable storing current touch panel data for each loop.
|
| |
|
| IMU_Data |
| | Variable storing current IMU sensor data for each loop.
|
| |
|
|
int | S0_INIT = 0 |
| | Constant defining state 0 - Initialization.
|
| |
|
int | S1_PLATFORM_ZERO = 1 |
| | Constant defining state 1 - Zero the Platform.
|
| |
|
int | S2_BALANCE = 2 |
| | Constant defining state 2 - Balance the Ball.
|
| |
|
int | S3_FAULT = 3 |
| | Constant defining state 3 - Fault Correction.
|
| |
◆ __init__()
| def PB_FSM.Platform_Ball_Task.__init__ |
( |
|
self, |
|
|
|
interval |
|
) |
| |
Defines variables and objects needed for FSM.
- Parameters
-
| interval | Input for time between runs in microseconds |
◆ Fault_Detection()
| def PB_FSM.Platform_Ball_Task.Fault_Detection |
( |
|
self, |
|
|
|
pin |
|
) |
| |
This method manages fault and prevents danger to user.
When this method is called by the FSM or external interrupt both motors are disabled and the FSM moves into state 3 which waits for a user input before resuming operation.
◆ transitionTo()
| def PB_FSM.Platform_Ball_Task.transitionTo |
( |
|
self, |
|
|
|
newState |
|
) |
| |
Sets new state.
- Parameters
-
| newState | Variable representing the desired new state |
◆ User_Button
| PB_FSM.Platform_Ball_Task.User_Button |
Defining nucleo user input button as external interrupt self.Fault_Interrupt = pyb.ExtInt(pyb.Pin.board.PB2, pyb.ExtInt.IRQ_FALLING, pyb.Pin.PULL_UP, self.Fault_Detection)
Setting up Nucleo user button for fault reset
The documentation for this class was generated from the following file: