Skip to content

Variables related to term I are not being updated when using setPID #9

@blandown

Description

@blandown

When using the setPID () method, the errorSum and maxError variables are not being updated.

This can cause problems in a situation like

m_pid = new MiniPID (10, 0, 0); // I = 0
m_pid-> setOutputLimits (-100, 100); // maxError = 0, maxIOutput = 200
m_pid-> setPID (10,10,10); // maxError continues 0

the output of term I will always be 0 due to the following line

Ioutput=I*errorSum;

.....

else if (maxIOutput! = 0) {
        errorSum = clamp (errorSum + error, -maxError, maxError);
}

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