# Design and processor in the loop implementation of an improved control for IM driven solar PV fed water pumping system

Mustapha Errouha, Quentin Combe, Saad Motahhir, S. Askar, Mohamed Abouhawwash

► To cite this version:

Mustapha Errouha, Quentin Combe, Saad Motahhir, S. Askar, Mohamed Abouhawwash. Design and processor in the loop implementation of an improved control for IM driven solar PV fed water pumping system. Scientific Reports, 2022, 12, pp.4688. 10.1038/s41598-022-08252-7. hal-03694562

HAL Id: hal-03694562

https://hal.science/hal-03694562

Submitted on 20 Jun 2023

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_1.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
<figure><img src="image_2.png" /></figure>

OPEN

# Design and processor in the loop implementation of an improved control for IM driven solar PV fed water pumping system

Mustapha Errouha<fnref n="1" />✉, Quentin Combe², Saad Motahhir³, S. S. Askar⁴ & Mohamed Abouhawwash⁵,⁶

In recent years, the improvement of photovoltaic water pumping system (PVWPS) efficiency takes the considerable interest of researchers due to its operating based on cleaner electrical energy production. In this paper, a new approach based on fuzzy logic controller incorporating loss minimization technique applied to the induction machine (IM) is developed for PVWPS applications. The proposed control selects the optimal flux magnitude by minimization of the IM losses. Moreover, Variable step size perturb and observe method is introduced. The suitability of the proposed control is approved by reducing the absorbed current; therefore, the motor losses are minimized and the efficiency is improved. The proposed control strategy is compared with the method without losses minimization. The comparison results illustrate the effectiveness of the proposed method based on losses minimization regarding the electrical speed, absorbed current, flow water and developed flux. A processor-in-the-loop (PIL) test is effectuated as an experimental test of the proposed method. It consists in implementing the generated C code on the STM32F4 discovery board. The obtained results from the embedded board are similar to numerical simulation results.

Renewable energy sources especially solar PV technology can be a cleaner alternative solution to fossil fuels for water pumping systems<fnref n="1" />,². PV water pumping system is gained a lot of attention in remote areas where electricity is not available³,⁴.

Various kinds of engines are utilized with PV pumping applications. The primitive stage of PVWPS is based on DC motor. These motors are easy to control and implement but they need regular maintenance due to commentators and brushes⁵. To overcome this disadvantage, Brushless permanent magnet motors are introduced which are characterized by the absence of brushes, high efficiency and reliability⁶. PVWPS based on IM illustrates better performance compared to other motors because this type of motor is reliable, low cost and maintenance-free and gives more possibilities for control strategies⁷. Indirect Field oriented control (IFOC) technique and direct torque control (DTC) method are often employed⁸.

IFOC was developed by Blaschke and Hasse to allow varying IM speed over a wide range⁹,¹⁰. The stator currents are separated into two components, one generates the flux and the other produces the torque by utilizing transformation to the d-q coordinate system. This allows independent control of the flux and torque during both the steady state and dynamic conditions. The axis (d) is aligned with the rotor flux space vector which involves that the q-axis component of the rotor flux space vector is always zero. FOC gives a good and faster response¹¹,¹², however, this method is complex and affected by the parameter variations¹³. To surmount these drawbacks, DTC was introduced by Takashi and Noguchi¹⁴, this command presents high dynamic performance, and it is robust and less sensitive to parameter variations. In DTC, the control of the electromagnetic torque and the stator flux is made using subtracting the stator flux and torque from the corresponding estimated values. The result is introduced to hysteresis comparators to generate the appropriate voltage vectors to control simultaneously the stator flux and the torque.

<footnote n="1">¹Plasma and Conversion of Energy Laboratory, ENSEEIHT, University of Toulouse, Toulouse, France. ²LEMTA, University of Lorraine, Vandœuvre-lès-Nancy, France. ³ENSA, SMBA University, Fez, Morocco. ⁴Department of Statistics and Operations Research, College of Science, King Saud University, Riyadh 11451, Saudi Arabia. ⁵Department of Mathematics, Faculty of Science, Mansoura University, Mansoura 35516, Egypt. ⁶Department of Computational Mathematics, Science, and Engineering (CMSE), College of Engineering, Michigan State University, East Lansing, MI 48824, USA. ✉email: errouha.mustapha@gmail.com</footnote>
<figure><img src="image_3.png" /><figcaption>**Figure 1.** Description of the proposed system.</figcaption></figure>

The major inconvenience of this control strategy is high ripples in torque and flux due to the use of the hysteresis regulators for stator flux and electromagnetic torque regulation<sup>15,42</sup>. The multilevel converters are used for minimizing the ripples but the efficiency is reduced due to the number of power switches<sup>16</sup>. Several authors have used Space Vector Modulation (SWM)<sup>17</sup>, Sliding mode control (SMC)<sup>18</sup>, this technique is robust but the undesirable chattering effect is appeared<sup>19</sup>. Many researchers used the artificial intelligence techniques to improve the controller performances, among them, (1) neural network, this control strategy requires a high-speed processor for implementation<sup>20</sup>, (2) genetic algorithm<sup>21</sup>.

The fuzzy control is robust, suitable for the nonlinear control strategy and it does not demand the knowledge of the exact model. It consists in using the fuzzy logic block instead of the hysteresis controllers and the switching selection table to reduce the flux and torque ripples. It is worth indicating that DTC based on FLC offers better performance<sup>22</sup>, but it isn't sufficient to maximize the efficiency of the engine, therefore an optimization technique is needed with the control loop.

