-
firmware V2 "strong PID"
10/12/2022 at 07:40 • 0 commentsThe version2 of the firmware is accessible on my Github
It's a "strong PID" tuning where the motor reaches its target. in one shot.
PID coefficients are quite agressive, but overshoot is very limited and motor does not oscillate.
//PID stuff input = getMotorPos(); Kp = 6000; // start with an almost fully proportionnal PID Ki = 20.; Kd = 100. ; myPID.SetTunings(Kp, Ki, Kd); myPID.Compute();
A compensation factor of the "inertia" of the rotor is introduced (should be tuned if you change motor).
#define INERTIA 1155./4096. //inertia of motor when stopping (PID over shoot on sensor position)
This acts as a bias to setpoint value.
//turn the PID on setpoint = targetRot - INERTIA; //setpoint is this target number corrected of the INERTIA bias
Results are impressively good !
-
firmware V1 (soft PID)
10/12/2022 at 07:35 • 0 commentsThe first version of the firmware is accessible on my Github
It's a "soft PID" tuning where the motor reaches progresively its target.