**1. Introduction**

Permanent Magnet Synchronous Motors (PMSM) are widely used in industrial drives due to their high power density, high torque-to- inertia ratio, small torque ripple and precise control at low speed range, possibility to torque control at zero speed, high efficiency and small size. To exploit presented advantages, a vector control should be used. Vector control allows the drive a good dynamic, effective performance especially during transients and prevents overload of the motor by controlling the torque. However, a motor shaft position sensor is required to enable the effective vector control of a PMSM. Such sensors increase the overall cost of the drive and decrease its reliability. That sensor occupies usually the end of the shaft, so elimination of the need for its installation allows new applications of such drive. This scientific problem remains an open question for and is the subject for extensive research in many scientific centers. Several approaches to this problem are reported in the literature, which are based on state observers [1,2], various versions of the Kalman filters [3,4], sliding-mode observers [5,6] or methods of applying motor saliency [7,8,9]. State observers and Kalman filters based on a motor model require complex computational operations to obtain proper accuracy, which always causes problems in real time operation. Several approaches apply motor magnetic saliency and detect the rotor position by measuring phase inductances. These methods provide a real solution at small speeds and during standstill operation, but requirements with respect to hardware and software are high. The additional scientific problem is to obtain high dynamic sensorless drive [10,11]. Assumption of the limitation the applications up to speed control (without position control) gives possibility to achieve well performance of high dynamic sensorless drive for low speed operating range.

A simple and effective structure of an observer is proposed in this paper. The presented observer structure is based on a modified concept of back EMF detection [5] and introduces

© 2012 Urbanski, licensee InTech. This is an open access chapter distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. © 2012 Urbanski, licensee InTech. This is a paper distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

a more complex corrector function which differs from the traditional one. The structure contains a corrector with a proportional-multi integral function (PII2) instead of the proportional correction used in the Luenberger observer [12]. Prepared observer structure is applied to control structure presented at figure 1. The motor is fed by the PWM inverter, the control system includes vector control system of stator currents at *dq* independent axes (Riq and Rid), speed controller (R) and observer. The system is equipped with position and speed sensors which are used only to analysis of the estimation quality. The estimated value of the actual shaft position is used in transforming blocks of the coordinate system *dq-* and *-dq*. The estimated value of the speed is used in control loop of the speed.

Presented structure gives possibility to test system in closed (observed values are used to control drive) and open (observed values are only considered) mode using manual switches as it is shown on figure 1. To achieve smooth observed values, a reference voltage can be used instead of measured ones.

**Figure 1.** Structure of sensorless drive model

#### **2. Inverter**

For modeling the PWM converters can be used models with various complexity degrees. First approximation can be a usage of the inverter's transfer function equal to one. One can do that in the case of high carrier frequency of the inverter, since any significant delays occur in the measuring loops. At this case, the observer input signals may be smooth, and is easily obtained the proper observer performance. The other possibility to ease modeling transfer function of the inverter is zero order sample and hold block, usage the delay block or first order transfer function, which time constant or sampling interval is calculated depends on the proposed carrier frequency. These models do not require a very small simulation step size. In the case of the simulation where the effect of the inverter such as simply the impact the modulated voltage on generated state vector's waveforms and drive performance or inverter's dead time impact is taken into account, the more accurate model is inserted in place of the simplified one. Figure 3 presents used in this model simplified structure of the PWM inverter. Structure of this model is directly derived from the method of generating the states of the switches, the change of switch state is carried out at the intersection of the reference voltage and the carrier signal. This model does not take into account the dead time phenomenon.

196 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

and 

used instead of measured ones.

**Figure 1.** Structure of sensorless drive model

**2. Inverter** 

a more complex corrector function which differs from the traditional one. The structure contains a corrector with a proportional-multi integral function (PII2) instead of the proportional correction used in the Luenberger observer [12]. Prepared observer structure is applied to control structure presented at figure 1. The motor is fed by the PWM inverter, the control system includes vector control system of stator currents at *dq* independent axes (Riq and Rid), speed controller (R) and observer. The system is equipped with position and speed sensors which are used only to analysis of the estimation quality. The estimated value of the actual shaft position is used in transforming blocks of the coordinate system *dq-*

