#include <mrm-pid.h>
|
| Mrm_pid (float proportionalComponent, float derivativeComponent, float integrativeComponent, HardwareSerial *hardwareSerial=0) |
|
float | calculate (float inputValue, bool verbose=false) |
|
Purpose: A simple proportional–integral–derivative controller (PID controller or three term controller).
- Author
- MRMS team
- Version
- 0.1 2018-02-19 Licence: You can use this code any way you like.
◆ Mrm_pid()
Mrm_pid::Mrm_pid |
( |
float |
proportionalComponent, |
|
|
float |
derivativeComponent, |
|
|
float |
integrativeComponent, |
|
|
HardwareSerial * |
hardwareSerial = 0 |
|
) |
| |
Constructor
- Parameters
-
proportionalComponent | - The bigger it is, the more will an error value correct the error. |
derivativeComponent | - The bigger it is, the more will an error change correct the error. |
integrativeComponent | - The bigger it is, the more will a cumulative error correct the error. |
hardwareSerial | - Serial, Serial1, Serial2,... - an optional serial port, for example for Bluetooth communication |
◆ calculate()
float Mrm_pid::calculate |
( |
float |
valueNow, |
|
|
bool |
verbose = false |
|
) |
| |
Calculation
- Parameters
-
inputValue | - Input value, for example an error. |
verbose | - Display to screen. |
- Returns
- - A calculated value, for example a change in robot's direction (motors' speed) needed to correct the error.
The documentation for this class was generated from the following files:
- C:/Users/priba/Documents/PlatformIO/Projects/MRMS/lib/mrm-pid/src/mrm-pid.h
- C:/Users/priba/Documents/PlatformIO/Projects/MRMS/lib/mrm-pid/src/mrm-pid.cpp