## Abstract

Fuzzy control of the speed of electric drives is an alternative in the field of the control system. Modeling and simulation of electric drive control systems based on fuzzy logic is an important step in design and development. This chapter provides a complete means of modeling and simulation of fuzzy control systems for DC motors, induction motors, and permanent magnet synchronous motors, made in the Matlab/Simulink program environment, useful for performing complex analyzes. The functioning of the programs is demonstrated by an example of characteristics obtained practically, with a functioning regime often encountered in practice.

### Keywords

- simulation
- modeling
- control of electric drives
- DC motors
- induction motors
- permanent magnet synchronous motors
- fuzzy PI controllers

## 1. Introduction

Electric drives play an important role in the development of machine tools, production systems, means of transport, and many other practical applications. The purpose of using electric drive control systems is to ensure good performance indicators. The use of fuzzy logic in the control of electric drives ensures the realization of high-performance systems. Modeling and simulation of electric drive control systems based on fuzzy logic are an important means in their design. This chapter presents a library of Matlab/Simulink programs designed to model and simulate electrical drive control systems based on fuzzy speed PI controllers.

In the literature, the control of electric drives based on fuzzy logic is studied in many works. Several Matlab programs for modeling and simulating electric drive systems based on fuzzy logic are presented on the Matlab website as well. Programs for modeling and simulating fuzzy DC drive systems are presented in [1, 2, 3]. Programs for modeling and simulating fuzzy driving systems of induction motors are presented in [4, 5]. The Matlab software has the facilities for modeling and simulating fuzzy systems [6] and electric drive systems [7, 8]. The problem of intelligent control of electric drives has been addressed in numerous papers over the years, including application of expert systems, fuzzy logic and neural networks in electric drives [9], fuzzy control of switched reluctance motor drives [10], or fuzzy adaptive vector control of induction motor drives [11]. The basic management systems of electric actuators have been treated in numerous works in the literature as well. The problem of using electric machines in variable speed control systems is treated in [12], principles of motion control with induction motors are presented in [13] and with permanent magnet, AC machines in [14], the issues of pulse-width modulation for electronic power conversion are presented in [15], principles of modeling and simulation of electric drive control systems are presented in [16]. The basic design of fuzzy PID controllers is shown in [17].

The author of this chapter published the results of his research in the field of fuzzy control of electric drives in specialized literature, addressing the following issues: speed control based on fuzzy PI controllers of DC machines [18], of synchronous machines with permanent magnets [19], of AC machines in general [20], demonstration of the robustness of fuzzy control systems of electric machines [21], analysis of the basic properties of fuzzy control systems [22, 23], tuning of fuzzy PID regulators [24, 25] and analysis of the stability of fuzzy control systems [26].

The chapter presents program libraries dedicated to fuzzy speed regulation of the main electric motors used in practice: direct current motors, induction motors, and permanent magnet synchronous motors, respectively in subsections 2, 3, and 4. For each element of the control systems are presented the equations used in modeling and the related subprograms. For each control system, the transient regime characteristics obtained by simulation are presented. Based on the transient regime characteristics, the values obtained for the performance indicators of the control systems are highlighted, such as overshoot, rise time, error, and others.

## 2. Library programs

### 2.1 DC motor

The developed programs solve the problem of speed control of the DC machine with the control system from Figure 1.

The speed control structure from Figure 1 has the following components: MCC - DC motor, ML - load machine, CONV - power converter, RG-i - current controller, RF-Ω - fuzzy speed controller, Ti - current sensor, TΩ - speed sensor, CAN, CNA - analog to digital and digital to analog converters, MM-ISI - DC motor with state-space equations, Lim - anti-wind-up circuit. The control system variables are: Ω* - speed reference, Ω - motor speed, Ω_{m} - measured speed, M - motor torque, M_{s} - load torque, e_{Ω} - speed error, i* - current reference, i_{am} - measured current, e_{i} - current error, u_{i} - command voltage, u_{a} - motor armature voltage, i_{a} - current motor, u_{e} - excitation voltage.

The Simulink block diagram of the speed control system of DC drives based on the fuzzy PI controller is presented in Figure 2.

The block * RF-w*in Figure 1 represents the Simulink model of the fuzzy speed controller. The other part of the Simulink diagram is a conventional control part of a linear control system.

The block * srcmcc*is the internal current control loop and it has the Simulink block diagram from Figure 3.

The block * Mcc*represents the DC motor and it has the equations:

