Electronic – How to tune this PID for the coffee machine

pid controller

I have tried to reach out to the developer of this software with no success. There seems to be an error in the code, and when you follow the steps, the last step does nothing.

Steps for PID Tuning (Ziegler-Nichols Open-Loop):

  • Set to Manual Mode and 100% Duty Cycle
  • Wait for Temperature to increase by at least 10%
  • Turn Temp Controller off and Stop data capture
  • Highlight Sloped Line after Dead Time on Plot

(I would have assumed in the bottom right corner it would suggest new values but in the Java code you get an error (when you highlight you get 0,0 instead of what's actually on the graph.)

Anyway. I have researched how to adjust/tune a PID, but whenever I try to cross-reference this one, the letters don't match up. Usually kp ki etc. but I have PID Kc parameter, PID Ti parameter, PID Td parameter.

So can anyone suggest how I can tune this manually?
And also explain to me what these inputs mean? Actually ELI5

I know the setpoint is the target temp, but I don't quite understand duty cycle and cycle time or actually any of the rest.

This is the web view of my espresso PID controller:
1

Thanks a lot for your help. Once again, I'm not really looking to fix the broken issue with the Java code, just want some sort of translation so I can manually tune this PID.

Best Answer

The duty cycle is based on a period and how long the heater is on. So if lets say your coffee heater is on for 1 second and off for 1 second. Your period is 2 seconds and your duty cycle is 50% since it's on for 1 out of the 2 seconds. If your heater is on for 1.5 seconds and off for .5 seconds, your duty cycle would be 1.5/2 (75% Duty cycle).

The Kp is your proportional. The error (setpoint - actual reading) will get multiplied by your proportional value. The Ki is your integral, this accumulates the error over time and then will essentially increase/ decrease your output more and more over time until the error gets closer to 0. The Kd is your derivative and this basically "predicts" where your going. This counter acts the integral to prevent too large of over shoots.

So when you're tuning, this is a good way to look at things.

If your proportional (kp) is too low, it will take too long to get to the set point since your duty cycle will be low, but the temperature will have little or no overshoot past your setpoint. If the Kp is higher, it will heat up faster but you're likely to have a decent overshoot.

If your integral (ki) is too low, then your temp will rise slower but tend to have less overshoots. If your integral is too high, you will heat up faster and faster until you reach your set point. This will cause you to have some positive and then negative overshoots (oscillations).

I typically set Kd to 0 until the Kp and Ki are working fairly well. This is called a PI controller. Then I use the Kd to reduce the overshoots. If you set this too high, you will get oscillations.

It's a trade off game between how fast you want to reach your setpoint and how much you're willing to overshoot.