forked from br3ttb/Arduino-PID-Library
-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Faster PID read-compute-write cycle (Arduino UNO): QuickPID = 51µs, PID_v1 = 128µs Updated compute() function New Variable Derivative on Error to Derivative on Measurement parameter DOn Updated PID Query Functions: GetPterm(); GetIterm(); GetDterm(); Updated all examples and documentation
- Loading branch information
Showing
14 changed files
with
141 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/************************************************************************************** | ||
QuickPID Proportional-Derivative on Measurement Example | ||
Increasing the proportional on measurement setting will make the output move more | ||
smoothly when the setpoint is changed. Also, it can eliminate overshoot. | ||
Decreasing the derivative on measurement adds more derivative on error. This reduces | ||
reduce overshoot but may increase output spikes. Adjust to suit your requirements. | ||
**************************************************************************************/ | ||
|
||
#include "QuickPID.h" | ||
|
||
//Define Variables we'll be connecting to | ||
float Setpoint, Input, Output; | ||
float POn = 1.0; // proportional on Error to Measurement ratio (0.0-1.0), default = 1.0 | ||
float DOn = 0.0; // derivative on Error to Measurement ratio (0.0-1.0), default = 0.0 | ||
|
||
//Specify the links and initial tuning parameters | ||
QuickPID myQuickPID(&Input, &Output, &Setpoint, 2, 5, 1, POn, DOn, QuickPID::DIRECT); | ||
|
||
void setup() | ||
{ | ||
//initialize the variables we're linked to | ||
Input = myQuickPID.analogReadFast(0); | ||
Setpoint = 100; | ||
|
||
//turn the PID on | ||
myQuickPID.SetMode(QuickPID::AUTOMATIC); | ||
} | ||
|
||
void loop() | ||
{ | ||
Input = myQuickPID.analogReadFast(0); | ||
myQuickPID.Compute(); | ||
analogWrite(3, Output); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.