Luisa Chiu Portfolio
closedloop.ClosedLoop Class Reference

A closed loop speed control used in conjuction with the motor and encoder drivers. More...

Public Member Functions

def __init__ (self, sat_max, sat_min, L, state_vect, gain)
 Constructs a controller object that computes an actuation value based on reference and measured values. More...
 
def run (self)
 Uses state vector values and gain values to compute torque to compute actuation value L.
 
def get__Kp (self)
 Returns gain value for modification.
 
def set__Kp (self, Kp)
 Sets modified gain value.
 

Public Attributes

 sat_max
 Variable used to define maximum saturation limit for the PWM level. More...
 
 sat_min
 Variable used to define minimum saturation limit for the PWM level. More...
 
 L
 Variable used to define actuation level for motor 1. More...
 
 gain
 Variable used to define proportional gain value. More...
 
 state_vect
 Variable used to define state vectors. More...
 
 state_vect_array
 Variable used to define the array for state vectors. More...
 
 Torque
 Variable used to define the torque calculated. More...
 
 Kp
 Kp represents the proportional gain value. More...
 

Detailed Description

A closed loop speed control used in conjuction with the motor and encoder drivers.

Objects of this class can be used to control and monitor motor speed

Constructor & Destructor Documentation

◆ __init__()

def closedloop.ClosedLoop.__init__ (   self,
  sat_max,
  sat_min,
  L,
  state_vect,
  gain 
)

Constructs a controller object that computes an actuation value based on reference and measured values.

This class uses gains and position and angle data to compute an actuation value.

Parameters
sat_maxVariable used to define maximum saturation limit for the PWM level used for motor speed
sat_minVariable used to define minimum saturation limit for the PWM level used for motor speed
LVariable used to define actuation level @state_vect Variable used to define state vectors
gainVariable used to define proportional gain value

Member Data Documentation

◆ gain

closedloop.ClosedLoop.gain

Variable used to define proportional gain value.

This value is the proportional gain inputted by the user.

◆ Kp

closedloop.ClosedLoop.Kp

Kp represents the proportional gain value.

This value is used for modification

◆ L

closedloop.ClosedLoop.L

Variable used to define actuation level for motor 1.

This value is calculated using gain, position data, and angle data

◆ sat_max

closedloop.ClosedLoop.sat_max

Variable used to define maximum saturation limit for the PWM level.

This value is set to ensure the motor does not fall below a maximum PWM level

◆ sat_min

closedloop.ClosedLoop.sat_min

Variable used to define minimum saturation limit for the PWM level.

This value is set to ensure the motor does not fall below a minimum PWM level

◆ state_vect

closedloop.ClosedLoop.state_vect

Variable used to define state vectors.

This array is filled with data in the following order: [position, velocity, angle, angular velocity]

◆ state_vect_array

closedloop.ClosedLoop.state_vect_array

Variable used to define the array for state vectors.

This array will be filled with state vector data read from the touch panel and IMU

◆ Torque

closedloop.ClosedLoop.Torque

Variable used to define the torque calculated.

This value is calculated using gain values and the state vector values


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