Научная статья на тему 'PID CONTROLLER. ITS TYPES, WORKING AND APPLICATIONS'

PID CONTROLLER. ITS TYPES, WORKING AND APPLICATIONS Текст научной статьи по специальности «Электротехника, электронная техника, информационные технологии»

CC BY
42
8
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
PID CONTROLLER / RELAY CONTROL ALGORITHM / HYSTERESIS / PREDICTING THE FUTURE ALGORITHM

Аннотация научной статьи по электротехнике, электронной технике, информационным технологиям, автор научной работы — Safir P.

In this article, we will define what a PID controller (A proportional-integral-derivative controller) is. We will also discuss what are the different types of PID controller and how they can be better applied in embedded system and FPGA. We will also consider all the components of a PID controller and their uses. Also, we will describe some simple PID controller algorithms and their applications.

i Надоели баннеры? Вы всегда можете отключить рекламу.
iНе можете найти то, что вам нужно? Попробуйте сервис подбора литературы.
i Надоели баннеры? Вы всегда можете отключить рекламу.

Текст научной работы на тему «PID CONTROLLER. ITS TYPES, WORKING AND APPLICATIONS»

Литература

1. Исаков, С. Как работает сверточная нейронная сеть: архитектура, примеры, особенности / С. Исаков. — Текст: электронный // neurohive: [сайт]. URL: https://neurohive.io/ru/osnovy-data-sci-ence/glubokaya-\svertochnaja-ejronnaja-set/ (дата обращения: 08.06.2022).

2. Друки Алексей Алексеевич Применение сверточных нейронных сетей для выделения и распознавания автомобильных номерных знаков на изображениях со сложным фоном // Известия ТПУ.

2014. №5. URL: https://cyberleninka.ru/arti-cle/n/primenenie-svertochnyh-neyronnyh-setey-dlya-vydeleniya-i-raspoznavaniya-avtomobilnyh-nomernyh-znakov-na-izobrazheniyah-so-slozh nym (дата обращения: 08.06.2022).

3. Солдатова Ольга Петровна, Гаршин Александр Александрович Применение сверточной нейронной сети для распознавания рукописных цифр // КО. 2010. №2. URL: https://cyber-leninka.ru/artide/n/primeneme-svertochnoy-neyron-noy-seti-dlya-raspoznavaniya-rukopisnyh-tsifr (дата обращения: 08.06.2022).

PID CONTROLLER. ITS TYPES, WORKING AND APPLICATIONS

Safir P.

Bachelor of Science, The Azrieli College of Engineering in Jerusalem (JCE)

Israel, Jerusalem ORCID: https://orcid.org/0000-0001-9478-9839 DOI: 10.5281/zenodo.7409178

Abstract

In this article, we will define what a PID controller (A proportional-integral-derivative controller) is. We will also discuss what are the different types of PID controller and how they can be better applied in embedded system and FPGA. We will also consider all the components of a PID controller and their uses. Also, we will describe some simple PID controller algorithms and their applications.

Keywords: PID controller, relay control algorithm, hysteresis, predicting the future algorithm.

Introduction

The PID controller is a universal automatic solution for controlling processes within certain limits as agreed and selected by the engineer. PID controller systems are used in most automatic control systems. For example, a PID controller is used in your printer and controls the motor, in refrigerators and solar boilers there are PID controllers as well as in your drone whereby a PID controller is used in every stage of flight PID to control the exact altitude and location. Almost all autopilots have a PID controller in one form or another. In fact, the PID controller is quite easy to set up and works on any target based on (and not only) embedded system[1] and FPGA[2]. In embedded systems and FPGA based projects we use PID controllers to keep the system in a desired state, for example when we need the drone to achieve a required height and position, and it has to stay there in flight no matter how strong the wind is blowing. Also, we use a PID controller to define clearly designated parameters and to track the position of the system within those parameters.

PID controller theory

