ME 405 Romi
Loading...
Searching...
No Matches
controller.Controller Class Reference

This file contains a class to create a PID Controller object. More...

Public Member Functions

 __init__ (self, K_p, K_i, K_d, err_sat, eff_sat)

Public Attributes

 K_p = K_p
 K_i = K_i
 K_d = K_d
int summed_errors = 0
int reference = 0
 err_sat = err_sat
 effort_saturation = eff_sat

Detailed Description

This file contains a class to create a PID Controller object.

These objects are always initialized as PID controllers but can be ran as any combination of P, I, and D controllers. They are to be treated as classical controls single input, single output controllers.

The controller object has gains that are given to it on initialization. The object holds a set point and will use classical control theory of errors from the setpoint for return values when asking for control. The object also handles saturating the integral error sum and the output effort as set on initialization.

Author
Alex Power, Lucas Heuchert, Erik Heuchert
Date
2025-Sept-28 Approximate date of creation of file
2025-Dec-12 Final alterations made

The Controller class is a classical PID controller that implements single input, single output control when called to. The user gives it gains and setpoints and calls the control function for efforts.

init is the Controller object initializer which takes 5 arguments. The arguments the gains and saturation points of the classical controller.

Parameters
K_p: K_p is the proportional gain.
K_i: K_i is the integral gain.
K_dK_d is the derivative gain, but it is not implemented as it was not used in the project.
err_sat: err_sat is the saturation point for the integral of the error to stop I control from becoming unstable.
eff_sat: eff_sat is the saturation point for the output effort.

Definition at line 19 of file controller.py.

Constructor & Destructor Documentation

◆ __init__()

controller.Controller.__init__ ( self,
K_p,
K_i,
K_d,
err_sat,
eff_sat )

Definition at line 21 of file controller.py.

Member Data Documentation

◆ effort_saturation

controller.Controller.effort_saturation = eff_sat

Definition at line 28 of file controller.py.

◆ err_sat

controller.Controller.err_sat = err_sat

Definition at line 27 of file controller.py.

◆ K_d

controller.Controller.K_d = K_d

Definition at line 24 of file controller.py.

◆ K_i

controller.Controller.K_i = K_i

Definition at line 23 of file controller.py.

◆ K_p

controller.Controller.K_p = K_p

Definition at line 22 of file controller.py.

◆ reference

int controller.Controller.reference = 0

Definition at line 26 of file controller.py.

◆ summed_errors

int controller.Controller.summed_errors = 0

Definition at line 25 of file controller.py.


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