Scientifically tuning the PID


 

Dave Casazza

TVWBB Fan
Hi all,

Has anyone taken a look at these pages for trying to tune the PID controller?

http://www.vandelogt.nl/htm/regelen_pid_uk.htm#PID3

I've tried it out, and I get insane values, such as P=.4, I=800, even for the more conservative models.

The units generated by the reference page are:
Kc [%/(°C)] Ti [sec.] Td [sec.]

I'm thinking I'm comparing apples v.s. oranges - does anyone know what the units are for the PID settings in the HM code? I suspect that they are different?

Thanks,

Dave
 
Last edited:
All their formulas are based off "a velocity algorithm for implementation of the discretised PID controller", whereas every other open source project uses a non-continuous approximation. I'm not sure how to convert between the two, but their Kc is not a Kp, despite the units being the same (% per degree). Kp is the value multiplied by the error (current - setpoint) and Kc is a value multiplied by the discrete derivative of the error (error - lasterror).

HeaterMeter's units are wiki:
P - Percent per degree error (instantaneous)
I - Percent per accumulated degrees error (add up the instantaneous)
D - Percent per degree error change
 
I've looked at the PID autotuner in my 3D Printer firmware as possibly something I'd integrate into HeaterMeter but it gave me pretty bad results too. You could try this:

-- Using P-only control like described in the wiki get yourself into a stable loop.
-- Record the max temperature for the cycle (max), min temperature for the cycle (min) and duration of a single cycle in seconds (Tu)
-- Ku = (4 * P) / (3.14159 * (max-min) / 2)

Kp = 0.6 * Ku
Ki = (2 * Kp) / Tu
Kd = Kp * Tu / 8
 

 

Back
Top