In most of the previous studies, the authors choose a constant flux as reference flux<sup>23-26</sup>, but this choice of reference doesn't represent the optimum operating.

The high-performance efficient motor drives require fast and accurate speed response. On the other hand, the control can be non-optimal for some operations and hence, the efficiency of the drive system cannot be optimized. The use of variable flux reference during the operating of the system can achieve better performance.

Many authors proposed the search controller (SC) that minimizes the losses for the improvement of the efficiency of the engine at different load conditions such as in<sup>27</sup>. This technique consists in measuring and minimizing the input power by iterating the reference of d-axis current or the stator flux reference. However, this approach introduces torque ripples due to the oscillations present in the air gap flux and the implementation of this method is time consuming and computational resource intensive. Particle swarm optimization is also used to improve efficiency<sup>28</sup>, but this technique can be trapped into a local minimum which leads to improperly chosen control parameters<sup>29</sup>.

In this paper, a technique associated to FDTC to select the optimal flux by reducing the motor losses is proposed. This combination ensures the functioning using the optimal flux level at each operating point, which enhances the efficiency of the proposed PV water pumping system. Hence, it appears to be very convenient for PV water pumping applications.

Besides, a processor in the loop test is conducted as an experimental verification of the proposed method using STM32F4 board. The main advantages of this core are simplicity of implementation, low cost and no necessity to develop a complex program<sup>30</sup>. Moreover, the FT232RL USB-UART converter board is associated with STM32F4 to ensure an external communication interface in order to establish a virtual serial port on the computer (COM port). This method allows the transmission of data at a high baud rate.

The performance of the PVWPS using the proposed technique is compared with the PV system without losses minimization under different operating conditions. The obtained results show that the proposed PV water pumping system is better in terms of minimization of stator current and copper losses, optimizing flux and pumped water.

The rest of the paper is structured as follows: the modeling of the proposed system is given in “Modeling of PV system” section. In “Control strategies for the studied system” section, FDTC, the proposed control strategies and MPPT technique are detailed. The research results are discussed in “Simulation results” section. In “PIL test using STM32F4 discovery board” section, the processor in the loop test is presented. The conclusions of this paper are presented in “Conclusion” section.

## Modeling of PV system

Figure 1 shows the system configuration for the proposed standalone PV water pumping system. The system is composed of an IM based centrifugal pump, a PV array, two power converters [boost converters and voltage source inverter (VSI)]. In this section, the modeling of the studied PV water pumping system is presented.

**Photovoltaic cell.** The single diode model of cell the solar photovoltaic cell is adopted in this work. The characteristic of PV cell is expressed by<sup>31-33</sup>.
$$I = I_{ph} - I_{0} \left( \exp \frac{q(V + R_{ss}I)}{a \text{KTN}_{s}} - 1 \right) - \frac{(V + IR_{ss})}{R_{sh}} \quad (1)$$

**DC-DC converter.** To perform an adaptation, the boost converter is employed. The relation between input and output voltages of the DC-DC converter is given by³⁴:

$$V_{dc} = \frac{V_{pv}}{1 - \alpha} \qquad (2)$$

**DC-AC converter.** The equations that characterize the behavior of the DC-AC converter are expressed by³⁵,⁴¹:

$$\begin{bmatrix} V_a \\ V_b \\ V_c \end{bmatrix} = \frac{V_{dc}}{3} \begin{bmatrix} 2 & -1 & -1 \\ -1 & 2 & -1 \\ -1 & -1 & 2 \end{bmatrix} \begin{bmatrix} S_a \\ S_b \\ S_c \end{bmatrix} \qquad (3)$$

**Induction motor.** the mathematical model of the IM can be described in the reference frame (α,β) by the following equations⁵,⁴⁰:

