**Hello Mechatronics! **

**Welcome to a new instalment of the Sinadrives blog with the topic: Control loops**

*June 2021*

**Control** procedures occupy a large part of the agenda within electronic engineering studies, and extensive literature has been written on the subject over the recent years. The aim of this article is not to delve into the details, but rather to introduce those with less expertise to the concept of **the control loop.**

We all use **control loops**, albeit unconsciously, in many aspects of our day-to-day lives. We are continually monitoring different magnitudes, be it room temperature, car speed, or the position of a shaft with a __linear motor.__

In all these cases, we have a series of concepts that are repeated. We have a magnitude that we want to **control** (temperature, speed, position, etc.), and a reference value, for example, 22ºC, 50 km/h or 356 mm. Furthermore, the system always includes an actuator that allows us to influence output quantity, be it a simple valve or a complex electronic board, and some form of measurement element to check that the output value is as required.

Having clarified these basic concepts of a **control system**, we can move on to the next level, where we will see what a** control loop** is and how it works.

**Open-loop control:**

**Open-loop control** is characterised by not including a measurement system to evaluate the output value, or including one that does not influence the input value. Regulation is made based on experience or the results of previous measurements.

To graphically illustrate this, let’s imagine we have a car that we know from previous experience goes from 0 to 100 km/h, in proportion to how we press the accelerator pedal.

We want to** control** the speed of the car. This will be our output magnitude. And the reference speed in this example will be 50 km/h, so we must press the accelerator pedal (actuator) halfway.

Therefore, if we press the accelerator pedal only up to a quarter of its travel, the car’s speed will be 25 km/h.

In the industrial world, we find this type of **control** where high precision in the output value is not required. For example, we can regulate an asynchronous motor of a conveyor belt with a frequency inverter. In this case, motor speed will be proportional to the frequency of the voltage applied to it, but there is no element that verifies if the rotational speed is correct.

We can extend this by introducing a measurement element, a sensor that measures our system’s output value. In the case of the car, this sensor is the speedometer that indicates its actual speed.

This sensor tells us the actual output value; however, even if this value differs from the reference, it does not automatically modify the input. In our car, for example, we could see that the actual speed is 52 km/h, instead of the desired 50 km/h, but we would not act on the accelerator pedal to correct it.

In practice, in the case of the asynchronous motor, the operator would measure the speed of the conveyor belt and modify the reference value to adjust the output to the actual value required. But from then on, the system would continue to operate in **open loop**, since the **control system** would not correct the speed if an external element modifies it.

## Closed-loop control:

**Closed loop control** appears when it is necessary to automatically correct the deviations of the output against the reference. This introduces a new element in the system, an automated device or processor that will be in charge of evaluating the sensor values and acting accordingly.

In the example of the car, this processor would be the driver. We are in the vehicle at a speed of 50 km/h, keeping the accelerator pedal pressed halfway, and we see the actual speed via the speedometer. But suddenly there is a rise and, without touching anything, we observe that the speed of the car drops to 30 km/h. We will call this difference between the reference and the actual value an error.

As we are in a **closed-loop control** model, we automatically act on the accelerator pedal until we see that the speed returns to 50 km/h.

We have already corrected the error, but how long did it take?

As we can see in the image, we can press the pedal constantly, gradually increasing the output value until we reach 50 km/h, but this is inefficient, since we want to react as quickly as possible. We will see the ways we have to improve this behaviour until we reach the famous PID, which we explain below.

**Proportional control – P:**

A logical idea to improve the response time would be that we can act with greater magnitude if the error is very high (pressing the pedal more), and act less as the error is reduced.

With proportional control, we use the information that we have in the present and apply a correction based on this. We measure the error, multiply it by a constant, P, and act. In the next instant, we measure the error again (which will be less, since we have already corrected a part), then multiply it by P and act.

As we see in the graph, correction is much faster, but we never reach zero error, since no matter how low this is, we are going to multiply it by P to apply the correction.

The higher the value of P, the shorter the correction time. However, it cannot be raised infinitely, since the correction we apply in the output will exceed the previous error as of a certain value, making the system unstable.

**Comprehensive control – I:**

In order to reduce the error to zero, an integral component is added to the **proportional control.**

This **control** uses past data to give the system a memory. In the same way as the **proportional control** acts according to the current error, the integral control acts according to the error we have accumulated.

To apply it to the example of the car, it could be explained as follows: we have managed to correct the speed quickly from 30 km/h to a value close to 48 km/h. But from here on the error is small, and over time we go up very slowly (48.3, 48.5, 48.6, …). **Integral control** intervenes at this point, applying an additional correction that will be small if we manage to react quickly, but great if the car fails to reach 50 km/h in a short time.

** **

## Derivative control – D:

This type of **control** adds another component to that seen above, and looks to provide a reaction to future data.

It simply observes how fast the error changes. If we go down from 50 km/h to 40 km/h, it will apply an additional correction, X, but if we go down from 50 km/h to 20 km/h, it will apply a higher correction.

This also applies when we are correcting the error. We see that the car has slowed down and we correct it by pressing the accelerator pedal, but we see that the error decreases very little, so we press the pedal harder. If the error decreases quickly, we stop applying this additional pressure.

Bringing together the three types of correction above, we have a PID controller, which has been in use since the beginning of the last century. Its use today with technological improvements allows greater capacity and calculation speed, applied to the vast majority of current automated devices.

** **

## Leave A Comment