*-dq*. The estimated value of the speed is used in control loop of the speed.

Presented structure gives possibility to test system in closed (observed values are used to control drive) and open (observed values are only considered) mode using manual switches as it is shown on figure 1. To achieve smooth observed values, a reference voltage can be

For modeling the PWM converters can be used models with various complexity degrees. First approximation can be a usage of the inverter's transfer function equal to one. One can

**Figure 2.** General view of PMSM model in *dq* axis expanded on *ABC* coordinates system inputs and outputs

The cost of the exact model of inverter usage is of course much smaller calculating step, from single microseconds up to dozens of nanoseconds (for range about 10 kHz carrier frequency) in place of dozens or hundreds microseconds for simple inverter model for presented drive parameters. The calculating step value is very important due to simulation time especially during optimization procedure (thousands or hundreds of thousands of repetitions). For example, the presented drive is simulated in normal mode, at 2.10 GHz dual core Intel processor at 8.3 s, (simulation stop time 0.12 s, fixed step size – 5 s), but start simulation without opening the model (using only the command window), will reduce the simulation time to about 6.3 s.

**Figure 3.** General view of simple PWM inverter model

**Figure 4.** Testing output voltage waveforms of the inverter model

Presented at figure 3 inverter model generates the exemplary (for the ideal three-phase sinusoidal excitation) waveforms of the output voltage (the testing waveform obtained for carrier frequency fc=500 Hz) for bipolar voltage modulation – as presented on figure 4. Figure 5 presents the carrier frequency influence for waveforms for the excited phase current for the stationary circuit.

**Figure 5.** Carrier frequency influence for current Ia waveform

#### **3. Speed controller structure**

198 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

**Figure 3.** General view of simple PWM inverter model

**Figure 4.** Testing output voltage waveforms of the inverter model

current for the stationary circuit.

Presented at figure 3 inverter model generates the exemplary (for the ideal three-phase sinusoidal excitation) waveforms of the output voltage (the testing waveform obtained for carrier frequency fc=500 Hz) for bipolar voltage modulation – as presented on figure 4. Figure 5 presents the carrier frequency influence for waveforms for the excited phase All the controllers and observer are implemented as a discrete structure. The used in this study structure of speed controller is shown in figure 6 (the currents controllers used in *q* and *q* axis are typical PI structure with anti wind-up and limited output). The signals used in a controller module are "Wref" – reference speed, "Wm" – measurement (or estimated) feed back speed value and speed controller output signal, "Iref" – reference current/torque. Choice of controller structure allows determining the impact of the control algorithm for ability to sensorless performance because of the transients. The tested structure of speed controller was the typical P/PI structure. To avoid integrator saturation for a controller with limited output level, a hard limit is imposed. It is easy and effective solution. The easiest way to set the integrator limit is to use the same value as in the output. Figure 6 shows the tested structure of PI controller. The structure is parallel. Block zero-order-hold in proportional gain branch is used to "synchronize" input signals of the adder. For fast integration switch-off a manual switch "s1" is used. This structure provides a stable performance of the system, and easy selection of settings using different methods. One of the methods used for setting the controller parameters was RWC method (that method will be discussed later), the same as used for settings the observer's parameters.

**Figure 6.** The speed controller structure

### **4. PMSM model**

Assuming ordinary simplified assumptions, the general form of the PMSM model in stationary orthogonal coordinates can be expressed as follows:

$$\begin{aligned} \frac{d\mathbf{i}\_{\alpha}}{dt} &= -\frac{\mathbf{R}}{\mathbf{L}} \cdot \mathbf{i}\_{\alpha} - \frac{1}{\mathbf{L}} \cdot \mathbf{e}\_{\alpha} + \frac{1}{\mathbf{L}} \cdot \mathbf{v}\_{\alpha} \\ \frac{d\mathbf{i}\_{\beta}}{dt} &= -\frac{\mathbf{R}}{\mathbf{L}} \cdot \mathbf{i}\_{\beta} - \frac{1}{\mathbf{L}} \cdot \mathbf{e}\_{\beta} + \frac{1}{\mathbf{L}} \cdot \mathbf{v}\_{\beta} \end{aligned} \tag{1}$$

