0.1.5 PID_RT

This commit is contained in:
rob tillaart 2022-11-22 11:48:02 +01:00
parent ddd5c8e42a
commit 1241b83a82
8 changed files with 125 additions and 66 deletions

View File

@ -1,3 +1,18 @@
platforms:
rpipico:
board: rp2040:rp2040:rpipico
package: rp2040:rp2040
gcc:
features:
defines:
- ARDUINO_ARCH_RP2040
warnings:
flags:
packages:
rp2040:rp2040:
url: https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json
compile: compile:
# Choosing to run compilation tests on 2 different Arduino platforms # Choosing to run compilation tests on 2 different Arduino platforms
platforms: platforms:
@ -9,3 +24,4 @@ compile:
- esp32 - esp32
# - esp8266 # - esp8266
# - mega2560 # - mega2560
- rpipico

View File

@ -0,0 +1,36 @@
# Change Log PID_RT
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
## [0.1.5] - 2022-10-23
- add RP2040 to build-CI
- add changelog.md
- minor edits readme.md
## [0.1.4] - 2021-12-23
- update library.json, license,
- minor edits
## [0.1.3] - 2021-11-12
- update build-CI, update readme
- renamed variables for readability
- added history
- fixed bug in setK
## [0.1.2] - 2021-05-28
- minor edits
## [0.1.1] - 2021-05-27
- add json check
- add lint check
## [0.1.0] - 2020-12-15
- update readme, fix unit test,
- fix library.json
- add 2nd constructor

View File

@ -1,21 +1,9 @@
// //
// FILE: PID_RT.h // FILE: PID_RT.cpp
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.4 // VERSION: 0.1.5
// PURPOSE: PID library for Arduino // PURPOSE: PID library for Arduino
// URL: https://github.com/RobTillaart/PID // URL: https://github.com/RobTillaart/PID
//
// HISTORY
// 0.1.0 2020-12-15 update readme, fix unit test,
// fix library.json
// add 2nd constructor
// 0.1.1 2021-05-27 add json check, add lint check
// 0.1.2 2021-05-28 minor edits
// 0.1.3 2021-11-12 update build-CI, update readme
// renamed variables for readability
// added history
// fixed bug in setK
// 0.1.4 2021-12-23 update library.json, license, minor edits
#include "PID_RT.h" #include "PID_RT.h"

View File

@ -2,7 +2,7 @@
// //
// FILE: PID_RT.h // FILE: PID_RT.h
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// VERSION: 0.1.4 // VERSION: 0.1.5
// PURPOSE: PID library for Arduino // PURPOSE: PID library for Arduino
// URL: https://github.com/RobTillaart/PID_RT // URL: https://github.com/RobTillaart/PID_RT
@ -10,7 +10,7 @@
#include "Arduino.h" #include "Arduino.h"
#define PID_LIB_VERSION (F("0.1.4")) #define PID_LIB_VERSION (F("0.1.5"))
class PID_RT class PID_RT

View File

@ -44,7 +44,7 @@ Overwrites the values set in the constructor.
- **bool isRunning()** return the enable/disable flag. - **bool isRunning()** return the enable/disable flag.
### Additional parameters ### Behaviour parameters
- **bool setInterval(uint32_t interval)** set the interval between two **compute()** calls. - **bool setInterval(uint32_t interval)** set the interval between two **compute()** calls.
Returns **true** if changed, otherwise **false**. Returns **true** if changed, otherwise **false**.
@ -54,12 +54,20 @@ Returns **true** if changed, otherwise **false**.
- **float getOutputMax()** read back setting rangeMax. - **float getOutputMax()** read back setting rangeMax.
- **void setReverse(bool reverse)** reverse behaviour, seldom needed. - **void setReverse(bool reverse)** reverse behaviour, seldom needed.
- **bool getReverse()** read back the setting. - **bool getReverse()** read back the setting.
### K-parameters
- **bool setKp(float Kp)** runtime updates are allowed - at your own risk. - **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 setKi(float Ki)** runtime updates are allowed - at your own risk.
- **bool setKd(float Kd)** 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 getKp()** read back setting.
- **float getKi()** read back setting. - **float getKi()** read back setting.
- **float getKd()** read back setting. - **float getKd()** read back setting.
### Proportional
- **void setPropOnInput()** this is default behaviour. - **void setPropOnInput()** this is default behaviour.
- **void setPropOnError()** alternative. - **void setPropOnError()** alternative.
- **bool isPropOnInput()** read back setting. - **bool isPropOnInput()** read back setting.
@ -83,8 +91,20 @@ See examples.
## Future ## Future
- update documentation #### must
- update / improve documentation
- more testing
#### should
- add examples to test more - add examples to test more
- improve unit test - improve unit test
- - move all code to .cpp
#### could
- add reference to PID book / website?
- investigate if it works as PI or P controller too.
- PI as derived or base class?

View File

@ -2,7 +2,6 @@
// FILE: PID_basic.ino // FILE: PID_basic.ino
// AUTHOR: Rob Tillaart // AUTHOR: Rob Tillaart
// PURPOSE: demo // PURPOSE: demo
// DATE: 2020-12-15
// //
// connect an LED to the PWM pin // connect an LED to the PWM pin
// connect a potentiometer to A0 // connect a potentiometer to A0
@ -15,7 +14,7 @@ PID_RT PID;
const int PWM_PIN = 3; // UNO PWM pin const int PWM_PIN = 3; // UNO PWM pin
int op = 0;; int op = 0;
float input = 0; float input = 0;

View File

@ -15,7 +15,7 @@
"type": "git", "type": "git",
"url": "https://github.com/RobTillaart/PID_RT" "url": "https://github.com/RobTillaart/PID_RT"
}, },
"version": "0.1.4", "version": "0.1.5",
"license": "MIT", "license": "MIT",
"frameworks": "arduino", "frameworks": "arduino",
"platforms": "*", "platforms": "*",

View File

@ -1,5 +1,5 @@
name=PID_RT name=PID_RT
version=0.1.4 version=0.1.5
author=Rob Tillaart <rob.tillaart@gmail.com> author=Rob Tillaart <rob.tillaart@gmail.com>
maintainer=Rob Tillaart <rob.tillaart@gmail.com> maintainer=Rob Tillaart <rob.tillaart@gmail.com>
sentence=Arduino PID library sentence=Arduino PID library