$$\left\{ \begin{aligned} V_{\alpha s} &= R_s I_{\alpha s} + \frac{d}{dt} \phi_{\alpha s} & (4) \\ V_{\beta s} &= R_s I_{\beta s} + \frac{d}{dt} \phi_{\beta s} & (5) \end{aligned} \right. $$

$$\left\{ \begin{aligned} \phi_{\alpha s} &= l_s I_{\alpha s} + M I_{\alpha s} & (6) \\ \phi_{\beta s} &= l_s I_{\beta s} + M I_{\beta s} & (7) \end{aligned} \right. $$

$$\left\{ \begin{aligned} 0 &= I_{\alpha r} R_r + \frac{d}{dt} \phi_{\alpha r} + \phi_{\beta r} w_m & (8) \\ 0 &= I_{\beta r} R_r + \frac{d}{dt} \phi_{\beta r} + \phi_{\alpha r} w_m & (9) \end{aligned} \right. $$

$$\left\{ \begin{aligned} \phi_{\alpha r} &= I_{\alpha r} l_r + M I_{\alpha r} & (10) \\ \phi_{\beta r} &= I_{\beta r} l_r + M I_{\beta r} & (11) \end{aligned} \right. $$

and the electromagnetic torque developed:

$$T_{em} = \frac{3}{2} P (\phi_{\alpha s} I_{\beta s} - \phi_{\beta s} I_{\alpha s}) \qquad (12)$$

where $l_s, l_r$: Stator and Rotor inductances, M: mutual inductance, $R_s, I_s$: Stator resistance and stator current, $R_r, I_r$: Rotor resistance and rotor current, $\phi_s, V_s$: Stator flux and stator voltage, $\phi_r, V_r$: Rotor flux and rotor voltage.

**Pump.** The load torque of the centrifugal pump which is in proportion to the square of the IM speed can be determined by:

$$T_r = K_p \Omega^2 \qquad (13)$$

## Control strategies for the studied system

The control of the proposed water pumping system is divided into three different subsections. First section deals with the MPPT technique. The second part deals with the direct torque control based on fuzzy logic controller to drive the IM. Moreover, the third part describes a technique associated with DTC based on FLC, which allows determining the reference flux.

**MPPT technique.** In this work, Variable Step Size P&O technique is employed for tracking of maximum power point. It's characterized by fast tracking and low oscillations (Fig. 2)³⁷⁻³⁹.

**DTC based on fuzzy logic controller.** The principal idea of the DTC is to directly command the flux and torque of the machine, but the use of the hysteresis regulators for electromagnetic torque and stator flux regulation leads to high torque and flux ripples. Thus, a fuzzy technique is introduced to enhance the DTC method (Fig. 7). The FLC can develop the adequate inverter vector state.

The stator flux components can be expressed by:

$$\left\{ \begin{aligned} \hat{\phi}_{s\alpha} &= \int_{0}^{t} (v_{s\alpha} - R_s \cdot i_{s\alpha}) \cdot dt \\ \hat{\phi}_{s\beta} &= \int_{0}^{t} (v_{s\beta} - R_s \cdot i_{s\beta}) \cdot dt \end{aligned} \right. \qquad (14)$$
<figure><img src="image_4.png" /><figcaption>Figure 2. flowchart of Variable step size P&O method.</figcaption></figure>

The estimated electromagnetic torque can be written as:

$$ \hat{T}_{em} = p \cdot (\hat{\phi}_{s\alpha} \cdot i_{s\beta} - \hat{\phi}_{s\beta} \cdot i_{s\alpha}) \quad (15) $$

In addition, the stator flux angle and the amplitude are given by:

$$ \hat{\phi}_s = \sqrt{\hat{\phi}_{s\alpha}^2 + \hat{\phi}_{s\beta}^2} \quad (16) $$

$$ \theta_s = \arctan(\frac{\hat{\phi}_{s\beta}}{\hat{\phi}_{s\alpha}}) \quad (17) $$

An FLC is generally composed of four main steps:

**Fuzzification.** During this step, the inputs are converted into fuzzy variables through membership functions (MFs) and linguistic terms.

**For stator flux error.** The three membership functions for the first input ($\epsilon_\phi$) are negative (N), positive (P) and zero (Z) as shown in Fig. 3.

**For torque error.** The five membership functions for the second input ($\epsilon_{Tem}$) are negative large (NL) negative small (NS) zero (Z) positive small (PS) and positive large (PL) as shown in Fig. 4.

**For the sector angle.** The stator flux trajectory consists of 12 sectors in which the fuzzy sets are represented by isosceles triangular membership functions as shown in Fig. 5.

**Fuzzy control rules.** Table 1 groups 180 fuzzy rules which are determined using membership functions of the inputs to select the suitable switching state.

**Inference.** The inference method is performed using Mamdani's technique. The factor of weighting for $i_{th}$ rule ($\alpha_i$) is given by:

$$ \alpha_i = \min(\mu Ai(\epsilon\phi), \mu Bi(eT), \mu Ci(\theta)) \quad (18) $$
<figure><img src="image_5.png" /><figcaption>**Figure 3.** The fuzzy membership functions of $\epsilon_{\phi}$.</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>**Figure 4.** The fuzzy membership functions of $\epsilon_{\text{Tem}}$.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>**Figure 5.** The fuzzy membership functions of $\theta_s$.</figcaption></figure>
<table><caption>**Table 1.** Fuzzy switching logic rule base.</caption><thead><tr><th>ε(φ)</th><th>ε(Tem)</th><th>θ<sub>1</sub></th><th>θ<sub>2</sub></th><th>θ<sub>3</sub></th><th>θ<sub>4</sub></th><th>θ<sub>5</sub></th><th>θ<sub>6</sub></th><th>θ<sub>7</sub></th><th>θ<sub>8</sub></th><th>θ<sub>9</sub></th><th>θ<sub>10</sub></th><th>θ<sub>11</sub></th><th>θ<sub>12</sub></th></tr></thead><tbody><tr><td>NL</td><td rowspan="5">Z</td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td></tr><tr><td>PL</td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td></tr><tr><td>Z</td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td></tr><tr><td>PS</td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td></tr><tr><td>NS</td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td></tr><tr><td>PL</td><td rowspan="5">P</td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td></tr><tr><td>NL</td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td></tr><tr><td>Z</td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td></tr><tr><td>PS</td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td></tr><tr><td>NS</td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td></tr><tr><td>PL</td><td rowspan="5">N</td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td></tr><tr><td>NL</td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td></tr><tr><td>Z</td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td><td>V<sub>7</sub></td><td>V<sub>0</sub></td></tr><tr><td>PS</td><td>V<sub>4</sub></td><td>V<sub>4</sub></td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td></tr><tr><td>NS</td><td>V<sub>5</sub></td><td>V<sub>5</sub></td><td>V<sub>6</sub></td><td>V<sub>6</sub></td><td>V<sub>1</sub></td><td>V<sub>1</sub></td><td>V<sub>2</sub></td><td>V<sub>2</sub></td><td>V<sub>3</sub></td><td>V<sub>3</sub></td><td>V<sub>4</sub></td><td>V<sub>4</sub></td></tr></tbody></table>

<figure><img src="image_8.png" /><figcaption>**Figure 6.** The membership functions for the output.</figcaption></figure>

$$ \mu'Vi(V) = \max(\alpha i, \mu Vi(V)) \qquad (19) $$

where $\mu Ai(e\varphi), \mu Bi(eT), \mu Ci(\theta)$: flux, torque, and stator flux angle errors membership values.

**Defuzzification.** Figure 6 illustrates the obtained crisp values from the fuzzy values using the max method presented by Eq. (20).

$$ \mu'Vout(V) = \max_{i=1}^{180} \max(\mu'Vi(V)) \qquad (20) $$

**Proposed loss minimization technique.** By improving the motor efficiency, it is possible to increase the flow rate and then the daily water pumped amount (Fig. 7). The purpose of the following technique is to associate a strategy based on losses minimization with the Direct Torque Control method.

It is well known that the value of the flux is important for the efficiency of the motor. A high value of the flux leads to an increase in the iron losses as well as a magnetic saturation circuit. On contrary, a low flux level leads to high joule losses.

Consequently, the reduction of the losses in the IM is directly linked with the choice of the flux level.

The proposed approach is based on the modeling of the joule losses in the machine which are related to the current flow through the stator windings. It consists in adjusting the value of the rotor flux to an optimal which minimizes the motor losses to increase efficiency. The joule losses can be expressed as follows (the core losses are neglected):

$$ P_j = P_{jstator} + P_{jrotor} \qquad (21) $$

$$ P_{jstator} = R_s (i_{ds}^2 + i_{qs}^2) \qquad (22) $$
<figure><img src="image_9.png" /><figcaption>Figure 7. control scheme of PV water pumping system.</figcaption></figure>

$$P_{jrotor} = R_r (i_{dr}^2 + i_{qr}^2) \qquad (23)$$

The total joule losses are given by:

$$P_j = R_s (i_{ds}^2 + i_{qs}^2) + R_r (i_{dr}^2 + i_{qr}^2) \qquad (24)$$

A decrease in the current leads to a decrease in the joule losses.

The electromagnetic torque $C_{em}$ and the rotor flux $\phi_r$ are calculated in d-q coordinate system as:

$$T_{em} = p \frac{M}{L_r} \phi_r i_{qs} \qquad (25)$$

$$\phi_r = M i_{ds} \qquad (26)$$

From Eqs. (25–26–27), the joule losses are as follows:
<table><caption>**Table 2.** Csun 235-60p PV panel characteristics.</caption><tr><td>Maximum power</td><td>235 W</td></tr><tr><td>Open circuit voltage</td><td>36.8 V</td></tr><tr><td>Short circuit current</td><td>8.59 A</td></tr><tr><td>Maximum power voltage</td><td>29.5 V</td></tr><tr><td>Maximum power current Pmax</td><td>7.97 A</td></tr></table>

<table><caption>**Table 3.** Induction machine characteristics.</caption><tr><td>R<sub>s</sub>R<sub>r</sub></td><td>4.85 (Ω), 3.805 (Ω)</td></tr><tr><td>I<sub>s</sub>I<sub>r</sub></td><td>0.274 [H], 0.274 [H]</td></tr><tr><td>Nominal power</td><td>1.5 (KW)</td></tr><tr><td>P</td><td>2</td></tr><tr><td>Inertia moment</td><td>0.031 (kg m<sup>2</sup>)</td></tr><tr><td>Viscous friction</td><td>0.00114 (N m s/rad)</td></tr></table>

<table><caption>**Table 4.** The used parameters of the PVWPS.</caption><thead><tr><td>Parameter</td><td>Value</td></tr></thead><tbody><tr><td>V<sup>*</sup><sub>dc</sub></td><td>400 V</td></tr><tr><td>C<sub>dc</sub></td><td>2000 μF</td></tr><tr><td>α</td><td>0.26</td></tr><tr><td>L<sub>pv</sub></td><td>3 mH</td></tr></tbody></table>

$$P_{joule} = R_s i_{ds}^2 + \left( \left( R_r \left( \frac{M}{L_r} \right) \right)^2 + R_s \right) \left( T_{em} \frac{L_r}{M p \phi_r} \right)^2 \quad (27)$$

The electromagnetic torque $C_{em}$ and the rotor flux $\phi_r$ are calculated in reference (d,q) as:

$$T_{em} = p \frac{M}{L_r} \phi_r i_{qs} \quad (28)$$

$$\phi_r = M i_{ds} \quad (29)$$

By solving Eq. (30), we can find the optimal stator current which ensures both optimal rotor flux and minimal losses:

$$\frac{dP_{joule}}{di_{ds}} = 0 \quad (30)$$

Therefore, the optimal stator current is expressed by:

$$I_{dsopt} = K_{opt} i_{qs}^* \quad (31)$$

where

$$K_{opt} = \sqrt{1 + \left(\frac{M}{L_r}\right)^2 \frac{R_r}{R_s}} \quad (32)$$

## Simulation results

Different simulations are conducted using MATLAB/Simulink software in order to evaluate the robustness and the performance of the proposed technique. The studied system is composed of eight CSUN 235-60P panels of 230 W (Table 2) connected in series. The centrifugal pump is driven by an IM which is characterized by the parameters presented in Table 3. The components of PV pumping system are listed in Table 4.
<figure><img src="image_10.png" /><figcaption>**Figure 8.** (a) Solar radiation (b) Extracted power (c) Duty cycle (d) DC link voltage (e) Rotor speed (f) Pumped water (g) Stator phase current of FDTC (h) Stator phase current of FDTCO (i) Flux response using FLC (j) Flux response using FDTCO (k) Stator flux trajectory using FDTC (l) Stator flux trajectory using FDTCO.</figcaption></figure>
<figure><img src="image_11.png" /><figcaption>**Figure 8.** (continued)</figcaption></figure>

In this section, the PV water pumping system using FDTC with constant flux reference is compared with the proposed system based on the optimal flux (FDTCO) in the same operating conditions. The performances of both PV systems are tested by considering the following cases:

**Starting performance of the proposed system.** This section presents the starting up state of the proposed pumping system according to insolation of 1000 W/m². Figure 8e illustrates the response of electric speed. The proposed technique provides a better rise time compared to FDTC, where the steady state is reached at 1.04 s while that with the FDTC, the steady state is reached at 1.93 s. Figure 8f shows the pumped water for both control strategies. It's seen that, the FDTCO increases the pumped water, which explains the improvement of the energy converted by the IM. Figures 8g and 8h indicate the absorbed stator currents. The starting current is 20 A using the FDTC while the proposed control strategy indicates a starting current of 10 A, which leads in reducing the joule losses. Figures 8i and 8j show the developed stator flux. The PVPWS based on FDTC operates under a constant reference flux of 1.2 Wb while in the proposed method, the reference flux is 1A which involves improving the efficiency of PV systems.

**Variable solar irradiation.** Solar radiation varies from 1000 to 700 W/m² at 3 s, then to 500 W/m² at 6 s (Fig. 8a). Figure 8b shows the PV power corresponding to 1000 W/m², 700 W/m² and 500 W/m². Figures 8c and 8d illustrate the duty cycle and DC link voltage respectively. Figure 8e illustrates the electric speed of IM, we can notice that the proposed technique presents better speed and response time compared to the PV system based on FDTC. Figure 8f shows the volume of pumped water obtained using FDTC and FDTCO for various levels of irradiance. Using the FDTCO, it is possible to obtain a higher amount of pumped water than using FDTC. Figures 8g and 8h illustrate the simulated current response, with the FDTC method and the proposed control strategy. By using the suggested control technique, the current amplitude is minimized which implies the reduction of copper losses, which improves the system efficiency. Thus, a high stating current can cause a deterioration of the machine performance. Figure 8j presents the variation of developed flux responses in order to choose the optimum flux ensuring the minimization of the losses, thus, the suggested technique illustrates its performance. Contrary to Fig. 8i, the flux is constant which is not representing an optimal operation. Figures 8k and 8l indicate the evolution of the stator flux trajectory. Figure 8l illustrates the optimal flux development and explains the principal idea of the proposed control strategy.

**Sudden change in solar radiation.** A sudden change in solar radiation is applied, where the irradiance is 1000 W/m² at the beginning, after 1.5 s, is decreased suddenly to 500 W/m² (Fig. 9a). Figure 9b shows the extracted PV power from the PV panel corresponding to 1000 W/m² and 500 W/m². Figures 9c and 9d illustrate the duty cycle and DC link voltage respectively. From Fig. 9e, the proposed method offers a better response time.
<figure><img src="image_12.png" /><figcaption>**Figure 9.** (a) Solar radiation (b) Extracted power (c) Duty cycle (d) DC link voltage (e) Rotor speed (f) water flow (g) Stator phase current of FDTC (h) Stator phase current of FDTCO (i) Flux response using FLC (j) Flux response using FDTCO (k) Stator flux trajectory using FDTC (l) Stator flux trajectory using FDTCO.</figcaption></figure>
<figure><img src="image_13.png" /><figcaption>Figure 9. (continued)</figcaption></figure>

<table><caption>Table 5. Comparative results between FDTC and FDTCO.</caption><thead><tr><th rowspan="3">Irradiation (W/m²)</th><th colspan="3">Performance</th><th colspan="3">FDTCO</th></tr><tr><th colspan="3">FDTC</th><th colspan="3">FDTCO</th></tr><tr><th>Current (A)</th><th>Flux (Wb)</th><th>Water flow rate (m³/s)</th><th>Current (A)</th><th>Flux (Wb)</th><th>Water flow rate (m³/s)</th></tr></thead><tbody><tr><td>1000</td><td>7.764</td><td>1.2</td><td>0.009</td><td>6.15</td><td>1</td><td>0.01</td></tr><tr><td>700</td><td>7.27</td><td>1.2</td><td>0.0087</td><td>5.94</td><td>0.9</td><td>0.0089</td></tr><tr><td>500</td><td>6.7</td><td>1.2</td><td>0.0077</td><td>5.8</td><td>0.83</td><td>0.0079</td></tr></tbody></table>

<figure><img src="image_14.png" /><figcaption>Figure 10. Steps to parameterize PIL test using STM32F407 MCU.</figcaption></figure>
<figure><img src="image_15.png" /><figcaption>**Figure 11.** PIL test results for flux response.</figcaption></figure>

Figure 9f shows the pumped water volume obtained for both control strategies. Using the FDTCO, the amount of pumped water is higher than using FDTC, where the pumped volume water is 0.01 m³/s when the irradiance is 1000 W/m² while, the pumped volume water is 0.009 m³/s for FDTC; moreover, the pumped volume water is 0.0079 m³/s for FDTCO when the irradiance is 500 W/m², while the pumped volume water is 0.0077 m³/s for FDTC. Figures 9g and 9h. illustrate the simulated current response using the FDTC method and the suggested control strategy. We can notice that the proposed control strategy indicates a reduction in current amplitude under sudden irradiance variations, which leads in reducing the copper losses. Figure 9i presents the variation of developed flux responses in order to choose the optimum flux ensuring the minimization of the losses, thus, the proposed technique illustrates its performance, where the flux is 1Wb where the irradiance is 1000 W/m² while, the flux is 0.83Wb where the irradiance is 500 W/m². Contrary to Fig. 9i, the flux is constant of 1.2 Wb which does not represent an optimal functioning. Figures 9k and 9l indicate the evolution of the stator flux trajectory. Figure 9i illustrates the optimal flux development and explains the principal idea of the proposed control strategy and the improvement of the proposed water pumping system.

The comparative analysis of both techniques in terms of flux value, current amplitude and pumped water are presented in Table 5, which illustrates that PVWPS based on the proposed technique provides high performances with increasing pumped water flow, minimizing the amplitude current and losses, owing to the optimal flux choice.

## PIL test using STM32F4 discovery board

In order to validate and test the proposed control strategy, the PIL test based on the STM32F4 board is effectuated. It consists in generating the code that will be loaded and run on an embedded board. This board contains a 32-bit microcontroller with 1 Mbyte flash memory, clock frequency of 168 MHz, floating point unit, DSP instructions, 192 Kbytes SRAM. During this test, a developed PIL block is created in the control system incorporating the generated code based on the STM32F4 discovery hardware board and introduced on Simulink software. The steps allowing to configure the PIL test using STM32F4 board are illustrated in Fig. 10.

The co-simulation PIL test using STM32F4 can be utilized as a low-cost technique to validate the proposed technique. In this paper, the optimization block which provides the optimal reference flux is executed in the STMicroelectronics Discovery board (STM32F4).

This latter and Simulink and are executed at the similar period and exchanged the information using of proposed method for PVWPS in the co-simulation process. Figure 12 illustrates the implementation of the optimization technique subsystem in STM32F4.

Only the proposed technique of the optimal reference flux has been displayed in this co-simulation because it is the main control variable of this work that demonstrates the PV water pumping system control behavior.

Figure 11a,b show the PIL test results for the proposed method under Variable and sudden change in solar radiation. The numerical simulation results indicate a similar behavior to those obtained through PIL co-simulation test, showing that the proposed control strategy is powerful (Fig. 12). Consequently, the co-simulation PIL process can be utilized as an experimental setup to validate the hardware implementation of various control strategies.

## Conclusion

An improved DTC strategy for PVPWS applications is presented here. The proposed technique is based on FLC which aims to operate the motor at the optimal value of flux. The simulation has been carried out in Matlab/ Simulink to evaluate the performance of the proposed control strategy and compared to FDTC with constant flux reference under different operating conditions. A co-simulation PIL validation based on STM32F4 board has been carried out. Numerical simulation results indicate a similar behavior to those obtained through the PIL co-simulation test, which can be employed as a great implement, experimental setup and low-cost technique to evaluate the control strategies.
<figure><img src="image_16.png" /><figcaption>Figure 12. PIL test of the optimal reference flux block using STM32F4 board.</figcaption></figure>

According to the obtained results, the main improvements are:

* The stator current is reduced, consequently the motor losses are minimized.

* The optimizing of the rotor flux

* The pumped water is increased under different operating conditions

* The efficiency of the proposed PV water pumping system is improved.
Received: 27 September 2021; Accepted: 4 March 2022

Published online: 18 March 2022

References

1. Chilundo, R. J., Maúre, G. A. & Mahanjane, U. S. Dynamic mathematical model design of photovoltaic water pumping systems for horticultural crops irrigation: A guide to electrical energy potential assessment for increase access to electrical energy. *J. Clean. Prod.* https://doi.org/10.1016/j.jclepro.2019.117878 (2019).

2. Motahhir, S., EL Hammoumi, A., EL Ghzizal, A. & Derouich, A. Open hardware/software test bench for solar tracker with virtual instrumentation. *Sustain. Energy Technol. Assessment* **31**, 9–16. https://doi.org/10.1016/j.seta.2018.11.003 (2019).

3. Bhende, C. N. & Malla, S. G. Novel control of photovoltaic based water pumping system without energy storage. *Int. J. Emerg. Electr. Power Syst.* **13**, 5. https://doi.org/10.1515/1553-779X.2931 (2012).

4. Sontake, V. C. & Kalamkar, V. R. Solar photovoltaic water pumping system: A comprehensive review. *Renew. Sustain. Energy Rev.* **59**, 1038–1067. https://doi.org/10.1016/j.rser.2016.01.021 (2016).

5. Reza, C. M. F. S., Islam, M. D. & Mekhilef, S. A review of reliable and energy efficient direct torque controlled induction motor drives. *Renew. Sustain. Energy Rev.* **37**, 919–932. https://doi.org/10.1016/j.rser.2014.05.067 (2014).

6. Gopal, C., Mohanraj, M., Chandramohan, P. & Chandrasekar, P. Renewable energy source water pumping systems: A literature review. *Renew. Sustain. Energy Rev.* **25**, 351–370. https://doi.org/10.1016/j.rser.2013.04.012 (2013).

7. Talbi, B. et al. A high-performance control scheme for photovoltaic pumping system under sudden irradiance and load changes. *Sol. Energy* **159**, 353–368. https://doi.org/10.1016/j.solener.2017.11.009 (2018).

8. Jannati, M. et al. A review on variable speed control techniques for efficient control of single-phase induction motors: Evolution, classification, comparison. *Renew. Sustain. Energy Rev.* **75**, 1306–1319. https://doi.org/10.1016/j.rser.2016.11.115 (2017).

9. Li, G., Jin, Y., Akram, M. W. & Chen, X. Research and current status of the solar photovoltaic water pumping system: A review. *Renew. Sustain. Energy Rev.* **79**, 440–458. https://doi.org/10.1016/j.rser.2017.05.055 (2017).

10. Errouha, M. & Derouich, A. Study and comparison results of the field oriented control for photovoltaic water pumping system applied on two cities in Morocco. *Bull. Electr. Eng. Inform.* **8**(4), 1–7. https://doi.org/10.11591/eei.v8i4.1301 (2019).

11. Kumari, R. & Dahiya, R. Speed control of solar water pumping with indirect vector control technique. In *Proc. 2nd Int. Conf. Inven. Syst. Control. ICISC 2018*, no. Icisc, 1401–1406. https://doi.org/10.1109/ICISC.2018.8399039 (2018).

12. Errouha, M., Derouich, A., Nahid-Mobarakeh, B., Motahhir, S. & El Ghzizal, A. Improvement control of photovoltaic based water pumping system without energy storage. *Sol. Energy* **190**, 319–328. https://doi.org/10.1016/j.solener.2019.08.024 (2019).

13. Chihi, A., Ben Azza, H., Jemli, M. & Sellami, A. Nonlinear integral sliding mode control design of photovoltaic pumping system: Real time implementation. *ISA Trans.* **70**, 475–485. https://doi.org/10.1016/j.isatra.2017.06.023 (2017).

14. El Ouanjli, N., Mohammed, T. & Derouich, A. High performance direct torque control of doubly fed induction motor using high performance direct torque control of doubly fed induction motor using fuzzy logic (2018).

15. Errouha, M. et al. Optimization and control of water pumping PV systems using fuzzy logic controller. *Energy Rep.* **5**, 853–865. https://doi.org/10.1016/j.egyr.2019.07.001 (2019).

16. Jonnala, R. B., Ch, S. B. & Dt, E. G. A modified multiband hysteresis controlled DTC of induction machine with 27-level asymmetrical CHB-MLI with NVC modulation. *Ain Shams Eng. J.* **9**(1), 15–29. https://doi.org/10.1016/j.asej.2015.08.007 (2018).

17. Ouledali, O., Meroufel, A., Wira, P. & Bentouba, S. Direct torque fuzzy control of PMSM based on SVM. *Energy Procedia* **74**, 1314–1322. https://doi.org/10.1016/j.egypro.2015.07.778 (2015).

18. Benamor, A., Benchouia, M. T., Srairi, K. & Benbouzid, M. E. H. A novel rooted tree optimization apply in the high order sliding mode control using super-twisting algorithm based on DTC scheme for DFIG. *Int. J. Electr. Power Energy Syst.* **108**, 293–302. https://doi.org/10.1016/j.ijepes.2019.01.009 (2019).

19. El Ouanjli, N. et al. Improved DTC strategy of doubly fed induction motor using fuzzy logic controller. *Energy Rep.* **5**, 271–279. https://doi.org/10.1016/j.egyr.2019.02.001 (2019).

20. Sutikno, T., Idris, N. R. N. & Jidin, A. A review of direct torque control of induction motors for sustainable reliability and energy efficient drives. *Renew. Sustain. Energy Rev.* **32**, 548–558. https://doi.org/10.1016/j.rser.2014.01.040 (2014).

21. Kumar, S. S. & Xavier, R. J. ANFIS based reference flux estimator with GA tuned controller for DTC of induction motor. In *2018 Natl. Power Eng. Conf.*, 1–2 (2018).

22. Errouha, M., Motahhir, S., Combe, Q. & Derouich, A. Intelligent control of induction motor for photovoltaic water pumping system. *SN Appl. Sci.* **3**(9). https://doi.org/10.1007/s42452-021-04757-4 (2021).

23. Mesloub, H., Benchouia, M. T., Boumaaraf, R., Becherif, M. Design and implementation of DTC based on AFLC and PSO of a PMSM (2018).

24. Ayrir, W., Ourahou, M., El Hassouni, B. & Haddi, A. *ScienceDirect* Direct torque control improvement of a variable speed DFIG based on a fuzzy inference system. *Math. Comput. Simul.* https://doi.org/10.1016/j.matcom.2018.05.014 (2018).

25. GDAIM, S. Commande directe de couple d'un moteur asynchrone à base de techniques intelligentes. Université de Monastir.

26. El Ouanjli, N., Derouich, A., El Ghzizal, A., Errouha, M. & Taoussi, M. "Direct Torque Control of Doubly Fed Induction Motor (DFIM)" 2ème Colloque franco-marocain sur les énergies renouvelables et leur intégration aux réseaux de transport et de distribution (COFMER'02), (Fez-April 2017).

27. Sergaki, E. S., Georgilakis, P. S., Kladas, A. G. & Stavrakakis, G. S. Fuzzy logic based online electromagnetic loss minimization of permanent magnet synchronous motor drives. In *Proc. 2008 Int. Conf. Electr. Mach. ICEM'08*, 1–7. https://doi.org/10.1109/ICELM ACH.2008.4800113 (2008).

28. Sreejeth, M., Singh, M. & Kumar, P. Particle swarm optimisation in efficiency improvement of vector controlled surface mounted permanent magnet synchronous motor drive. *IET Power Electron.* **8**(5), 760–769. https://doi.org/10.1049/iet-pel.2014.0399 (2015).

29. Hannan, M. A., Ali, J. A., Mohamed, A. & Hussain, A. Optimization techniques to enhance the performance of induction motor drives: A review. *Renew. Sustain. Energy Rev.* **81**, 1611–1626. https://doi.org/10.1016/j.rser.2017.05.240 (2018).

30. Motahhir, S., El Ghzizal, A., Sebti, S. & Derouich, A. MIL and SIL and PIL tests for MPPT algorithm. *Cogent Eng.* https://doi.org/10.1080/23311916.2017.1378475 (2017).

31. Nyeche, E. N. & Diemuodeke, E. O. Modelling and optimisation of a hybrid PV-wind turbine-pumped hydro storage energy system for mini-grid application in coastline communities. *J. Clean. Prod.* **250**, 119578. https://doi.org/10.1016/j.jclepro.2019.119578 (2020).

32. Dadfar, S., Samad, S. & Nakamura, H. Variable step size perturb and observe MPPT controller by applying θ-modified krill herd algorithm-sliding mode controller to increase accuracy in photovoltaic system. *J. Clean. Prod.* **271**, 122243. https://doi.org/10.1016/j.jclepro.2020.122243 (2020).

33. Errouha, M., Motahhir, S., Combe, Q. & Derouich, A. Parameters Extraction of Single Diode PV Model and Application in Solar Pumping. In *International Conference of Integrated Design and Production (CPI)*, Oct 14-16,2019- Fez, pp. 178–191. https://doi.org/10.1007/978-3-030-62199-5_16 (Morocco, 2021).

34. Motahhir, S., El Ghzizal, A., Sebti, S. & Derouich, A. Modeling of photovoltaic system with modified incremental conductance algorithm for fast changes of irradiance. *Int. J. Photoenergy* **18**, 13 (2018).

35. Yahyaoui, I. *Specifications of photovoltaic pumping systems sizing, fuzzy energy management specifications of photovoltaic pumping systems* (2016).
36. Rawat, R., Kaushik, S. C. & Lamba, R. A review on modeling, design methodology and size optimization of photovoltaic based water pumping, standalone and grid connected system. *Renew. Sustain. Energy Rev.* **57**, 1506–1519. https://doi.org/10.1016/j.rser.2015.12.228 (2016).

37. Motahhir, S. et al. Optimal energy harvesting from a multistrings PV generator based on artificial bee colony algorithm. *IEEE Syst. J.* https://doi.org/10.1109/jsyst.2020.2997744 (2020).

38. Karami, N., Moubayed, N. & Outbib, R. General review and classification of different MPPT Techniques. *Renew. Sustain. Energy Rev.* **68**, 1–18. https://doi.org/10.1016/j.rser.2016.09.132 (2017).

39. Motahhir, S., El Hammoumi, A. & El Ghzizal, A. The most used MPPT algorithms: Review and the suitable low-cost embedded board for each algorithm. *J. Clean. Prod.* **246**, 118983. https://doi.org/10.1016/j.jclepro.2019.118983 (2020).

40. Errouha, M., Motahhir, S., Combe, Q., Derouich, A. & El Ghzizal, A. Fuzzy-PI Controller for Photovoltaic Water Pumping Systems. In *7th International Renewable and Sustainable Energy Conference (IRSEC)*, Nov.27-30,2019- Agadir, pp. 0–5. https://doi.org/10.1109/IRSEC48032.2019.9078318 (Morocco, 2019).

41. Errouha, M., Derouich, A., El Ouanjli, N. & Motahhir, S. High-Performance Standalone Photovoltaic Water Pumping System Using Induction Motor. *Int. J. Photoenergy* **2020**, 1–13. https://doi.org/10.1155/2020/3872529 (2020).

42. Errouha, M., Motahhir, S. & Combe, Q. Twelve sectors DTC strategy of IM for PV water pumping system. *Materials Today: Proceedings* **51**, 2081–2090. https://doi.org/10.1016/j.matpr.2021.12.214 (2022).

## Acknowledgements

Research Supporting Project Number (RSP-2022/167), King Saud University, Riyadh, Saudi Arabia.

## Author contributions

M.E. proposed the new control strategies and implemented it. M.E., Q.C. and S.M. wrote the main manuscript text. M.E. and C.Q. prepared the figures. S.M., S.S.A. and M.A. supervised the work. All authors reviewed and approved the final manuscript.

## Funding

This Project is funded by King Saud University, Riyadh, Saudi Arabia.

## Competing interests

The authors declare no competing interests.

## Additional information

Correspondence and requests for materials should be addressed to M.E.

Reprints and permissions information is available at www.nature.com/reprints.

**Publisher's note** Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

<figure><img src="image_17.png" /></figure>

**Open Access** This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.

© The Author(s) 2022