Научная статья на тему 'METHODS, ALGORITHMS AND ELEMENTS OF RELAY CONTROL FOR EMBEDDED SYSTEMS'

METHODS, ALGORITHMS AND ELEMENTS OF RELAY CONTROL FOR EMBEDDED SYSTEMS Текст научной статьи по специальности «Электротехника, электронная техника, информационные технологии»

CC BY
22
14
i Надоели баннеры? Вы всегда можете отключить рекламу.
Ключевые слова
RELAY SYSTEM / EMBEDDED SYSTEM / MOSFET / OPTOCOUPLER / HYSTERESIS / THE CHANGE PREDICTION METHOD

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

This paper investigates the algorithms and elements of relay control for embedded systems. The paper will consider systems based on an electromechanical relay and a transistor connected to an embedded system. MOSFET as the best solution for soft control of objects (PWM). Optocoupler as a safe solution for controlling high voltage devices. Some software algorithms for better control of the system will be discussed.

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

Текст научной работы на тему «METHODS, ALGORITHMS AND ELEMENTS OF RELAY CONTROL FOR EMBEDDED SYSTEMS»

A UNiVERSUM: Л ТЕ>

№ 7 (112)_ДХ ТЕХНИЧЕСКИЕ НАУКИ_июль. 2023 г.

ELECTRONICS

DOI - 10.32743/UniTech.2023.112.7.15784

METHODS, ALGORITHMS AND ELEMENTS OF RELAY CONTROL FOR EMBEDDED SYSTEMS

Peter Safir

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

Israel, Jerusalem E-mail: mailto:nimbul@gmail. com

МЕТОДЫ, АЛГОРИТМЫ И ЭЛЕМЕНТЫ РЕЛЕЙНОГО УПРАВЛЕНИЯ ДЛЯ ВСТРАИВАЕМЫХ СИСТЕМ

Сафир Петр Павлович

Бакалавр наук,

Академический инженерный колледж Азриэли Израиль, г. Иерусалим

ABSTRACT

This paper investigates the algorithms and elements of relay control for embedded systems. The paper will consider systems based on an electromechanical relay and a transistor connected to an embedded system. MOSFET as the best solution for soil control of objects (PWM). Optocoupler as a safe solution for controlling high voltage devices. Some software algorithms for better control of the system will be discussed.

АННОТАЦИЯ

В данной статье исследуются алгоритмы и элементы релейного управления для встраиваемых систем. Будет проанализирован оптимальный вариант для контроля различных систем. Будут рассмотрены системы на основе электромеханического реле и транзистора подключенные к встраиваемым системам. MOSFET как наилучшее решение для плавного контроля за объектами (PWM). Оптопара как безопасное решение для контроля устройств с высоким напряжением. Будут рассмотрены некоторые программные алгоритмы для наилучшего контроля за системой.

Keywords: relay system, embedded system, MOSFET, optocoupler, hysteresis, the change prediction method.

Ключевые слова: релейное управление, встраиваемые системы, MOSFET.

Introduction

Developing an efficient algorithm for relay control system based on various embedded systems is not an easy task. Relay[1] is a type of logic controller. Relay has only two states, on or off. There are many methods

and program algorithms of relay control in order to obtain optimal real-time speed control for different controlled systems. Relay control is the most economical control method in operation. But there are also other control methods, such as MOSFETs[1] or optocouplers. These allow more accurate and flexible control of the load as well as reduction of electromagnetic noise.

Figure 1. Relay control system

Библиографическое описание: Safir P. METHODS, ALGORITHMS AND ELEMENTS OF RELAY CONTROL FOR EMBEDDED SYSTEMS // Universum: технические науки : электрон. научн. журн. 2023. 7(112). URL: https://7universum. com/ni/tech/archive/item/15784

№ 7 (112)

А1

UNIVERSUM:

ТЕХНИЧЕСКИЕ НАУКИ

июль, 2023 г.

Relay control system On/Off

Figure 2. On/Off relay control system

The simplest algorithm for relay operation is to turn the relay on or off when the set reference point is crossed. For example: we measure the temperature in a liquid, and when it reaches 80 degrees, we must stop heating. 80 degrees is the set point. We can use this kind of code for Arduino:

If (temperature < set_point) digitalWrite(relay, HIGHT) else

digitalWrite(relay, LOW)

But as we know any mechanical switching, whether it is a push button or an electronic mechanical relay during switching occurs bounce contacts, which creates noise throughout the control system, and in this case, every time we switch we must add a time delay to our code to wait for the mechanical bounce to calm down[2].

Delay(500)

In any case, this is not the best algorithm for relay control, because the relay will be triggered all the time and very often when crossing the set point.

Hysteresis

Figure 3. Hysteresis ana Relay status

Hysteresis[3] is an algorithm that sets the parameters of relay triggering, more or less around the set point, by the size of the hysteresis window. This allows us to reduce relay triggering[3], increase noise tolerance of the system and in this case we will not use delay, which will free up some resources of the embedded system. But the accuracy of the system is a little bit reduced because

we turn the relay on and off above or below the set point. Implementation of the code on Arduino:

