CALPOLY MECHATRONICS
Documentation for all Mechatronics Labs
ME405_FP_ControllerTask.py File Reference

The controller task implements a full state controller to calculate the duty cycles for both motors required to balance the ball. More...

Functions

def ME405_FP_ControllerTask.controllerTaskFun ()
 A generator function used to calculate the duty cycle of each motor. More...
 

Variables

 ME405_FP_ControllerTask.testTask
 

Detailed Description

The controller task implements a full state controller to calculate the duty cycles for both motors required to balance the ball.

The controller task reads the system state shared by the encoder task and the touch panel task. Then, it uses two full state contollers (one for the x and one for the y axis) to calculate the apropriate duty cycle for each motor to balance the ball. The duty cycles are then shared with the motor task.
source code: https://bitbucket.org/eliotBriefer/me405_term_project/src/master/Tasks/ME405_FP_ControllerTask.py

Author
Eliot Briefer @Date 6/11/2021

Function Documentation

◆ controllerTaskFun()

def ME405_FP_ControllerTask.controllerTaskFun ( )

A generator function used to calculate the duty cycle of each motor.

controllerTaskFun is formatted as a generator function for use with cotask.py and task_share.py.

Variable Documentation

◆ testTask

ME405_FP_ControllerTask.testTask
Initial value:
1 = cotask.Task(controllerTaskFun, name = 'controller_task_test', priority = 1,
2  period = 1000, profile = True, trace = False)
This class implements behavior common to tasks in a cooperative multitasking system which runs in Mic...
Definition: cotask.py:49