and the mechanical part:

$$\begin{aligned} \frac{d\boldsymbol{\omega}}{dt} &= \frac{1}{\mathbf{J}} \cdot \left( \boldsymbol{\Psi}\_{\beta} \cdot \mathbf{i}\_{\alpha} - \boldsymbol{\Psi}\_{\alpha} \cdot \mathbf{i}\_{\beta} - \mathbf{T}\_{\mathcal{L}} \right) \\ \frac{d\boldsymbol{\Omega}}{dt} &= \boldsymbol{\omega} \end{aligned} \tag{2}$$

The motor model with state variables i, i and is non-linear. All state variables are measurable but in a concept without mechanical sensor and should be estimated. The symbols i , i , , , e , e are stator current, stator flux linkage and induced back EMF in coordinates. Symbols v , v are the components of input stator voltage, R and L are the stator windings resistance and inductance. The symbols and are the rotor speed and the position, J is the moment of inertia and TL is the load torque treated as an external disturbance. Such model formula is used for easy derivation of the observer structure. The observer is prepared as a model because there is no need of conversion of the coordinates systems for calculation of the output values.

After simple conversion of the motor model, we get the model in the coordinates system rotating with the rotor - *dq* – electrical part:

$$\begin{aligned} \mu\_d &= \mathbf{R} \cdot \dot{\mathbf{i}}\_d + L\_d \frac{d\dot{\mathbf{i}}\_d}{dt} - \Psi\_q \cdot o\\ \mu\_q &= \mathbf{R} \cdot \dot{\mathbf{i}}\_q + L\_q \frac{d\dot{\mathbf{i}}\_q}{dt} + \Psi\_d \cdot o \end{aligned} \tag{3}$$

Position Estimation of the PMSM High Dynamic Drive at Low Speed Range 201

$$\begin{aligned} \Psi \Psi\_d &= L\_d \cdot \dot{\mathbf{i}}\_d + \Psi\_f \\ \Psi \Psi\_q &= L\_q \cdot \dot{\mathbf{i}}\_q \end{aligned} \tag{4}$$

and the mechanical part:

200 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

Assuming ordinary simplified assumptions, the general form of the PMSM model in

di R1 1 iev dt L L L di R1 1 iev dt L L L

<sup>d</sup><sup>ω</sup> <sup>1</sup> <sup>Ψ</sup> <sup>i</sup> <sup>Ψ</sup> i T

The motor model with state variables i, i and is non-linear. All state variables are measurable but in a concept without mechanical sensor and should be estimated. The symbols i , i , , , e , e are stator current, stator flux linkage and induced back EMF

After simple conversion of the motor model, we get the model in the coordinates system

*d dd q*

*di u Ri L*

*u Ri L*

*q qq d*

*d*

*dt di*

*q*

*dt*

 coordinates. Symbols v , v are the components of input stator voltage, R and L are the stator windings resistance and inductance. The symbols and are the rotor speed and the position, J is the moment of inertia and TL is the load torque treated as an external disturbance. Such model formula is used for easy derivation of the observer structure. The

model because there is no need of conversion of the coordinates

αα α

ββ β

βα αβ <sup>L</sup>

stationary orthogonal coordinates can be expressed as follows:

α

β

dt J dθ

dt

systems for calculation of the output values.

rotating with the rotor - *dq* – electrical part:

ω

(1)

(2)

(3)

**Figure 6.** The speed controller structure

**4. PMSM model** 

and the mechanical part:

observer is prepared as a

in 

$$\begin{aligned} T\_e &= \frac{3}{2} \Big[ \Psi\_d \cdot i\_q - \Psi\_q \cdot i\_d \Big] \\ T\_e - T\_L &= J \frac{d\rho o}{dt} \end{aligned} \tag{5}$$

