Plot Something - ME 405 Term Project
controller_agena_chiu.ControllerDriver Class Reference

This class implements a controller driver for a motor and flywheel rig. More...

Public Member Functions

def __init__ (self, K_p, i_set)
 Creates a controller driver by initializing the gain and initial setpoint used in closed-loop control. More...
 
def run (self, pos, max_duty)
 Called repeatedly to run the control algorithm. More...
 
def flag (self)
 Sets returns a true statement if the error lands within the specified bounds to stop the controller and move to the next value. More...
 
def set_setpoint (self, setpoint)
 Sets the setpoint. More...
 
def set_gain (self, gain)
 Sets the proportional gain. More...
 

Public Attributes

 K_p
 Proportional Gain.
 
 i_set
 Initial setpoint.
 
 error
 Error, difference between the current position and initial setpoint.
 

Detailed Description

This class implements a controller driver for a motor and flywheel rig.

Constructor & Destructor Documentation

◆ __init__()

def controller_agena_chiu.ControllerDriver.__init__ (   self,
  K_p,
  i_set 
)

Creates a controller driver by initializing the gain and initial setpoint used in closed-loop control.

Parameters
K_pThe initial proportional gain for the controller.
i_setThe initial setpoint for the controller.

Member Function Documentation

◆ flag()

def controller_agena_chiu.ControllerDriver.flag (   self)

Sets returns a true statement if the error lands within the specified bounds to stop the controller and move to the next value.

Returns
flag returns a true statement if error is within the bounds.

◆ run()

def controller_agena_chiu.ControllerDriver.run (   self,
  pos,
  max_duty 
)

Called repeatedly to run the control algorithm.

Parameters
posCurrent position of the encoder.
Returns
duty Duty cycle to set the motor.

◆ set_gain()

def controller_agena_chiu.ControllerDriver.set_gain (   self,
  gain 
)

Sets the proportional gain.

Parameters
gainThe new proportional gain used for the controller.

◆ set_setpoint()

def controller_agena_chiu.ControllerDriver.set_setpoint (   self,
  setpoint 
)

Sets the setpoint.

Parameters
setpointThe new setpoint used for the controller.

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