Let us introduce some concepts to describe PID controller. And we begin by describing our system which consists of a LASER. This LASER is our control object and our goal is to always keep a constant temperature on the controlled object. When we need to cool this object, we use a Peltier element[3]. This was our first control device. The Peltier element is a thermoelectric transducer made of two plates with a semiconductor between them. It has two pins for power. If you supply power to the element, one of the sides will start to cool but the temperature of the other side will rise

rapidly. From the hot side we can force heat away using a controlled fan. This is our second controlled device. And the control device is the fan motor driver. In the case of our fan driver, depending on the parameters you have set in the PID controller, it will change the PWM[4] duty cycle and this in turn will change the rotation speed of the fan. The PID controller itself is a part of the program which runs inside the processor of our embedded system. Next to the LASER there is a temperature sensor. The PID controller gets the current value from it. The value of this sensor provides the feedback which allows the PID controller to maintain the desired temperature in our system. The motor speed calculation feedback is shown is by the RPM[5]. It is important parameter in the PID controller is - the set point. The set point - is the parameter that the PID controller strives to obtain. It can be written into the program itself or set up from the keyboard during the operation stages of implementing the system. The PID controller will compare the current set value with the value received from the sensors and send a correction signal to the control units. The entire system works like this. In the PID controller program you set the desired value of temperature, then it receives data from the temperature sensor, performs certain calculations and sends the control signal to the fan motor driver to generate PWM frequency and a second signal to increase or decrease the current in the Peltier element. It is important that the PID controller sends the correction signal with the same frequency. The sending frequency of the correction signal is called the sampling frequency of the system and is designated as dt.

The PID controller

Fig. 1.1. The PID controller

The PID controller has three basic components, namely P - proportional, I - integral, D - derivative. The output of the PID controller is calculated by the formula:

f de

u(t) = Kpe(t) + Ki J e(t)dt + Kd— (1.1)

U(t) is the sum of all signal values that are fed to our controller.

Kp - coefficient of Proportional term. Ki - coefficient of Integral term. Kd - coefficient of Derivate term. Kp, Ki, Kd are adjustable coefficients, and their values can vary in any range. But if any coefficient is zero, then all component of this coefficient is zeroed, and the PID controller takes another form, for example PI or PD. P is the part of PID controller that does the main work, and other parts are merely for improving and adjusting the accuracy of the PID controller, so in practice we will often see P, PI or PD in our controllers. The PID controller is very flexible and can be used to control almost any system. Let us discuss and introduce some additional concepts:

Set point - this parameter is usually set by an engineer. Set point is the state the whole system should be in. The main goal of the PID controller maintaining of the system at this set point. Error is the difference between set point and feedback from control sensor. This is not a program error but a control error of Inertia and instability of the controlled program. Error = set point - feedback Out - control signal. Output from PID controller. This signal should keep the whole controlled system in the set point.

P - proportional component P - proportional represents the difference between set point and data from the control sensor. Using this parameter, we can see how far or not our system is from the set point. The parameter Kp is set manually and can affect the error amplification. A high value of Kp increases the speed of the PID controller to reach the set point. If the error comes to zero, then the control signal will also be zeroed. But there is always a difference between set point and feedback, so this parameter is not

zeroed. The P - proportional component is the main component in the PID controller and the whole controller can only work on the basis of this parameter. I - integral component

This component accumulates error. The effect will not be immediate as it takes a certain amount of time to accumulate the effect. Multiplying by Ki will smooth out the sharpness of the component. If there is a larger Ki value, it will increase the rate of error compensation. I - integral will correct accumulated errors. D - derivative component The D - derivative component is the difference between the current error and the past error. We divide this difference by the measurement frequency. It compensates for the delay between the output of the reference signal and the system's response to that signal. This allows us to smooth out any spikes in changes observed in the system. With larger values of Kd, the system will be more stable and will not allow the system to react sharply, without any discernible spikes.

