Dlloydev / QuickPID

A fast PID controller with multiple options. Various Integral anti-windup, Proportional, Derivative and timer control modes.
MIT License
195 stars 50 forks source link

bug fix #70

Closed trilokeshtarala closed 1 year ago

trilokeshtarala commented 1 year ago

Resolved the following error while building in esp-idf in commit id: "97c5a1b83815075aef9c0efcd06985d5ff5ebfd8"

error: 'QuickPID::Control' has not been declared
   motorPID1.SetMode(motorPID1.Control::automatic);
Dlloydev commented 1 year ago

Thank you for your interest and pull request. I haven't used the esp-idf toolkit before, but your updates look good.

I'll do the merge then push a small edit to the readme comment and move it to just after the main paragraph:

QuickPID is an updated implementation of the Arduino PID library with additional features for PID control. By default, this implementation closely follows the method of processing the p,i,d terms as in the PID_v1 library except for using a more advanced anti-windup mode. Integral anti-windup can be based on conditionally using PI terms to provide some integral correction, prevent deep saturation and reduce overshoot. Anti-windup can also be based on clamping only, or it can be turned completely off. Also, the proportional term can be based on error, measurement, or both. The derivative term can be based on error or measurement. PID controller modes include timer, which allows external timer or ISR timing control.

Note: You can use this library in esp-idf tool to program esp32 by cloning this repo into your components folder, then clean the build and rebuild.