|
Ball Balancer Project
|
The task that interfaces with the Closed Loop class. More...
Functions | |
| def | taskController.taskControllerFcn (taskName, period, clFlag, Velocity, Duty1, Kp, Ki, Kd, Data, Duty2, Position, Contact) |
| This function interacts with the ClosedLoop driver, sending a duty cycle based on the calculated error. More... | |
Variables | |
| taskController.S0_INIT = micropython.const(0) | |
| taskController.S1_SET = micropython.const(1) | |
| taskController.S2_ACTIVE = micropython.const(2) | |
| taskController.S3_NOBALL = micropython.const(3) | |
The task that interfaces with the Closed Loop class.
This task's main function is to provide the ClosedLoop driver with the user-selected gain and Vref values.
@author Jake Lesher @author Daniel Xu @date 02/23/2022
| def taskController.taskControllerFcn | ( | taskName, | |
| period, | |||
| clFlag, | |||
| Velocity, | |||
| Duty1, | |||
| Kp, | |||
| Ki, | |||
| Kd, | |||
| Data, | |||
| Duty2, | |||
| Position, | |||
| Contact | |||
| ) |
This function interacts with the ClosedLoop driver, sending a duty cycle based on the calculated error.
This function calls upon the driver to set the duty cycle percentage for motor 1.
| taskName | is the name associated the with taskController in main.py. |
| period | sets the rate at which taskController is to run. |
| clFlag | is the shared boolean that toggles closed-loop control. |
| Velocity | is the share of the velocity value with taskEncoder.py |
| Vref | is the share of the velocity requested by the user in taskUser. |
| Duty1 | is the share that contains the duty cycle percentage for motor 1. |
| Kp | is the share of the user-requested proportional gain. |
| Ki | is the share of the user-requested integral gain. |