Teach you to read and understand the Arduino PID control library hand by hand - sudden change of setpoint

Introduction

This article will analyze how to avoid sudden changes in the output from the sudden change of the set value in " Teach you to understand and understand the Arduino PID control library ".

problem definition

First, let's take a look at the illustration of the above problem:

Assuming that the output limit of PID control is 255, if it is calculated according to the classical formula of PID, the PID controller does not know that the limit value of its output is 255. Due to the large set value, the output will keep increasing, exceeding 255 and reaching 300/400 or higher. At this time, suddenly reduce the set value to a lower position (smaller than the controlled value), then, due to the action of the integral term, the output will take a certain time to gradually exceed the limit value, and then slowly down to the desired setpoint. From the picture, it is the Lag of the green line, which we do not want to see.

solution

There are various means to reduce the impact of the above problems.

The easiest way: tell the PID software what the output limit is. Once the limit is reached, the PID parameters will no longer be accumulated (integrated). Note that this is not a "blunt" limit to the output, but after the limit is reached, the Turn off the continuous accumulation of the integral term, otherwise once the PID recovers, the overrun part of the integral term will still enter the control process and affect the output. As for the derivative term, it is only related to the last controlled value in time, so the impact is minimal.

From the figure it can be seen that:

Once the integral term is under control, the output value will be limited to a reasonable range, even if it exceeds the limit, it will not be too large. And the controlled quantity will not have a large time lag after the set value is reduced to a reasonable range.

NOTE: If there is any inadequacy, please inform'

The next chapter will analyze the effect of PID on and off on the system ^.^

NEXT

PS: Please indicate the source for reprinting: Ouyang Tianhua

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325549439&siteId=291194637