where ud, uq means the components of input voltage, id, iq, Ld, Lq mean currents and inductance of the motor in the *dq*-axis respectively, dqf means flux in the *dq*-axis respectively and flux excited by permanent magnet. The electromagnetic torque is represented by a symbol Te .

Such structure gives a possibility to ease analyze of the decoupled *dq* values of the currents and introduction of different forms of the nonlinear flux distribution. It should be noted that such simple model does not take into account the variable number of pole pairs.

Based on such general model, in simulation PMSM block expanded on nonlinearities in distribution of the flux, current measurement noise addition with control and simple model of friction are used. Model prepared in *dq*-axis gives simple solution to simulate salient pole motor by use the different values of the axis inductance. The *dq* model is equipped with external conversion modules, to get inputs and outputs as voltages and currents in *ABC* phases. It gives possibility to test the drive under various conditions. Outside the PMSM model in axis *dq*, the model is equipped with conversion block into *ABC* coordinates systems used to supply and measurement (Fig. 2). As a measurement noise source a uniform random number function may be used.

#### **5. Observer structure**

Proposed observer system calculates position information from back EMF estimated in coordinates (stator based). This coordinates system was chosen because of its simple form, and there is no need to convert the coordinate system by using the (estimated) shaft position. The sine and cosine of shaft position is calculated from back EMF values, and based on their modulus, is calculated the motor speed (Fig. 7). The inner structure of the observer depends on the correction function. As is shown in figure 7, the observer consists of the electrical part of the PMSM model and an additional correction loop. Different forms of correction functions are shown in the following equations.

According to the method presented in [13] it is convenient to use only first two electrical equations (1), in which the back EMF components are considered as disturbances. In such a case we can prepare an extended state formula, which can be described as:

$$
\begin{array}{ccccc}
\dot{\mathbf{x}} & = \mathbf{A} & \mathbf{x} & + \mathbf{B} & \mathbf{u} & , & \mathbf{y} = \mathbf{C} & \mathbf{x} & & & \mathbf{E} & \mathbf{E}
\end{array}
\tag{6}
$$

where

$$\begin{aligned} \mathbf{x} &= \begin{bmatrix} \mathbf{i}\_{\alpha} \\ \mathbf{i}\_{\beta} \\ \mathbf{e}\_{\alpha} \\ \mathbf{e}\_{\beta} \end{bmatrix}, \quad \mathbf{y} = \begin{bmatrix} \mathbf{i}\_{\alpha} \\ \mathbf{a}\_{\beta} \end{bmatrix}, \quad \mathbf{u} = \begin{bmatrix} \mathbf{v}\_{\alpha} \\ \mathbf{v}\_{\beta} \end{bmatrix} \end{aligned} \quad \mathbf{u} = \begin{bmatrix} \mathbf{v}\_{\alpha} \\ \mathbf{v}\_{\beta} \end{bmatrix} \tag{7}$$

For presented system it is possible to use ordinary Luenberger observer with correction based on error between measured and calculated currents value. Assuming that derivative of disturbances is equal zero one can write the equations describing observer (8).

$$\begin{aligned} \frac{d\hat{\mathbf{i}}\_{\alpha}}{dt} &= -\frac{\mathbf{R}}{\mathbf{L}}\hat{\mathbf{i}}\_{\alpha} - \frac{1}{\mathbf{L}}\hat{\mathbf{e}}\_{\alpha} + \frac{1}{\mathbf{L}}\mathbf{v}\_{\alpha} + \mathbf{K}\_{i\alpha} \left(\mathbf{i}\_{\alpha} - \hat{\mathbf{i}}\_{\alpha}\right) \\ \frac{d\hat{\mathbf{i}}\_{\beta}}{dt} &= -\frac{\mathbf{R}}{\mathbf{L}}\hat{\mathbf{i}}\_{\beta} - \frac{1}{\mathbf{L}}\hat{\mathbf{e}}\_{\beta} + \frac{1}{\mathbf{L}}\mathbf{v}\_{\beta} + \mathbf{K}\_{i\beta} \left(\mathbf{i}\_{\beta} - \hat{\mathbf{i}}\_{\beta}\right) \\ \frac{d\hat{\mathbf{e}}\_{\alpha}}{dt} &= &+\mathbf{K}\_{e\alpha} \left(\mathbf{i}\_{\alpha} - \hat{\mathbf{i}}\_{\alpha}\right) \\ \frac{d\hat{\mathbf{e}}\_{\beta}}{dt} &= &+\mathbf{K}\_{e\beta} \left(\mathbf{i}\_{\beta} - \hat{\mathbf{i}}\_{\beta}\right) \end{aligned} \tag{8}$$

or in matrix form

$$
\dot{\hat{\mathbf{x}}}\_{\rm E} = \mathbf{A}\_{\rm E} \hat{\mathbf{x}}\_{\rm E} + \mathbf{B}\_{\rm E} \mathbf{u} + \mathbf{K} \boxdot{\mathbf{L}} \ln \mathbf{\hat{i}} \tag{9}
$$

where **K** is a correction factor.

**Figure 7.** General structure of observer

Such solution generates acceptable observer's performance, however, a more accurate model was also taken into account [14].

The cost of that simplicity is required of the change of the observer's corrector parameters settings due to operating point (*gain scheduling*). Modifying the observer's parameters as a function of velocity only is sufficient at this case. Its proper change is very important in the case where the speed range is wide. At that case (low speed), the corrector parameters may be constant. Otherwise a scheduling mechanism based on the fuzzy logic or artificial neural network should be used [14]. Because observer estimates back EMF values, to achieve position and speed information one can use that transformation:

$$\hat{\mathbf{e}}\sin\hat{\Theta} = -\frac{\hat{\mathbf{e}}\_{\alpha}}{|\hat{\mathbf{e}}|} \qquad \cos\hat{\Theta} = \frac{\hat{\mathbf{e}}\_{\beta}}{|\hat{\mathbf{e}}|} \tag{10}$$

where

202 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

,

i

 

e

α

β

α

dt

dt

β

of disturbances is equal zero one can write the equations describing observer (8).

 

where

or in matrix form

where **K** is a correction factor.

**Figure 7.** General structure of observer

E EE E E E

i i v

 

αα α iαα α

ββ β iββ β

, , = <sup>e</sup> i v <sup>E</sup>

For presented system it is possible to use ordinary Luenberger observer with correction based on error between measured and calculated currents value. Assuming that derivative

> diˆ R1 1 ˆ ˆ i e v Ki i <sup>ˆ</sup> dt L L L diˆ R1 1 ˆ ˆ i e v Ki i <sup>ˆ</sup> dt L L L deˆ ˆ +K i i

deˆ ˆ +K i i

**x Ax Bu y Cx** (6)

**x yu** (7)

(8)

eαα α

E EE E ˆ ˆ **x Ax Bu K <sup>Δ</sup><sup>i</sup>** (9)

eββ β

$$\left|\hat{\mathbf{e}}\right| = \sqrt{\hat{\mathbf{e}}\_{\alpha}^{2} + \hat{\mathbf{e}}\_{\beta}^{2}} \qquad \left|\hat{\boldsymbol{\phi}}\right| = \frac{\left|\hat{\mathbf{e}}\right|}{\mathbf{k}\_{\mathrm{e}}} \tag{11}$$

Multiplication of observer error by constant coefficient **K** (9) gives the observer structure with proportional correction equation. To modify observer operation it can be proposed a more complex function of observer error **F[i]** instead of a proportional one. By analogue to designing ordinary controller of P, PI and PID structure, one can propose instead of proportional correction more complex operation like PI or PID. This leads to a new general concept of observer, which formula can be written as:

$$
\dot{\hat{\mathbf{x}}}\_{\rm E} = \mathbf{A}\_{\rm E} \hat{\mathbf{x}}\_{\rm E} + \mathbf{B}\_{\rm E} \mathbf{u} + \mathbf{F} \boxed{\mathbf{A} \dot{\mathbf{u}}} \tag{12}
$$

where **F[ i]** is a function of observer corrector. So, the correction function may be a sliding mode corrector [15], an integrated sliding mode corrector [16] or e.g. any other correction function based on integration. Such idea of the observer structure may be used for position estimation also in other types of motor, e.g. SRM [17].

In the case of the proportional-integral (PI) correction the observer equations take the following form:

$$\mathbf{F\_{i}}\begin{bmatrix} \Delta \mathbf{i} \end{bmatrix} = \mathbf{K\_{p}}\begin{bmatrix} \Delta \mathbf{i} \end{bmatrix} + \mathbf{K\_{i}}\begin{bmatrix} \int \Delta \mathbf{i} \end{bmatrix} \mathbf{d} \mathbf{t} \tag{13}$$

On the basis of many simulation tests a more complex corrector structure with proportionaldouble integral (PII2) correction was proposed [16]:

$$\mathbf{F\_2} \begin{bmatrix} \Delta \mathbf{i} \end{bmatrix} = \mathbf{K\_p} \begin{bmatrix} \Delta \mathbf{i} \end{bmatrix} + \mathbf{K\_i} \begin{bmatrix} \int \Delta \mathbf{i} \end{bmatrix} \mathrm{d}\mathbf{t} + \mathbf{K\_{ii}} \int \left[ \int \left[ \int \Delta \mathbf{i} \right] \mathrm{d}\mathbf{t} \right] \mathrm{d}\mathbf{t} \tag{14}$$

The advantage of introducing integral and double integral components of the observer corrector is that they ensure the astatic character of observation (parameters estimation) even during the transient speed process, in which fast changes of speed and reference currents occur – when the back EMFs waveforms are not in sinusoidal shape. The estimation of back EMF signals by the observer enables the calculation of the new values of the rotor speed and position from (10) and (11) at each step of algorithm realization. In fact, the observed signals (back EMFs) are still changing its values (sinusoidal wave) when motor isn't at standstill and the astatic character of observer corrector is very important to follow up the position with small estimation error and small phase shift. The structure of the observer's parameters vector consists of six different elements due to symmetry of the equation (14) for current and back EMF calculation and the additional seventh ke , which is used to scaling back EMF's estimated amplitude into speed value (11). The observer's structure is identical in both and component.

#### **6. Observer parameters setting**

The choice of observer parameters is an important task and should take into account dynamics in closed loop system as well as good accuracy of observation. The simulated drive is a compound object. Motor nonlinearity, discontinuity caused by the inverter structure and discrete structure of the control loop make it difficult to calculate the parameters of the observer. The solution presented in this paper is based on the special algorithm, which is used for automatic supervising the calculations, and after a certain number of cycles generates the results in form of the observer parameter set. The process of parameter synthesis was optimised by means on the base of random weight change (RWC) procedure [18] (Fig. 8). This algorithm is fast and insensitive to the local minimum of the optimized criterion. Depending on the value of the search step parameters, the effects of the algorithm performance that we get are like for gradient algorithm or evolutionary algorithm (Fig. 9), the possibility to quickly find a local minimum or in longer calculations the searching and finding the global minimum. The searching process is supervised by the quality index. The quality function of observer optimization is formulated as:

$$\underline{Q} = \begin{cases} \mathfrak{e}\_{\uparrow}^{1+\tau} \\ \int \mathfrak{e}\_{\Theta}^{2}(t)dt + \Delta \,\mathrm{e}\_{\Theta}(\tau) \\ \mathfrak{t}\_{\downarrow} \end{cases} \tag{15}$$

where e is the position estimation error, e is the range of the error value changes of the estimated position during the transient process, t1 and t1 + are the time boundaries of the integral calculation. The meaning of those parameters is explained in figure 10.

The optimization procedure is performing *off-line* by simulating a transient process (can also be performed *on-line* using real system, while motor drive is operating, in a case of significantly reduced range of coefficients change). According to the RWC procedure a new set of corrector settings is randomly selected at each step but only the set which gives estimation improvement (for quality index defined by (15) means smaller quality index Position Estimation of the PMSM High Dynamic Drive at Low Speed Range 205

204 MATLAB – A Fundamental Tool for Scientific Computing and Engineering Applications – Volume 1

structure is identical in both

**6. Observer parameters setting** 

 and 

The advantage of introducing integral and double integral components of the observer corrector is that they ensure the astatic character of observation (parameters estimation) even during the transient speed process, in which fast changes of speed and reference currents occur – when the back EMFs waveforms are not in sinusoidal shape. The estimation of back EMF signals by the observer enables the calculation of the new values of the rotor speed and position from (10) and (11) at each step of algorithm realization. In fact, the observed signals (back EMFs) are still changing its values (sinusoidal wave) when motor isn't at standstill and the astatic character of observer corrector is very important to follow up the position with small estimation error and small phase shift. The structure of the observer's parameters vector consists of six different elements due to symmetry of the equation (14) for current and back EMF calculation and the additional seventh ke , which is used to scaling back EMF's estimated amplitude into speed value (11). The observer's

component.

quality index. The quality function of observer optimization is formulated as:

*<sup>Q</sup> <sup>e</sup> <sup>t</sup> dt <sup>e</sup>*

where e is the position estimation error, e is the range of the error value changes of the estimated position during the transient process, t1 and t1 + are the time boundaries of the

The optimization procedure is performing *off-line* by simulating a transient process (can also be performed *on-line* using real system, while motor drive is operating, in a case of significantly reduced range of coefficients change). According to the RWC procedure a new set of corrector settings is randomly selected at each step but only the set which gives estimation improvement (for quality index defined by (15) means smaller quality index

1

t

integral calculation. The meaning of those parameters is explained in figure 10.

1

t

<sup>2</sup> (15)

The choice of observer parameters is an important task and should take into account dynamics in closed loop system as well as good accuracy of observation. The simulated drive is a compound object. Motor nonlinearity, discontinuity caused by the inverter structure and discrete structure of the control loop make it difficult to calculate the parameters of the observer. The solution presented in this paper is based on the special algorithm, which is used for automatic supervising the calculations, and after a certain number of cycles generates the results in form of the observer parameter set. The process of parameter synthesis was optimised by means on the base of random weight change (RWC) procedure [18] (Fig. 8). This algorithm is fast and insensitive to the local minimum of the optimized criterion. Depending on the value of the search step parameters, the effects of the algorithm performance that we get are like for gradient algorithm or evolutionary algorithm (Fig. 9), the possibility to quickly find a local minimum or in longer calculations the searching and finding the global minimum. The searching process is supervised by the

**Figure 8.** Adaptation of the RWC algorithm to the parameter selection of the observer procedure

**Figure 9.** Features of the algorithm, depending on the search step value

**Figure 10.** Explanation of the equation (15) parameters

value) is saved. In the procedure a dimension of search area (a range of randomly change of coefficient values) must be determined at each step. In the presented solution a wide area was assumed at the beginning of optimization process for fast quality index reduction and next at the final stage its dimension was reduced to achieve better accuracy. As a result of such *off-line* optimization a set of optimal values of corrector coefficients is found for the analyzed point of operation. If the speed is changed in a wide range, the modifying of the parameter set is needed. This procedure depends on search parameters, may be fast and insensitive to the local minimum of the optimized criterion. The optimization procedure may be performed *off-line* by simulating a transient process. The optimization procedure should be repeated for different points of operation, which were determined by the steady state speed value. At each step of optimization the transient process of the step response to speed reference changes in the selected point of operation was simulated, and during this process the value of the criterion was calculated. According to the RWC procedure a new set of corrector settings is randomly selected at each step but only the set which gives estimation improvement (smaller criterion value) is stored. In the procedure a dimension of search area (a range of randomly change of coefficient values) must be determined at each step. In the presented solution a wide area was assumed at the beginning of optimization process and next at the final stage its dimension was reduce to achieve better accuracy.

Because the optimization procedure of the observer parameters is based on random numbers generation, it is important to take care on proper initiation of that generator. It is very important to initiate generating values using such code:

```
rand('state', sum(100*clock))
```
It is used to eliminate the generation of the same values sequence, each time you start MATLAB.