To configure a PID, you need to find the optimum coefficients for the proportional integral derivative components. There are two common methods of tuning the PID controller. The first method calculates parameters on the basis of the model. This method is very precise but requires deep theoretical knowledge of PID controller. The manual method is based on samples -here the values of the ready system are the basis, and they are corrected by the regulator's coefficient. After observing the system in the active phase, the final values are taken and corrected in the required position. And until the system reaches the desired level, we continue to adjust the coefficient. PID controller algorithms Relay control algorithm The simplest and most basic of the algorithm. This algorithm is best seen by using a concrete example to explain its usage. Suppose we have a temperature sensor which is directly connected to the pins of the embedded system. We also have two relays, one of which has a fan and the other a heater. We have a defined temperature which we have to keep exactly.

Fig. 1.2. Example of control system

This algorithm has only two states, 'relay on' and 'relay off'. When the temperature rises above the set temperature, the cooling fan turns itself on, and if the temperature drops below the set temperature required, then we turn on the heater. However, we never get the set point, since the relay will be switching all time.

Hysteresis[6]

This algorithm is much better. It will permit us to approach the set point much more accurately. The logic of the algorithm is as follows. We define three set points. We create a window where in the middle of the window is our main set point, and on the edges, we set the borders where our heater and cooling fan will switch on and off as programmed. This reduces the inertia effect of our system and allows us to limit the system from triggering false of relay switching.

Predicting the future algorithm

By analyzing the speed of temperature change the PID controller can preliminarily enable or disable one or the other relay. The PID controller reacts to temperature rises above the set point by switching one or another relay on or off as necessary. This algorithm is known as the speed-dependent feedback control. The rate of the change parameter is the derivative of the value change, divided by the period of time when the change occurred. Then this parameter is multiplied by the coefficient that is chosen depending on the controlled system.

Setting up a PID controller

There are two types of the PID controller configuration.

The first way is to configure the PID controller based on the calculation of model parameters. This parameter calculation is accurate but requires a thorough understanding of automatic control theory. Calculating this parameter requires experience with PID controllers. Because it is necessary to track feedback and make error correction.

The second way is one may try to guess the correct parameters by trial and error. To do this, the parameters of an already set up the PID controller are taken as the basis and one or several coefficients of the PID controller are changed. After starting the PID controller and observing the final result, you can change the parameters according to the accuracy of the PID controller.

This will continue until the desired level of accuracy of the PID controller error correction is reached.

Conclusion

As we see the PID controller is quite simple in settings and application. In this article we have discussed three different algorithms and we have seen they can be easily implemented on any embedded system. We can even implement several PID controller algorithms in one project. A PID controller is universal and can be used to control almost any project. The first way to configure the PID controller based on the calculation of model parameters is very rarely used in practice, which is due to unknown characteristics of the control object. The second methods based by trial and error are more common.

References

1. Peter Marwedel, Embedded System Design: Embedded Systems Foundations of Cyber-Physical Systems 2nd ed. 2011 Edition, Springer Verlag, pp 7890.

2. Hideharu Amano, Principles and Structures of FPGAs,1st ed. 2018 Edition, Springer Verlag, pp 3045.

3. Sonal Renge, Yashika Barhaiya, Shikhar Pant, Shubham Sharma, A Review on Generation of Electricity using Peltier Module, January 2017 International Journal of Engineering and Technical Research V6(01), DOI:10.17577/IJERTV6IS010308

4. Dogan Ibrahim, Designing Embedded Systems with 32-Bit PIC Microcontrollers and MikroC 1st Edition - August 22, 2013, Newnes, DOI https://doi.org/10.1016/C2011-0-06919-3, pp 105-120.

5. Brian Nesbitt, Handbook of Valves and Actuators, 2007, ISBN 978-1-85617-494-7, DOI https://doi.org/10.1016/B978-1-85617-494-7.X5027-5

6. K. A. Morris, Department of Applied Mathematics, University of Waterloo, What is Hysteresis? Appl. Mech. Rev. Sep 2011, 64(5): 050801 (14 pages) https://doi.org/10.1115/1.4007112

7. Kiam Heong Ang, Gregory Chong, Student Member, IEEE, Yun Li, PID Control System Analysis, Design, and Technology, IEEE Transactions on Control Systems Technology, Vol. 13, No. 4, July 2005, DOI: 10.1109/TCST.2005.847331. Pp 102-115.

i Надоели баннеры? Вы всегда можете отключить рекламу.