FPGA Implementation of Sliding Mode Control for a Photovoltaic Pumping System
Fares Sassiα Hichem Othmaniσ, Dhafer Mezghaniρ & Abdelkader MamiѠ
This paper shows the efficiency of using a sliding mode control of a photovoltaic pumping system, which is strongly non-linear. It contains several non-linear sub-systems (photovoltaic generator, DC/AC converter, an asynchronous three phase motor-pump, centrifugal pumps and two coupled tanks). The mathematical model of the whole system was achieved after the modelling of the various parts constituting it. Furthermore, an FPGA implementation on the map Xilinx Spartan 3A was performed to prove the effectiveness of the proposed sliding mode control of the motor-pump angular speed.
Indexterms: FPGA, Frequency inverter, Motor-pump, SMC, Solar generator.
The photovoltaic solar energy is increasingly used in several applications because the photovoltaic generator has no moving parts and does not require fuels to be operated. Water pumping is considered one of the most important applications of the photovoltaic solar energy. The photovoltaic water pumping system generally consists of a photovoltaic generator coupled with a motor-pump unit through an AC/DC converter, as well as water tanks [1, 2]. Every process component is modelled by non-linear equations, which involves a non-linear complete model difficult to be controlled. For this reason, the system break down into sub-systems facilitates the control of the motor-pump speed and the water volume in the tanks. It needs using a robust controller in order to reach the desired performance (good accuracy, quick response, and stability). On the other hand, the laws of classical control approaches can be insufficient because they are not strong to control non-linear systems or having not constant parameters. In this context, we have to use a control law that is insensible to the variations of parameters and disturbances, as well as suitable for the system no linearities.
The sliding mode control is one of control techniques that use controllers with variable structure. It means that these techniques switch between several different control laws. The significance of the sliding mode control is the good accuracy, the quick dynamic response, the stability, the simplicity of the design and implementation, as well as the robustness via the variation of internal and external system parameters .
On the other hand, the use of hardware solutions, such as FPGA circuits allows finding some analog performance while keeping the advantages of the digital solutions. Moreover, these solutions allow satisfying the new requirements of the advanced control. Indeed, besides the improvement of the control performance through reducing the calculation time, the parallel processing of the hardware solutions allows integrating several algorithms on only one target, which can be executed independently from each other and ensures various features [5, 6].
This paper is presented as follows: In section II, the model of the controlled process is depicted. To verify the proposed approach, different numerical and experimental results are presented in Section III and Section VI.
- PROCESS DESCRIPTION AND CONTROL
The studied system is composed by a photovoltaic generator (Fig.1) which feeds an induction motor pump through a frequency converter (Fig.2). The water is pumped from the left tank to the right tank. The frequency converter is responsible of the pump’s speed and consequently the flow of water.
Fig. 1: Photovoltaic field
Fig. 2: System components
In dynamic regime, the induction motor can be modeled by the following equations :
In result, the electromagnetic torque will be computed using (2).
Cem = np (iqs Φdr – ids Φqr)
The hydraulic network is described by:
The coefficients b0, b1 and b2 are based on the internal geometry of the pump and independent of the rotation speed. It can be determined experimentally by meeting three points of the Hpump characteristic = f (Q) given by the manufacturer.
The centrifugal pump has a characteristic of the resistant torque Cr proportional to the square of its rotational speed Ωm according to the aerodynamic equation (4) :
The mechanical losses applied to the shaft of the pump are represented by Cfv. It is described by the following expression in which C1 is the viscous friction coefficient.
The couples presented above are added to the acceleration torque J.dΩ m / dt, where J is the total inertia of the mechanical system and t is the time. Thus, the electromagnetic torque is described by the following expression:
The term of the height of the hydraulic system is given by:
Therefore, the similitude law between the flow Q and the speed Ωm will be given by:
The efficiency of the pump is defined by:
Where, C2 is the constant torque of the pump, ρ is the density and g is the gravity.
The characteristics of the motor-pump are summarized in Table I.
Table 1: Specifications of Ebara Induction Motor-pump
Nominal output power (W)
Nominal electrical power(W)
Max Flow Rate (l/min)
Max head (m)
Rotoric resistor (Ω)
Rotoric self (H)
3.2 Photovoltaic generator
The photovoltaic generator can be modelled by the following equation [3, 7]:
With k1 and k2 are expressed in (11).
The simulation of this model gives us the results shown in Fig.3 and Fig.4. From these results, the nonlinear nature of the PV array is apparent.
Fig. 3: Variation of the current-voltage and power-voltage characteristics according to the ambient temperature Ta
Fig. 4: Variation of the current-voltage and power-voltage characteristics according to the solar irradiance Ec
The PV array is fixed to a metal stand and placed on the roof of the Department of Physics in the Faculty of Sciences of Tunis and tilted 35 degrees from the horizontal report.
In this work, the PV array used consists of four photovoltaic panels type KANEKA K60 (Fig. 1) and provides a maximum power of 240 W. Its parameters are given in Table II.
Table 2: parameters of the Photovoltaic Panel Kaneka Gsa60
3.3 Frequency inverter DV51
The DV51 frequency inverters convert the voltage and frequency of a three-phase supply to a DC voltage. Then, it uses it to generate a three-phase supply with adjustable voltage and frequency. This variable three-phase supply allows step less variability of three-phase asynchronous motors.
The DV51 frequency inverters are electrical apparatus for controlling a variable speed driven with three-phase motors. They are designed for installation in machines or for use in combination with other components within a machine or system.
3.4 Control system
The Constant Voltage-MPPT is easy to implement and is the least expensive for the photovoltaic systems. Several studies showed that the ratio between the optimal voltage and that in open circuit is approximately constant. This is performed using (12).
The investigations [10, 11] indicated that the constant KCV varies between 70 and 85 %. The solar panel is temporarily isolated from the MPPT in order to measure the value of Voc. Then, The MPPT corrects the operating point using the Equation (12). This operation is repeated to update the position of the operating point.
According to the measurements on the climatic conditions (Ec, Ta), we estimate the value Voc.
- Determination of the sliding mode control law:
Substituting equation f into the Voc equation, we obtain:
The control law is defined in (15).
The objective is that Vpv reaches Vmpp and the relative error e is written in (16).
Considering the function :
We consider the Lypnov function given by (18).
The attractiveness condition is written in (19).
We should choose:
Fig.5 illustrates the proposed configuration by the application of the constant V/f scalar control.
Fig. 5: Architecture of the Sliding Mode Control
- SIMULATION RESULTS
The simulation results of the pumping system were carried out according to the variation of the PV panel parameters (temperature and irradiance). In fact, the Matlab/Simulink model was simulated under the following climatic conditions: We fixed the ambient temperature value at 25°C and we vary the irradiance value Ec to 1000, 750 and 500 W/m2, respectively. The quantities simulated are:
- The motor-pump speed.
- The power of the solar module array.
Fig. 6: Architecture of Matlab/Simulink
Fig. 7: Motor-pump speed
Fig. 8: Power of the solar module array
Fig.9 and Fig.10 presented the simulation results of the motor-pump speed for different ambient temperature values Ta (15, 25 and 35°C). However, the irradiance value Ec is fixed at 1000 W/m2.
Fig. 9: Motor-pump speed
Fig. 10: Motor-pump speed (enlarged curves)
For the same climatic conditions aforementioned, the power variation of the solar module array according to the ambient temperature is illustrated by Fig.11 and Fig. 12.
Fig. 11: Power variation of the solar module array
Fig. 12: Power variation of the solar module array
The simulation results showed that the pumping system (Motor-pump speed) is especially influenced by the irradiance value than the ambient temperature. This latter has a very little influence on the system.
On the other hand, the simulation results using the ISE simulator are shown in Fig.13.
Fig. 13: Simulation of sliding mode control system using ISE simulator
The clock frequency is fixed at 50 MHz (20ns), which is equal to the clock frequency of the XC3S700A Starter Kit.
Related to the simulation results, we note that we have a high voltage at great irradiance (E = 1000 W/m2).
V. EXPERIMENTAL MEASUREMENTS AND RESULTS
Fig.14 and Fig.15 presents the controlled pumping system using the FPGA Spartan 3A board under the climatic conditions (irradiance and ambient temperature).
Fig. 14: Control of the photovoltaic pumping system
Fig. 15: Irradiation and temperature sensors connection to FPGA
In the experimental validation, we used the integrated LTC2624 interface in the FPGA Spartan 3A board. It allows the Digital / Analog conversion (DAC) according to the following finite-state machine .
Fig. 16: Finite-state machine of the DAC VHDL program
On the other hand, Fig.17 shows the internal block diagram of the integrated analog circuit. It includes two programmable gain amplifiers (6912 LTC) and two ADC (Analog to Digital converter LTC1407-A) controlled by the FPGA through the SPI interface.
The two circuits are powered by the Vcc voltage (3.3V). The voltage reference is set by default to 1.65V and obtained by applying a voltage divider to Vcc .
Fig. 17: Detailed view of the analog capture Circuit
The digital output value is represented in 14 bits and calculated in (23).
The gain is the current setting loaded in the programmable controller. A gain of -1 was chosen primarily because it offered the widest range of input voltage (Table III).
Table 3: Programmable Gain Settings for Pre-amplifier
Range of Input Voltage
Fig.18 shows the SPI interface, which ensures the communication between the FPGA and the amplifier. The gain of each amplifier is sent as an eight-bit control word, consisting of two four-bit fields. The most significant bit (B3) is sent first.
Fig. 18: SPI Serial Interface to programming the amplifier
The Analog to Digital conversion in the ADC is done according to the following timing :
Fig. 19: Analog-to-Digital Conversion Interface
The following chart shows the steps of the VHDL code:
Fig. 20: Process Flow chart of the Implemented Algorithm
Fig. 21: Flowchart of the ADC and how to control the on-LCD screen display
The flowchart presented in Fig.21 resumes the three VHDL files that allow the Analog to Digital conversion and the display of the converted value on the LCD screen:
Picoblaze_amp_adc_control.vhd: It is the VHDL code that allows the Analog to Digital conversion through the SPI and the display of the converted value on the LCD screen. It also contains the components kcpsm3and adc_ctrl:
- kcpsm3.vhd: It is an eight-bit microcontroller designed for Spartan-3A circuit.
- adc_ctrl.vhd: It is the PicoBlaze program assembly (stored in memory).
After the execution of the synthesis process, the RTL pattern of the proposed control architecture (ADC+SMC+DAC) is illustrated by Fig. 22 [14, 15].
Fig. 22: RTL pattern of the proposed control
The source files provided for the reference design are:
- Top.vhd: It is the main VHDL code, which contains all the proposed control components (ADC+SMC+DAC).
- Dac.vhd: It is the VHDL code, which ensures the Analog to Digital conversion (see Figure 18).
- picoblaze_amp_adc_control.vhd: It is the VHDL code that allows the Analog to Digital conversion through the SPI and the display of the converted value on the LCD screen. It also contains the components kcpsm3 and adc_ctrl.
- kcpsm3.vhd: It is an eight-bit microcontroller designed for Spartan-3A circuit.
- adc_ctrl.vhd: It is the PicoBlaze program assembly.
- SMC.vhd: It is the VHDL code, which allows computing the optimal frequency according to the values of the irradiance and the temperature using concurrently instructions. The type of signals and ports are signed and unsigned and std_logic_vector, respectively.
- Top.ucf: It is the input/output constraint file for the Spartan-3A Starter Kit.
The clock frequency is fixed at 50 MHz.
The values of the irradiance and the temperature were respectively measured by the sensors (photo resistance and LM35). They vary according to the climatic conditions that change permanently during the year.
The following figures show the experimental results carried out on 22/10/2016 from the morning (10:00 H) to the end of the day (16:00 H). LM35 and LDR sensors are used for this purpose, in addition of the solar module array voltage and the inverter frequency. This latter corresponds to the motor-pump speed and the water debit.
Fig. 23: Temperature and irradiance measurements
Fig. 24: DV51 frequency and frequency of the sliding mode control measurements
Fig. 25: Voltage measurement of the solar module array
Fig. 26: Measurements of the motor-pump speed and the water debit
Every measurement of the temperature and the irradiation corresponds to a frequency displayed by the frequency converter DV51 in order to operate the motor-pump of our process.
The desired values are Ec = 1000 W/m2 and Ta = 25 °C. They correspond to a frequency value equal to 50 Hz, for which the motor-pump speed is maximum and then the rate of the water transfer from the first tank to the second one is also maximum.
The voltage delivered by the FPGA Spartan 3A board varies between 0 and 3.3 V. However, the voltage range of the frequency converter DV51 is [0V-5V]. Therefore, the range of voltage delivered by the FPGA Spartan 3A board must be equal to [0V-5V]. For that purpose, a bi-directional voltage converter (Fig. 27) is used in order to reach the maximum DV51 converter frequency according to the climatic conditions.
Fig. 27: Bi-directional voltage converter
The result of the Analog to Digital conversion is displayed on the LCD screen of the FPGA Spartan 3A board (Fig. 28). It shows the numerical value converted in hexadecimal and the amplifier gain (-1) that ensures the widest range of the input voltage VA.
We can also read the values of temperature and irradiance sensors and then implementing the proposed control strategy.
Fig. 28: Results of the FPGA Implementation
Fig.29 shows the frequency value obtained by the frequency converter DV51. It depends on the variation of the irradiance and the temperature of the photovoltaic panel. The implementation of the proposed control algorithm on the FPGA Spartan 3A board allowed controlling the motor-pump speed and then transferring the water from the first tank to the second one.
Fig. 29: Control of the motor-pump speed using the FPGA Spartan 3A board
We are noticed that the motor-pump speed reached its maximum value when the irradiance is maximum. Likewise, a low irradiance allows a low speed. The FPGA circuit is responsible for finding the suitable frequency according to the instantaneous irradiance. This frequency will be the reference in the scalar control implemented on the DV51, which powers the motor-pump. Hence, we have carried out a real-time control according to the climatic conditions.
- In this paper, we have presented the VHDL design of the proposed control method (ADC+SMC+DAC). This method includes the sliding mode approach to control the speed of a motor-pump. It is coupled to a photovoltaic panel through a DV51 inverter that is adjusted by a map XC3S700A FPGA-based to operate a water transfer between two tanks. The experimental results carried out under different climatic conditions (ambient temperature and irradiance) showed the effectiveness of the proposed method at the level of the speed control of the motor-pump.
- M. Ellouze, R. Gamoudi, and A. Mami, “Sliding Mode Application in Speed Control of an Induction Machine Coupled in a Hydraulic System”, Journal of Engineering and Technology Research, vol. 4, pp. 71–81, 2012.
- F.Adamo, F. Attivissimo, A. Di Nisio, and M. Spadavecchia, “Characterization and Testing of a Tool for Photovoltaic Panel Modeling”, IEEE Trans. Instrum. Meas,vol. 60, pp.1613–1622, 2011.
- D.Mezghani, H.Othmani and F.Sassi, A.Mami. Frequency Scheduling in a Scalar Control of Induction Motor Pump for Photovoltaic Pumping System: Implementation and Measurement, International Journal of Applied Engineering Research ISSN 0973-4562 Volume 11, Number 22 (2016) pp. 10928-10938.
- V. IUtkin, Sliding Mode and their Application in Sliding Mode Systems, Edition MIR, Moscou, Russia, 1978.
- B. J. Parvat, V. K. Jadhav, and N. N. Lokhande, “Design and Implementation of Sliding Mode Controller for Level Control”, IOSR Journal of Electronics and Communication Engineering (IOSR-JECE), pp. 51–54.
- E. Monmasson and Y. A. Chapuis, “Contributions of FPGAs to the Control of Electrical System, A Review”, IEEE Trans. Ind. Electron. Society Newsletter, vol. 49, pp.8–15, 2002.
- Othmani H, Mzghanni D, Belaid A, Mami A. “New Approach of incremental Inductance Algorithm for maximum Power Point Tracking Based on Fuzzy Logic”. International Journal of Grid and Distributed Computing Vol. 9, No. 7 (2016), pp.121-132.
- Betka A, Moussi A, Performance optimization of a photovoltaic induction motor pumping system, Renewable Energy, vol 29,pp 2167–2181, 2004.
- B. Khajeh-Shalaly and G. Shahgholian, “A Multi-Slope Sliding-Mode Control Approach for Single-Phase Inverters under Different Loads”, Electronics, vol. 5, 2016, DOI:10.3390/ electronics5040068.
- Anderson.M and B.Alvesten, 200 W low cost module integrated utility interface for modular photovoltaic energy systems. 21st International Conference on Industrial Electronics, Control and instrumentation, 1995. 1(1): p. 572-577.
- Van der Merwe, Maximum power point tracking-Implementation strategies. IEEE International Symposium on Industrial Electronics, 1998. 1(1): p. 214-217.
- Spartan-3A/3AN FPGA Starter Kit Board User Guide, Xilinx, 2008.
- A. Tisserand and A. Inria Lip, Course, “Introduction aux Circuits FPGA”, LIP ENS Lyon Laboratory, 2003.
- S. Kilts, “Advanced FPGA Design Architecture, Implementation and optimization”, Spectrum Design Solutions, Minneapolis, Minnesota, 2007.
- S. Renaud, P. Nouel, and L. Bossuet, “Conception des Circuits Numériques Language VHDL pour la Synthèse et la Modélisation”, course at ENSEIRB MATMECA Bordeaux, 201.
Stator current (d-axis)
Open circuit voltage of the solar module array
Stator current (q-axis)
Current of the solar module array
Rotor current (d-axis)
Reference illumination 1000 W/m2
Rotor current (q-axis)
Stator voltage (d-axis)
Voltage of the solar module array
Stator voltage (q-axis)
No-load PV current
Rotor magnetic flow (d-axis)
Motor pump speed
Rotor magnetic flow (q-axis)
Optimum voltage PV
Rotor magnetic flow (d-axis)
Optimum current PV
Rotor magnetic flow (q-axis)
Maximum power point voltage of the PV array
Coefficients de la pompe
Frequency of the inverter
Coefficient de température du courant PV
Cyclic mutual inductance
Number of pole pairs
Cyclic rotor inductance
Temperature of Junction
Temperature coefficient of PV voltage