tuning pid in systems with delay

13,841

Solution 1

Try P-only. How fast are the proportional-only oscillations? If you can't tune Kp small enough to get no oscillations, then your heater is overpowered for your system.

If the dead time of the of the system is on the order of 10s, the time constant (T_i) for the Integral term should be 3.3 times the dead time, using a Ziegler Nichols open-loop PI rule ( https://controls.engin.umich.edu/wiki/index.php/PIDTuningClassical#Ziegler-Nichols_Open-Loop_Tuning_Method_or_Process_Reaction_Method: ) , and then Integral term should be Ki = Kp/T_i. So with deadtime = 10s, then Ki should be Kp/33 or slower.

If you are getting integral-only oscillations, then the integral is winding up and down quicker than the process responds, and it should be even smaller.

Also -- think of the units of the different terms. It might not be the delay causing your problems so much as the resolution of the measurement and control systems. If you're driving a (for example) 100W heater with a 1/1024 resolution PWM, you've got 0.1W resolution per PWM count that you are trying to adjust based on 0.01C temperature differences. At less than Kp = 100 PWMcount/degree (or 10W/degree) you don't have enough resolution in the PWM to make changes in response to a 0.01C error. At a Kp=10PWM/C you might need a 0.10C change to result in an actual change in the PWM power. Can you use a higher resolution PWM?

Thinking of it the other way, if you want to operate a system over a range of 30C at 0.01C, I'd think you would want at least a 15bit PWM to have 10 times the resolution in the controlled system. With only 10 bits of PWM you only get about 1C of total range with control at 10x the resolution of the measurements.

Solution 2

Normally for large delays you have two options: Lower the gains of the system or, if you have a model of the plant you are controlling, use a Smith Predictior.

I would start by modelling your system (using open-loop steps in the input) to quantify the delay and the time constant of your plant, then check if the sampling of the temperature and the PWM rate are OK.

Notice that if your PWM frequency is too small in comparison to the plant dynamics, you will have sustained oscillations because of the slow PWM. You can check it using just an constant input to your PWM (with no controllers, open loop).

EDIT: Didn't see that the problem was already solved, but I'll leave this here for reference.

Share:
13,841
Mark
Author by

Mark

Interests: C++, Qt5, Raspberry Pi, Linux and Android s.o.

Updated on July 25, 2022

Comments

  • Mark
    Mark almost 2 years

    I need to tune PI(D) gains in a system which has a quite large delay. It's a common temperature controller, but the temperature probe is far away from the heater. Some further info:

    • the response of the probe is delayed about 10 seconds from any change on the heater

    • the temperature is sampled @ 1 Hz, with a resolution of 0.01 °C

    • the heater is controller in PWM with a period of 1 Hz, with a 10-bit PWM

    • the goal is to maintain the oscillation below ±0.05 °C

    Currently I'm using the controller as PI. I can't avoid oscillations. The higher the gain, the smaller and faster the oscillations. Still too high (about ±0.15 °C). Reducing the P and I gains leads to very long and deep oscillations.

    I think this is due to the delay. The settling time is not a problem, it may take all the time it needs.

    I'm puzzling over how get the system to work. Let's think to use only I. When the probe reaches the target value and the I output starts to decrease, the temperature will rise for some other time. I cannot use the derivative term because the variations are too slow and the dError is very close to zero (if I set the dGain to a huge value there is too much noise).

    Any idea?

  • Mark
    Mark almost 9 years
    Thanks for the answer. Anyway I achieved my goal with two changes: I was able to put the probe closer to the heater and I reduced its power (it was overpowered, indeed).
  • Dave X
    Dave X almost 9 years
    Cool. A lower-power heater helps increase the resolution of the PWM in terms of watts/count, and might have made it more controllable in that the incremental changes the heater makes in response to a 1/Kp degC worth of error is smaller. Thanks for your question. Before reading it, I hadn't considered the effect of the discretization of the PWM or the sensor on a PID process.
  • Mark
    Mark almost 9 years
    Thank you for the answer. About modelling the system: the problem rises because each plant might have differences in shape, distances, powers, etc... so it would be hard to make a complete model useful in all situations. Anyway, the hint about the low PWM frequency is another mistake I did...