The power converter has the block * CONV*and the current sensor has the block

*. Their transfer functions are presented in their blocks. The current controller has a PI linear transfer function. The armature voltage*Ti

u

_{a}is limited. The speed sensor has the block

*. The current controller has anti-windup protection. The current reference is limited. The simulation diagram allows simulations in four quadrants for speed and torque. The diagram calculates a quadratic performance criterion of speed error with the formula:*Tw

A theoretic design for fuzzy speed control systems for DC drives is presented in [27].

### 2.2 Induction motor

The structure of the fuzzy control system of the induction machine is presented in Figure 4.

The meanings of the notations in the Figure 4 are as follows: MAS - induction machine; ML- working machine; CONV- power electronic convertor; RG-i - stator phase current controllers; Ti—current sensor; Tθ—position sensor; TΩ—speed sensor; TCI—inverse Park coordinate transformation; BCC—block for calculating the reference currents in the vector control structure of the asynchronous machine with rotor flux orientation; RF-Ω—speed fuzzy PI controller; Ω—rotor speed; Ω*—speed reference; * M**—torque reference; ф

_{r}*—rotor flux reference; θ

_{s}*—stator phasor position reference;

i

_{d}*,

i

_{q}*—d, q stator current references;

i

_{s}*—stator current reference; Ω

_{m}—measured speed; θ

_{m}—measured rotor position;

i

_{sm}—measured stator currents;

e

_{Ω}—speed error;

e

_{i}—current error;

S

_{i}—control signals for power converter switches with pulse width modulation;

V

_{cc}—DC converter supply voltage;

u

_{s}—stator voltages;

M

_{s}—load torque. The induction motor is vector controlled with rotor flux orientation, with rotor flux reference ϕ

^{*}

_{r}and torque reference

M

^{*}and the measured rotor position θ

_{m}. The reference stator currents are calculated with the block TCI. The current regulators RG-i give the pulse width modulation signals

S

_{i}for the electronic power converter CONV, fed from a DC voltage source

V

_{CC}. The power converter CONV gives the stator voltages

u

_{s}.

The speed control system of induction motors based on the fuzzy PI controller is presented in Figure 5.

The model from Figure 5 implements an induction motor control structure with indirect field orientation in rotor coordinates [13, 28]. The block * mas*represents the induction motor and it has the Equations [13, 29, 30]:

The Eqs. (3) are written for the general flux, and in the case of vector control with rotor flux orientation, the flux is the rotor flux: θ_{f} = θ_{r}. CONV is a power inverter functioning in comutation, TCI is the inverse Park coordinate transformation [30], BCC is for calculating the reference currents in the vector control structure of the asynchronous machine with rotor flux orientation. BCC has the block diagram from Figure 6 [13, 30].

Where _{p} - the pole pair number, _{m,r} - magnetic and rotor inductances, * s*- slip frequency,

R

_{r}- rotor resistance, ω

_{s}

^{*}- stator frequency reference. Two-position current controllers RG-i with hysteresis are used.

### 2.3 Permanent magnet synchronous motor

The structure of the fuzzy control system of the permanent magnet synchronous motor is presented in Figure 7.

The meanings of the notations in Figure 7 are the same as in Figure 4, and MSMP is the permanent magnet synchronous machine. The permanent magnet synchronous motor is vector controlled with rotor flux orientation with rotor q current ^{*}_{q} as a torque reference, the rotor d current ^{*}_{d} at zero as a flux reference ϕ^{*}_{r}, and the measured rotor position θ_{m}.

The speed control system of induction motors based on the fuzzy PI controller is presented in Figure 8.

This diagram implements the rotor flux oriented control structure [14]. The block * msmp + csc*includes the permanent magnet synchronous motor, with Equations [14, 30]:

The current controllers and the Park inverse coordinator transformation, like in the case of the induction motor.

### 2.4 Fuzzy speed controller

The Simulink diagram of fuzzy speed controller RF-w is presented in Figure 9.

It is developed based on the block diagram of the fuzzy controller RG-F from Figure 10.

The fuzzy controller has Mamdani’s structure with the fuzzification of the input variables _{i}, inference of the fuzzy values _{f}, with a rule base, and defuzzification of the fuzzy command _{f}. The fuzzy block gives the command _{d}. Different membership functions for the input and output variables, different inference methods, and different rule bases may be chosen [17, 19, 21, 22]. Here are some Matlab programs for fuzzy computing, as follows.

A program for defining the function of triangle membership:

A program for defining the function of decreasing trapezoidal membership:

A program for defining the function of increasing trapezoidal membership:

A program for calculating the rule base 3–3 for DC motors:

A program for fuzzy block implementation in Simulink scheme:

The fuzzy block RG-F has algebraic properties and the sector property presented in [22, 23, 24]. The fuzzy controller RF-w may be designed using a pseudo-equivalence with a linear PI controller with a grapho-analytical method [25, 26, 27], based on its input–output transfer characteristics [22, 23, 24].

## 3. Speed characteristics

With the help of the programs presented above, transient characteristics can be obtained for various operating regimes, which can be chosen by the signals applied to the speed prescription inputs and to the disturbing inputs of the load torques. Thus, transient regime characteristics can be obtained for speeds, currents, voltages, fluxes, mechanical torques, regulation errors, and others. These programs allow complex analyzes of the behavior of speed control systems based on fuzzy PI controllers. The fuzzy PI controller can be replaced with a conventional, linear PI controller. In order to demonstrate the good functioning of the programs, the following is an example of an operating regime often encountered in practice for the three-speed regulation structures. The simulated operating regime consists of: starting the machine idle up to the nominal speed, loading it with a nominal mechanical torque, and reversing the load. It was also chosen to exemplify the case when a conventional linear PI speed regulator is used. The characteristics in the two cases - fuzzy and linear - are presented in the same graph, and the same coordinate axes, for example. Figure 11a–c show the speed characteristics for the DC machine, induction machines, and the permanent magnet synchronous machine, respectively.

It is observed that in the case of fuzzy control better quality control indicators are obtained: zero overshoot, shorter rise time, shorter time for elimination of load torque effect, etc. [18, 19, 20]. The fuzzy control structures are global absolute internal stable and external BIBO stable [28]. The fuzzy control structures are robust at parameter identification errors and at the perturbation from the load torque [21].

## 4. Conclusion

The chapter presents a library of Matlab/Simulink programs for the control of electric drives. Thus, Simulink schemes are presented for modeling and simulating the fuzzy speed control systems of direct current machines, induction machines with vector control with rotor flux orientation, and synchronous machines with permanent magnets. Matlab/Simulink programs are presented for modeling and simulating fuzzy PI controllers based on the Mamdani structure. To demonstrate the operation of the programs, the characteristics of the speed obtained in the case of the three adjustment structures are presented. Fuzzy system modeling programs can be developed for various types of membership functions, inference methods, and rule bases.

The parameters of the three motors taken as examples are presented below.

The DC motor: _{n} = 1 kW, _{n} = 220 V, _{n} = 3000 rot./min., η = 0,75, * p* = 2,

*= 0,006 kgm*J

^{2},

M

_{n}= 3,2 Nm, Ω

_{n}= 314 rad/s,

I

_{n}= 6A,

I

_{M}

*10,8 A,*=

R

_{a}= 2,01 Ω,

L

_{a}= 0,034 H,

T

_{a}= 0,017 ms,

k

_{e}= 0,664 Vs,

k

_{m}= 0,533 Nm/A,

k

_{f}= 8.10

^{−4}Nms,

K

_{CNA}=

K

_{CAN}= 1,

I

_{lim}=

I

_{M},

U

_{aM}= 240 V.

The induction motor: _{s} = 12,4 _{r} = 12,4 _{m} = 0,8 H; _{sσ} = 0,06 H; _{rσ} = 0,06 H; * p* = 4;

k

_{f}= 0,008 Nms;

*= 0,01 kgm*J

^{2};

M

_{Mc}= 7 Nm;

M

_{Mt}= 24 Nm; n

_{b}= 750 rot/min;

P

_{N(Mc)}= 550 W;

I

_{sN}= 1,77 A;

I

_{sM}= 8 A;

U

_{sN}= 220 V.

The permanent magnet synchronous motor: _{N} = 400 W; _{N} = 3 A; _{M} = 8 A; n_{m} = 4000 rot/min; n_{b} = 3000 rot/min; _{Mc} = 1,3 Nm; _{Mt} = 3,4 Nm; * J* = 0,001 kgm

^{2};

k

_{f}= 0,0001 Nms;

R

_{s}= 0,6 Ω;

L

_{d}= 4 mH;

L

_{q}= 5 mH;

*= 4; Φ*p

_{e0}= 0,072 Wb;

V

_{cc}= 200 V.