How to enable REVERSE? #69
Unanswered
sabellnikov
asked this question in
Q&A
Replies: 2 comments 2 replies
-
Here's an example ... // PID Controller Direction Test
#include "QuickPID.h"
//Define Variables we'll be connecting to
float Setpoint, Input, Output;
float Kp = 2, Ki = 5, Kd = 1;
//Specify PID links
QuickPID myPID(&Input, &Output, &Setpoint);
void setup()
{
Serial.begin(115200);
//print the default controller direction (0) is direct, (1) is reverse
Serial.print("Default Direction: ");
Serial.println(myPID.GetDirection());
//now set the controller direction to reverse
myPID.SetControllerDirection(myPID.Action::reverse);
// or you can use
myPID.SetControllerDirection(1);
// check and print the direction
Serial.print("New Direction: ");
Serial.println(myPID.GetDirection());
//now set the controller direction to direct
myPID.SetControllerDirection(myPID.Action::direct);
// or you can use
myPID.SetControllerDirection(0);
// check and print the direction
Serial.print("New Direction: ");
Serial.println(myPID.GetDirection());
}
void loop() {
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
but if I'd like to change sample time? I should use: Thank you for best library, I've spent many time reading your article, but I should ask you to write more siimple examples how to use "settings" for library.... |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, @Dlloydev, I'm newby in programming. Don't judge me.
I wanna enable REVERSE, but if I put
void SetControllerDirection(Reverse); // Set controller action to direct (default) or reverse
It doesn't building at all... Please give me an example how to use "internal state" function in any basic examples of your code.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions