Skip to content

esp32 adaptive tuning #140

@tomislav12

Description

@tomislav12

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions