Lucas Murray ME 305 Portfolio
Public Member Functions | Public Attributes | List of all members
closedLoopControl.ClosedLoop Class Reference

A closed loop feedback object that calculates error in velocity. More...

Public Member Functions

def __init__ (self, controlParameters, delta)
 Initializes and returns a closed loop object. More...
 
def update (self, controlParameters, delta)
 Updates the feedback error found by the closed loop control. More...
 
def setGain (self)
 A currently unused function that would set the gain value for the proportional control. More...
 

Public Attributes

 actualVel
 
 propGain
 
 motorDuty
 

Detailed Description

A closed loop feedback object that calculates error in velocity.

Objects of this class can find the error in the current velocity when compared to an arbitrary desired velocity when paired with a proportional gain coefficient.

Constructor & Destructor Documentation

◆ __init__()

def closedLoopControl.ClosedLoop.__init__ (   self,
  controlParameters,
  delta 
)

Initializes and returns a closed loop object.

Parameters
controlParametersA shared variable that contains the reference velocity and proportional gain
deltaA shared variable that contains the change in position of the motor, updated every 10ms

Member Function Documentation

◆ setGain()

def closedLoopControl.ClosedLoop.setGain (   self)

A currently unused function that would set the gain value for the proportional control.

Instead of using this function, we found it easier to use a shared variable that contains the gain as the gain is reference in the user Task which never instantiates a closed loop object

◆ update()

def closedLoopControl.ClosedLoop.update (   self,
  controlParameters,
  delta 
)

Updates the feedback error found by the closed loop control.

Parameters
controlParametersA shared variable that contains the reference velocity and proportional gain
deltaA shared variable that contains the change in position of the motor, updated every 10ms

The documentation for this class was generated from the following file: