Reputation: 693
I am building a code to control a heater with a PWM output connected to an SSR using the Arduino-PID-AutoTune-Library. There are two issues I am currently facing with the above library while using the normal mode (not simulating but using actual analog input of a thermocouple) of operation.
The temperature overshoots when I start the operation.
I tried several values for the constants
but still the temperature overshoots by a significant amount.
For e.g. if the Setpoint is 100°C, the process value goes up to 130-140;°C before coming back to stable state between 95 to 110°C.
When I use the Auto tuning feature, the Arduino enters the tuning mode, but the PWM output count just toggles between 50 and 150 and it never comes out of Autotune mode and the temperature goes on increasing continuously even beyond 200°C although the set point is 100°C.
Upvotes: 0
Views: 3901
Reputation: 303
Start with kp adding 0.01 at a time then when your close to the target start adjusting ki by 0.01 then after that kd.
just like in the wiki but this time the increase should be substantially lower to make it accurate
https://upload.wikimedia.org/wikipedia/commons/3/33/PID_Compensation_Animated.gif
Upvotes: 0
Reputation: 832
Your Kp is too high, that's why you have overshoot. From what I remember when I was designing PID, the proportional gain was usually less than 0.01 for me.(That being said it depends on the application) I don't know about arduino auto-tuning but you can tune your variables using matlab, transfer function of the system or using Nyquist plot. It's a pretty involved process.
Upvotes: 1