PI Module
This class is a proportional-integral controller which is used in the passiv eand active tracking modes to determine the velocity for the motors on the primary and secondary axis.
Class Documentation
Bases: QObject
A class implementing a Proportional-Integral controller.
Attributes:
| Name | Type | Description |
|---|---|---|
array |
list
|
A list to store past error values. |
P |
float
|
Proportional gain. |
I |
float
|
Integral gain. |
grad2step |
float
|
Conversion factor. |
E |
float
|
Current error value. |
V |
float
|
Current process variable value. |
rest |
float
|
Rest value from previous calculations. |
sum |
float
|
Summation of past errors. |
Source code in PI_module.py
__init__(N_array, P, I, conversion)
Initialize the PI controller.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
N_array |
int
|
Length of the array to store past error values. |
required |
P |
float
|
Proportional gain. |
required |
I |
float
|
Integral gain. |
required |
conversion |
float
|
Conversion factor. |
required |
Source code in PI_module.py
feed(E, V)
Feed the controller with the current error and process variable values.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
E |
float
|
Current error value. |
required |
V |
float
|
Current process variable value. |
required |
Source code in PI_module.py
get_speed()
Calculate and return the control output.
Returns:
| Type | Description |
|---|---|
|
None |