MRMS
Public Member Functions | List of all members
Mrm_pid Class Reference

#include <mrm-pid.h>

Public Member Functions

 Mrm_pid (float proportionalComponent, float derivativeComponent, float integrativeComponent, HardwareSerial *hardwareSerial=0)
 
float calculate (float inputValue, bool verbose=false)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ 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

Member Function Documentation

◆ 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: