GY-63_MS5611/libraries/PID_RT
2021-05-28 13:41:04 +02:00
..
.github/workflows add arduino-lint 2021-05-28 13:17:38 +02:00
examples/PID_basic 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
test 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
.arduino-ci.yml 2021-01-29 2021-01-29 12:31:58 +01:00
keywords.txt 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
library.json 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
library.properties 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
LICENSE 2021-01-29 2021-01-29 12:31:58 +01:00
PID_RT.cpp 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
PID_RT.h 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00
README.md 0.1.2 PID_RT 2021-05-28 13:41:04 +02:00

Arduino CI License: MIT GitHub release

PID_RT

Arduino library for PID controller

Description

The PID_RT class allows the user to instantiate a PID controller.

Interface

Constructor

  • PID_RT() minimal constructor.
  • PID_RT(float sp, float Kp, float Ki, float Kd) constructor that sets minimal parameters to get started.

Core

  • void reset() resets internals to startup.
  • void setPoint(float sp) sets setPoint, that needs to be reached.
  • float getSetPoint() read setPoint.
  • bool compute(float input) does one iteration of the PID controller. Returns true after calculation. Returns false if not computed, either stop flag or not yet time to calculate.
  • float getOutput() get the last calculated output value.
  • bool setK(float Kp, float Ki, float Kd) Set the initial P I D parameters as a group.

Start Stop

  • void start() // enable the PID controller to compute new output values.
  • void stop() disable the PID controller compute().
  • bool isRunning()

Additional parameters

  • bool setInterval(uint32_t interval) set the interval between 2 compute() calls. Returns true if changed, otherwise false.
  • uint32_t getInterval() read back setting
  • void setOutputRange(float rmin, float rmax) tune the output range, default 0..100
  • float getOutputMin() read back setting
  • float getOutputMax() read back setting
  • void setReverse(bool reverse) reverse behavior, seldom needed.
  • bool getReverse() read back the setting.
  • bool setKp(float Kp) runtime updates are allowed - at your own risk.
  • bool setKi(float Ki) runtime updates are allowed - at your own risk.
  • bool setKd(float Kd) runtime updates are allowed - at your own risk.
  • float getKp() read back setting.
  • float getKi() read back setting.
  • float getKd() read back setting.
  • void setPropOnInput() default.
  • void setPropOnError() alternative.
  • bool isPropOnInput() read back setting.
  • bool isPropOnError() read back setting.

debugging calls

Might be obsolete in future.

  • float getInput() read last input.
  • float getLastError() read the last error.
  • uint32_t getLastTime() read the last.

Operations

See examples.