PID temperature controller simulation

I searched for articles on this resource on the topic of PID controllers. Many articles. And with an explanation of the principles of operation of such regulators. And with algorithms for selecting parameters. And with implementation on specific pieces of iron and programs. I didn’t see one thing - simulations of PID controllers on models so that the user without touch without any iron could “feel” the operation of the PID controller.

To do this, a mat model of a heating element with a temperature sensor and a PID controller was created (of course, with a bunch of simplifications, but without sacrificing realism). This is implemented on regular Excel. So that any user can "twist" the virtual parameters himself, and see what comes of it. Actually, I did this model in my time just to “touch” the PID control process with my own hands.

The model itself has the following parameters:

  • Kf inertia of the heated body (mass, beats. Specific heat, insulation)
  • Ambient temperature °
  • Initial body temperature ° C

The PID controller has the following parameters:

  • Target temperature ° C
  • Coeff. proportional impact
  • Coeff. differential exposure
  • Coeff. integral impact
  • Maximum value of control action
  • Total gain (if 0, then the regulator and heater do not work)

Further many pictures.

1. First turn off the PID control and make sure that the model is adequate.

We set the temperature of the body and the environment equal and make sure on the graph that the temperature is stable:

image

Now we set the body temperature above the ambient temperature, the graph is rearranged and we see that the body temperature exponentially approaches the ambient temperature.

image

The same thing, but now the body temperature is below ambient temperature.

image

We decrease the inertia coefficient, and we see that the body temperature tends to the environment faster.

image

We increase the inertia coefficient, and we see that the body temperature tends to the environment more slowly.

image

Now turn on the heating (but not the PID controller!). To do this, in the control column “turn on” 2 times “heating” - from 0 to 2 unit of time for “power” = 20, and from 11 to 12 unit of time for “power” = 10. On the graph, we observe an adequate reaction.

image

Now we “turn on” the constant “heating” to “power” 10. We see that the body temperature rises, but to a certain limit - “power” is not enough.

image

2. Now "turn on" the PID controller, and see how it will regulate the temperature.

Set the target temperature to 100 ° C and Kp = 1, Kd = 1, Ki = 0.1.

image

Increase Ki to 1, and see that this is not entirely useful in this case.

image

Now we remove the integral component Ki and see - now the adjustment does not reach 100 degrees - there is little “power” without the integral component.

image

Let’s increase K and / or Kp - now the “power” was enough, but without the integral component high-frequency oscillations arose.

image

Well and so on.

Link to the file. Who cares - play around.

All Articles