If (temperature < low_set_point) digitalWrite(relay, HIGHT) else if (temperature > hight_set_point) digitalWrite(relay, LOW)

№ 7 (112)

A UNI

/Ш. ТЕ)

UNIVERSUM:

ТЕХНИЧЕСКИЕ НАУКИ

июль, 2023 г.

The change prediction method

Possibilities of modern programmable logic controllers^] allow to realize differential equations of control method, where it is possible to include program-logic solutions. The change prediction method is built so that it can analyze[4] the rate of change of the parameter that we control and based on the obtained data can turn

on or off the relay in advance setting. This algorithm uses feedback control on the rate of change of the controlled parameter. The most important thing in this algorithm is the gain coefficient, which is calibrated for each system separately. Then this coefficient is multiplied by the rate of change is entered into the algorithm as a derivative -the change in value divided by the time for which the change occurred.

Figure 4. The change prediction method

Disadvantages of using an electromechanical relay:

• Mechanical bounce of the contacts. (It takes time for this debounce to subside and as a consequence detention during switching).

• Switching noise.

• Physical abrasion of the contacts, with frequent use and as a consequence requires more frequent monitoring and service.

• Has a very high inductance, which leads to higher noise throughout the system.

• Large size.

• High current consumption

• If more than one relay is connected to the embedded system, an external power supply is required.

MOSFET

Figure 5. MOSFET control system

The use of MOSFET[5] transistor is possible only for sensors that consume only DC current and it is an optimal solution in contrast to relays. The MOSFE does not have any of the disadvantages that relays have. In particular, the transistor has no mechanical switches and works silently, does not have a large inductance and when switching does not create electromagnetic noise in the system. The switching speed of the transistor is many

times faster than that of a mechanical relay. With the help of transistor it is easy to realize Pulse Width Modulation (PWM), which allows smooth load control and more accurate control. And also in Pulse Width modulation mode, we can keep the load control within a well-defined range. To handle AC current, we can use a semistor. This is an element that is similar to a transistor but can handle AC current.

№ 7 (112)

А1

UNIVERSUM:

ТЕХНИЧЕСКИЕ НАУКИ

Optocoupler

An optocoupler[6] is a remarkable electronic element that allows the embedded system to be physically separated from the load. An optocoupler can replace a MOSFET, but an optocoupler is much safer because it consists of two physically independent parts. The first part is the LED, which we control through the embedded system and the second part, which can consist of a transistor or

июль, 2023 г.

other semiconductor element. The main thing is that the control of the second part is not mechanical, but through a pulse of light, which is created by the light diode and thus there is no direct mechanical connection between these two parts of the optocoupler. This property is important when we control sensitive devices and sensors. The optocoupler is mainly used for small loads, mainly logic elements or low-power sensors.

Figure 6. Optocoupler and embedded system

TRIAC.( TRIode for Alternating Current) TRIA[7] is an electronic element, its main feature is that it can operate with AC current.

Figure 7. TRIAC and embedded system

To control the load only in the mode on or off, it is recommended to install Optocoupler with zero detector[8], it will turn off and turn on the load only in moments of AC voltage transition in the network through 0, which greatly reduces noise in the control system.

CONCLUSION

As we can see the use of mechanical relay is the simplest way of control. Mechanical relay can be used with DC and AC current. But mechanical relay has some disadvantages, such as electromagnetic switching noise

and limited lifetime. But it is the most common way to control the load. But if you need to change the voltage smoothly and control the load accurately, then a MOSFET is the way to use. Using optocoupler will allow to physically separate the project into two parts, which will protect the embedded system from overloads. Of the three algorithms considered, the change prediction method is the best and most accurate. It allows you to very accurately control the load without overstepping the border of the hysteresis.

References:

1. Richard C. Dorf. Systems, Controls, Embedded Systems, Energy, and Machines, CRC Press 2017, P. 23 - 56.

2. Richard C. Dorf, Robert H. Bishop, Modern Control Systems, Pearson 2017, P. 56 - 58.

3. Alexandra Forrai, Embedded Control System Design A Model Based Approach, Springer Berlin Heidelberg 2013, P. 65 - 69.

4. Tim Wescott, Applied Control Theory for Embedded Systems, Elsevier Science 2011, P. 123 - 140.

5. Mohamed Khalgui, Hans-Michael Hanisch, Reconfigurable Embedded Control Systems Applications for Flexibility and Agility, Information Science Reference 2011, P. 102 -105.

6. Arben Qela, Mongi Ben Gaid, Xu-Guang Li, Silviu-Iulian Niculescu, Optimal Design of Distributed Control and Embedded Systems, Springer International Publishing 2013, P.140 - 156.

7. Arnold S. Berger, Arnold H. Berger, Embedded Systems Design An Introduction to Processes, Tools, and Techniques, Taylor & Francis 2002, P. 106 - 123.

8. Arnold S. Berger, Debugging Embedded and Real-Time Systems The Art, Science, Technology, and Tools of Real-Time System Debugging, Elsevier Science 2020, P. 202 -207.

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