Fuzzy controllers in the control system of a brushless electric motor using HIL technology

This article proposes a method for creation of a control system for a brushless electric motor based on a fuzzy logic apparatus. The use of a fuzzy controller in this case can increase stability and improve the quality of the system under consideration, which was implemented in the Simulink environment using HIL technology. This technology increases the chances of successfully passing the test phase, considering the control system in prototype.


Introduction
Traditional automated control systems are built on the basis of linear object models according to a group of optimality criteria, for example, integral evaluations of transition process quality.Controllers built in this way are stable and optimal with regard to the models of real processors which serve as their foundations -control and regulation objects.However, methods of simplification and linearization which are often implemented in nonlinear, dynamic, unclearly defined, objects do not deliver the expected results with regard to stable control and the quality of control over the real processor.Where objects' structures and functions are more complicated, it is even more difficult to use classic control methods [1-4, 8, 9].
In recent years, with increasing requirements for control systems, it becomes difficult to ensure high quality indicators (speed, overshoot) with reliable maintaining of stability conditions.In many cases, the "proven" over the years types of the control systems like PID-controllers are no longer cope with the task, and the next generation of controllers comes on the agendaintellectual controllers [1].
Fuzzy controllers are used in many industry sectors [7].By virtue of its fuzzy inference provides a parallel interpretation of knowledge through special highperformance hardware.In conjunction with the implementation of complex nonlinear transformations based on fuzzy logic, it can be concluded about the prospects of the creation of technology-based intellectual fuzzy logic of a new type of high-speed nonlinear controllers -fuzzy controllers for objects with a high degree of controllability, such as [10][11][12].
For the executive control subsystem in this work, a controller based on fuzzy logic was used instead of a traditional PID controller [5,13,14].
One of the more important stages of the development of embedded systems is the testing stage, which allows the developer to check the entire system's performance and reliability under non-laboratory conditions [6][7].
Hardware-in-the-loop (HIL) is a method which can be used to develop and test complicated real-time embedded systems.HIL provides an effective platform by adding a sophisticated control system for testing of the platform [16][17].The sophisticated control system is present at the development and testing stage, because it adds a mathematical representation of all the linked dynamic systems.This mathematical representation is termed software modelling.During testing of an embedded system, it interacts with the software model.

Modelling control systems
As an example of HIL, let us consider a model with the following structure: Discrete time algorithm on a debugging board -control object on a computer, where a fuzzy PID controller serves as the algorithm, and a model of a brushless DC electric motor is the object [18].
An STM32F4DISCOVERY debugging board based on a Cortex M4 core, connected to the computer through a USB-UART converter was used [15].
The process of modelling a control system is divided into two stages: 1) Modelling the control algorithm on the debugging board In this model, the UART Rx unit receives two signals: the setpoint and object output signal.Any received errors are fed through the controller and the UART Tx unit to the computer, upon which our object is realised.
The controller unit has the following structure (figure 2): Where the Saturation unit is needed to limit the controller's output, and the Rate Transition unit automatically harmonizes the remaining units' quantisation steps.

2)
Modelling the control object on the computer The BLDC unit has the following structure [19]: In this model, the Host Serial RX1 unit receives the control signal from the board and passes it to the control object.The Host Serial TX1 unit passes essential information to the board.

Tuning the fuzzy controller
The process of synthesizing a fuzzy PID controller has four steps [20].

1) Synthesizing the P controller
The P controller is synthesized for the object described by the following system of differential equations.
It is necessary to guarantee a transmission process with a low rise time, a steady-state error of Δ ≤ 3% and deregulation of d ≤ 10%.a) First, a controller with a single gain factor is considered.Such a regulator does not influence the control process.We select the base gain factor kp=3, which gives the condition ymax=1.b) A system with three rules is considered.The terms of the controller's output variable are arranged along the base scale according to figure 6, and the terms of the input scale according to figure 5.By method of trial and error, the value x1=0.1 is selected, which provides for a minimal rise time for the given overshoot.c) Next, the system with three rules is considered again.We set the controller's gain factor to x2=0.6, which returns a steady-state error of 3%.d) Next, the non-linear law of control must be obtained:

2) Synthesizing the PD controller
The first stage is repeated, but the LP terms "derivative control errors" are arranged evenly (fig.7).The controlling rules are formed according to Table 2. 3) Synthesizing the PI controller A fuzzy controller of the PI type can be considered to have the same inputs as a PD controller.As such, the law of control showed in Table 2 is applicable.The essence consists of the method of forming the control signal, which can be used to minimize the system's static error.

4) Synthesizing the PID controller
The PID controller's equation can be expressed as follows: It follows that a fuzzy PID controller can be represented as a PD and PI controller connected in parallel.As a result, we receive a synthesized fuzzy PID controller (fig.8).

Conclusions
As such, the demonstrated characteristics confirm the efficacy of using fuzzy PID controllers to control a brushless electric motor.The utility of HIL technology's utility lies in its ability to improve the quality of testing, decrease the influence of the human factor, and also reduce the costs of practical experiments

Fig. 1 .
Fig. 1.Model of the control algorithm of a brushless DC electric motor on the debugging board.

Fig. 3 .
Fig. 3. Model of a brushless DC electric motor on the computer.

Fig 7 .
Fig 7. Linguistic description of derivative control errors.

Fig. 8 . 1 -
Fig. 8. 1 -The transformation process using a fuzzy controller 2 -the transformation process using a classic PID controller.

Table 1 .
Linguistic law of command.

Table 2 .
Linguistic law of command.