-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32 adaptive tuning #140
Comments
Another question, I found this inside the library code:
Is input really needed to be 0-1023 or can it be eg 0-12? |
There are no bounds on the input limits. The input need only be in the same units/range to be compatible with Setpoint, so that these calculations make sense: Arduino-PID-Library/PID_v1.cpp Lines 65 to 69 in 524a426
This reference to a non-existent SetInputLimits is spurious: Arduino-PID-Library/PID_v1.cpp Lines 146 to 153 in 524a426
|
double Setpoint, Input, Output;
PID myPID(&Input, &Output, &Setpoint, 0, 0, 0, DIRECT);
setup() {
Input = 10;
Setpoint = 10;
double Kp = 10; // CHANGED
double Ki = 0;
double Kd = 0;
myPID.SetOutputLimits(-200, 200);
myPID.SetSampleTime(16);
myPID.SetMode(AUTOMATIC);
myPID.SetTunings(Kp, Ki, Kd);
}
loop() {
// below is simplified, in real code it is in some function call):
Input = 5; // (simplified change)
myPID.Compute();
SerialBT.println(Output); // only takes initial params into consideration (0,0,0) ! Why is that?
}
Second question, I need to have params 20,0,-10, can Kd be below zero?
The text was updated successfully, but these errors were encountered: