Next Article in Journal
Revealing Renewable Energy Perspectives via the Analysis of the Wholesale Electricity Market
Next Article in Special Issue
Dynamic Energy Management for Perpetual Operation of Energy Harvesting Wireless Sensor Node Using Fuzzy Q-Learning
Previous Article in Journal
Energy Analysis of an Industrial Nozzle with Variable Outlet Conditions during Compressible and Transient Airflow
Previous Article in Special Issue
Benefits of Low Electron-Affinity Material as the N-Type Layer for Cu(In,Ga)S2 Solar Cell
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Raspberry Pi Design and Hardware Implementation of Fuzzy-PI Controller for Three-Phase Grid-Connected Inverter

1
Electrical Engineering Department, Faculty of Engineering, Badr University in Cairo (BUC), Cairo 11829, Egypt
2
Electronics and Communications Department, Faculty of Engineering, Ain Shams University, Cairo 11517, Egypt
3
Computers and Systems Department, Electronics Research Institute, Cairo 12622, Egypt
*
Author to whom correspondence should be addressed.
Energies 2022, 15(3), 843; https://doi.org/10.3390/en15030843
Submission received: 21 November 2021 / Revised: 1 January 2022 / Accepted: 7 January 2022 / Published: 24 January 2022
(This article belongs to the Special Issue Analysis and Numerical Modeling in Solar Photovoltaic Systems)

Abstract

:
A photovoltaic system is one of the major sources of renewable energy. The grid-connected inverter controllers play an important role in the conversion and transmission of solar energy. Therefore, they must be improved to meet the demands for grid interconnection. This article introduces the design and hardware implementation of the intelligent fuzzy-PI controller of the inverter part of the grid-connected photovoltaic system. First, the paper discusses the design of the three-phase grid-connected fuzzy-PI controller. Next, the paper describes the implementation of a Matlab graphical user interface (GUI) to design any grid-connected inverter and size the photovoltaic systems. The code generation of the fuzzy-PI controller of the system is accomplished by using Matlab Simulink simulation software. The hardware components of the PV system are implemented experimentally. In the hardware implementation, a 70 W prototype is realized to test the functionality of the controller, such that one can develop a realistic controller without taking risks or falling into security concerns in the case of performing experiments on high-power systems. The prototype proves that the controller model can be directly transformed from Simulink to the control device. It also shows that the fuzzy-PI controller is working properly in the 70-watt prototype. The achieved performance parameters of the proposed fuzzy-PI controller are satisfactory. The proposed method to design and implement the fuzzy-PI controller does not require complicated programming, where a Matlab coder is proposed to transform the Simulink controller into C code that can be directly utilized as a software control program loaded in the microcontrollers embedded in the hardware of the controller. The main result is that the fuzzy-PI controller for the three-phase grid-connected systems can be implemented using low-cost reconfigurable microcontrollers.

1. Introduction

Solar energy is one of the major sources of renewable energy. This fact means that converting it into electricity is a very important research topic. A photovoltaic system can be defined as a system used for the transformation of solar energy into electrical energy. High cost and low efficiency are among the defects of photovoltaic systems. This event motivates scientists to investigate how to maximize the efficiency of renewable energy resources. Considerable attention is given to photovoltaic (PV) power generation systems as one of the most promising energy generation systems that can alternate with fossil fuel power generation [1]. The PV industry has expanded rapidly in the last 20 years [2]. It can also be seen that the installation of photovoltaic technology is increasing by 20–25% annually, mainly due to cost reduction. The cost reduction is driven by the improvement of solar cell efficiency, the improvement of production technology, and the development of economies of scale.
An inverter is required to transform the DC electricity coming from a photovoltaic generator into AC electricity [3,4]. One of the most important electronic components of a grid-connected PV inverter is the DC/AC inverter controller [5]. Therefore, it received intensive research to optimize its performance. There are different types for the regulation of the controlling action of the controller. The conventional methods are based on proportional integral differential methods PID.
A PI controller is proposed as a solution for three-phase grid-connected inverter control. The proposed solution is simulated using PSIM and implemented in hardware to validate the results [6]. A detailed description of the hardware implementation of the PI controller is presented in [7]. The hardware uses a dsPIC microcontroller to control the inverter and produce a voltage that is synchronized with the grid voltage. The purpose of that research is to show a practical implementation of a control system for a grid-connected inverter (GCI) by using a dsPIC microcontroller. It is found that the conventional PI controllers are relatively slow and have more steady-state errors and more ripples compared to the fuzzy controllers [7].
In [8], a fuzzy controller, which is based on a special choice of a combination of inputs and outputs, is used. The selection of input and output, as well as fuzzy rules, is based on the principle of mathematical analysis of the derived function (slope) in order to find the best value. It can also be observed that by employing only three sets of linguistic variables to deconstruct the membership functions of the fuzzy controller’s inputs and outputs, the best results and answers from the photovoltaic system may be achieved [8]. The fuzzy controllers can be also used for the maximum power point tracking in DC/DC converters of the PV generators. However, in partial shading, classical fuzzy MPPT fails to obtain the global maxima. [9]. In order to overcome the FLC problem under shading conditions [9], FLC is based on dynamic safety margin (DSM), similar to the MPPT algorithm of photovoltaic systems. The simulation results show that the proposed MPPT algorithm can detect the peak value at the global maximum point and manage the photovoltaic system. A two-fuzzy logic controller scheme [10] is proposed to control the DC/DC converter and the inverter in a three-phase grid-connected inverter. The proposed scheme improves the power quality of the system. However, the research article presents a simulation study only.
The control strategy of the photovoltaic (PV) system in [11] utilized a single-phase grid-connected inverter with low voltage ride-through (LVRT) capability which is controlled by a fuzzy logic controller. In reference [12], a DC–DC boost converter is used to boost the DC voltage generated by a solar cell with an output voltage of 18 volts. In order to obtain good transient and steady-state performance, a typical 54 V fuzzy controller is suitable for DC–DC converters, and 24 V is suitable for DC–AC converters. They found that the created controller provided fast response and good performance. [12].
In addition, a fuzzy logic controller for a three-phase grid-connected inverter has been designed and implemented in hardware [13]. The fuzzy controller (FLC) was tested using a 260-watt photovoltaic system. Their results show that the FLC performs better with the PI controller [13].
A fuzzy controller for controlling a grid inverter for 22 KV distribution systems was proposed. The experimental results showed that the intelligent controller increased the stability of the output voltage [14].
In [15], smart fuzzy was proposed to provide active and reactive power control for efficient low-voltage ride-through (LVRT) capabilities during grid faults. The logic proposed by fuzzy is based on an improved reactive and active power control strategy by injecting reactive current to stabilize the grid voltage. In addition to the fuzzy strategy of inverter control, the algorithm of a 1 kW solar photovoltaic grid-connected system was verified in real time on the hardware.
A research paper [16] described an optimized fuzzy controller for grid-connected photovoltaic systems. The proposed controller is optimized using a nature-inspired optimization algorithm called LSA. In order to demonstrate the functioning of the proposed algorithm, a hardware prototype was realized [16].
Ngoc-Tung Nguyen et al. [17] introduced a fuzzy-PI controller to control a grid-connected inverter where they tuned the PI by fuzzy logic for various advantages such as being less expensive, covering a larger variety of operating circumstances, and improving the quality factor. Despite disturbances of the load and variations of input, the gain of the PI controller is tuned by the fuzzy algorithm [17].
Regarding regulation of the inverter with a simplified fuzzy-PI controller (SFPIC) [18], a linear control surface proposes a single input of fuzzy controller with its fuzzification and defuzzification processes. The proposed controller was shown to produce a comparable performance to its standard fuzzy-PI controller but with a significant reduction in computational time. A hardware implementation was realized to compare the simplified fuzzy-PI performance controller and the traditional fuzzy-PI controller [18].
An interactive grid-connected inverter controlled by fuzzy-PI was developed and deployed [19]. The PI controller’s proportionate and complete gains were determined according to the system operating point by the FLC. A self-adapting PI controller was realized, which can adapt to the fast transient response due to different operating conditions such as grid disturbances and natural influences. Both simulation and experimental results show that the system proposed has rapid dynamic responses with low overshoot and short adjustment times. The proposed inverter system was also compared to the conventional PI-controlled system [19]. In a previous work [20], a comparison between different controllers was worked out. It showed the superior performance of the fuzzy-PI controller. This motivated the researchers to develop a fuzzy-PI controller for their PV system [20].
The main objective of this work is to introduce the design and hardware implementation of an intelligent controller (fuzzy-PI) for grid-connected photovoltaic generators in an average household. In terms of hardware implementation, the researchers used a 70 W prototype to test the controller for the sake of safety and cost issues. The proposed methodology does not need complex programming, as a Matlab control code is transformed to a C-control code for operating the electronic hardware design of the controller. Finally, the hardware setup is developed for verifying the simulation model of the system realized in Matlab.
The paper is organized as follows: Section 2 describes the Simulink components of the PV system in detail. Section 3 provides Simulink results. Section 4 provides a GUI for system design and sizing for all components of the system modules. Section 5 introduces a design and hardware implementation of an intelligent controller (fuzzy-PI) for the inverter part of a grid-connected PV system, code generation, and experimental results. In the hardware implementation, the researcher works with a 70 W prototype to test the controller. Section 6 provides a conclusion and future work.

2. Complete Descriptions of the Simulink Components of PV System

This section presents a full description of the Matlab Simulink system that is built to test the fuzzy-PI controller. Figure 1 shows the complete Simulink model for the system. On the left, there is a DC voltage source along with two decoupling capacitors. The idea is to model the effect of a PV panel source along with a converter. An exact model is not needed for the PV panel because the researcher concentrates on the inverter controller part. The output of the DC voltage along with decoupling capacitors goes through a two-level bridge inverter. The control signal of the two-level bridge inverter comes from the fuzzy-PI controller. The three-phase output of the inverter is input to the measurement block and then input to the LC filter. The LC filter is responsible for eliminating the disturbance from the three-phase signals. The LC filter output is connected to an AC load that has two options (high load and low load). On the other side, there are the grid and the measurement and display blocks.

2.1. Input Voltage

The basic components of the Simulink model consist of the following:
  • There is a use of a simplified I–V curve model introduced in other papers [21].
  • In this Simulink model, the researcher is concerned with the inverter controller. The researcher uses the value of the voltage at the MPPT generated by the boost converter.
  • There is a model of a PV array and a boost converter with a single voltage source parallel with two series capacitors.
  • The paper [21] shows that the voltage source model approximates the real photovoltaic panel operation.

2.2. Fuzzy-PI Controller

The controller of the inverter consists of a current regulator and a voltage regulator. The internal components of the current regulator are discussed here.
The researchers suggest that the algorithm illustrated in Figure 2 is a fuzzy-PI controller. Figure 2 shows the fuzzy-PI controller. First, the Id direct and Iq quadrature currents are subtracted from the Id and Iq reference values to obtain the error. The logic blocks of the fuzzy control the error. The Vd and Vq signals are then added to the controlled signals, which create the control signal to the Vd and Vq direct and quadrature voltages on the complete system. The input of the fuzzy logic is the calculated error that is used to obtain the gains of the PI controller.
On an FLC that is adjusted to the input data is the nonlinear mapping of the output scalar data. FLC consists of three phases: fuzzification, the rules table, and defuzzification [22]. In most nonlinear applications, the conventional controller does not work well. Therefore, the fuzzy logic control (FLC) was an efficient nonlinear application solution.
Fuzzification is the process that is used to convert the input crisp values into the fuzzy variable values by using input gains and normalized membership functions. Defuzzification is the process that is used to convert the fuzzy variable values into crisp values by using output gains and normalized membership functions.
Two blocks of fuzzy logic are used: one for voltage control and the other for current control. The fuzzy controller design consists of the design of the membership functions and the design of the rules table. By using the Matlab Fuzzy Toolbox, the researcher can build the FLC [20].
Each fuzzy element in Figure 3 and Figure 4 is the meaning of each language connected to five uniform membership functions. Fuzzy logic control is used for tracking currents (Id and Iq), while a phase-locked loop (PLL) is used for park transformation synchronization (ABC-DQ) [22,23].
The block of fuzzy logic has two inputs, the change of error (ΔΔe) and the error (Δe) that generates the PI controller gains, which are defined as integral gain (Ki) and proportional gain (Kp). In accordance with variations in the temperature and the irradiance, the proposed fuzzy-PI controller varies gain values (Ki and Kp). The (Ki and Kp) values are multiplied by the error before being passed to the discrete-time integrator and zero-order hold. The membership functions of direct and quadrature Id and Iq output currents for fuzzy inverter control with Ki gain between 14.5 to 15.5 and Kp gain between 2.5 to 3.5 are illustrated in Figure 5 and Figure 6, where a rule table is used to minimize the current error and the transient response to perform FLC [24].

2.3. Inverter

  • The two-level bridge is connected to a DC power supply.
  • The bridge output is connected to the three-phase LC filter.
  • Use a three-phase measurement block after the three-phase LC filter.
For three-phase voltage and current calculations, a measuring tool is used, as shown in Figure 1.
Review of inverters in photovoltaic applications [25]:
Inverters are required to tie PV generators to the utility grid. They convert the DC power generated by PV to AC power used by the grid. Electricity is kept at a constant voltage in only one direction for DC power, and passive filters are usually employed to filter out harmonics generated from the inverter switching, yielding almost a clean voltage with a reduced harmonic distortion, which can be fed into the power grid.
The general-principle diagram of the three-phase inverter and its operating instructions [26]:
Figure 7 shows three identical half-bridge converters that make up the three-phase, two-level inverter. The DC sides of the three half-bridge converters are connected in parallel to a single DC-side voltage source. Each half-bridge converter has one phase of a three-phase (A, B, and C) AC system wired to its AC-side terminal. The alternating current system could be passive, such as an RLC load, or active, such as a synchronous machine (electrical power grid).

2.4. Three-Phase Loads

In the simulation model, the RLC module is used to model the three-phase load.
The RLC branch is a block with a resistance value (R) related to (active power) and a capacitor (C) and coil (L) related to reactive power. RLC is a Matlab Simulink block of the RLC branch with active load power P = 70 W and reactive load power = 0.

2.5. Total Harmonic Distortion

Total harmonic distortion (THD) is a measure of how a signal (voltage or current) is distorted by the harmonics in the signal.
  • The main measurement results obtained from Simulink prove that the fuzzy-PI controller works in theory, and then the experimental result is total harmonic distortion.
  • Simulink uses the THD block to measure the total harmonic distortion of the inverter output signal.

3. Simulink Results

Figure 8 shows that one phase of the grid voltage is in phase with the inverter current, so P.F. = 1.
This kind of simulation is called low load simulation. It means that the grid and inverter both feed the load, and this event is the cause of having an inverter current and three-phase current separately, as shown in Figure 9.
Figure 10 shows the synchronization between inverter voltage and the grid voltage for the fuzzy-PI controller of low load. Consequently, Figure 10 shows that both are synchronized together, which means that the controller is working fine in the simulation phase.
The AC output inverter, grid, and low load power for low-load fuzzy-PI controller are shown in Figure 11. The PV power is feeding load power and the remaining power is injected into the load. The result of the calculation of the overshoot = 5.94%, settling time(s) = 0.121, peak time(s) = 0.076, and average THD of inverter current = 0.744% are shown in Table 1.
This work achieves a lower THD for the fuzzy-PI controllers than [16,27,28] are shown in Table 2.

4. GUI for System Design and Sizing for All Components of the System Modules

Matlab GUI is used for the sizing of a complete PV system (sizing of PV array, sizing of the boost converter and sizing of the inverter), shown in Figure 12.
For example, load power = 9200   W.

4.1. Sizing for Inverter

This work uses a two-level bridge inverter that has two switches off in one branch.
The inverter output three-phase voltage = 240 V.
Max. power flow in the inverter = 9200 W and DC-link voltage = 700 V; Therefore,
Switches   rating   voltage = 700 2 = 350   V
IGBT   switch   rating   current = 9200 700 = 13.1   A

4.2. Sizing for Boost Converter

Output average voltage (Vo) = 700 V, duty cycle = 0.5 , thus the gain = 2 .
Input   average   voltage   ( Vs ) = 700 2 = 350   V
Ripple current of the inductor IL = 2.4 A.
Capacitor peak-to-peak ripple voltage is Vc = 0.52 V.
The   load   power : P = 3   X   output   of   3 phase voltage   X   load   current   I   X   cos α
Therefore,
load   current   I = x = 9200 3 X 240 X 0.9 =   9200 3 X 240 X 0.9 = 14.1   A
The   output   current   of   boost   converter = I × 1.5 = 21.29   A
Switching frequency = 5000 Hz.
Efficiency = Efficiency   of   the   inverter * Efficiency   of   the   Boost converter   = 0.94 × 0.94 = 0.88
Therefore, the output power of the boost converter = Max. power flow in the
Inverter / Efficiency   of   the   inverter =   9200 0.94 = 9780   W
Input   power   for   Boost   converter = 9200 0.88 = 10454   W
Inductor   value =   input   average   voltage   *   duty   cycle   ripple   current * switching   frequency = 0.014   H
Capacitor   value =   output   average   current   *   duty   cycle   ripple   voltage * switching   frequency = 0.004   F

4.3. Sizing for PV Array

The module type is “SunPower SPR-305E-WHT-D” at standard irradiation = 1000 W/m2. The output voltage of the characteristics of one module at MPPT = 54.7 V, and the output current of each module at MPPT = 5.58 A as shown in Table 3.
Therefore,
No .   of   series   modules = Vs .   /   ( output   voltage   of   the   characteristics   of   one   module ) = x = 350 54.7 = 6.3 7   modules
Total   current   of   all   modules = Input   power   for   Boost   converter Input   voltage   of   boost   converter   = 10454 350 = 29.87   A
No .   of   parallel   modules   =   Total   current   of   all   modules   /   Output   of   each module = 30 5.58 = 5.3 6   modules
Total   no .   of   modules =   no .   of   series   modules   X   no .   of   parallel   modules   = 7   ×   6 = 42   modules

5. Hardware Implementation of Fuzzy-PI Controller for Grid-Connected Inverter, Code Generation, and Experimental Results

In this hardware experiment, a Matlab coder is used to convert the controller Simulink code into C code for use with the controller. It is necessary to write a general code that combines the controller generated from Simulink with the other hardware components. The complete block diagram of the controller blocks is shown in Figure 13.
In the hardware, a Raspberry Pi processor (microcomputer) executes the algorithm. An Arduino controller is used to read the signals from the voltage sensing circuit and generate a duty cycle signal for the pulse width modulation block (PWM) inside the Arduino controller. The communication protocol between the Raspberry Pi and the controller is I2C, as shown in Figure 14.
In this section, there is a description of the hardware components of the setup used to implement the three-phase grid-connected fuzzy-PI inverter controller, as shown in Figure 15.

5.1. Sensing Circuits

The sensing circuits setup consists of a voltage-sensing circuit and a current-sensing circuit.

5.1.1. Voltage Sensing Circuit

The first step in the hardware experiment is to sense the grid voltage to synchronize inverter output with the grid. This synchronization is performed inside the controller. A use of single-supply op-amps is provided; this circuit generates a full-wave rectifier, as shown in Figure 16. Therefore, the first step is using a transformer to transform the input grid voltage to a legible form by the controller, as shown in Figure 17. The sensor-integrated circuit is LM358 (dual, 30 V, 700 kHz operational amplifier) [29]. Figure 18 shows rectified signal sensed from the grid (input).
The output of the full-wave rectifier in Figure 16.

5.1.2. Current Sensing Circuit

  • In the hardware experiment, three current sensors are used to sense the current.
  • The sensor circuit is an HW-872 card with an ACS712 integrated circuit installed [30].

5.2. Controller

A Raspberry Pi controller is used to set the controlling blocks. This idea is to take advantage of the high processing power of the microcomputer. An Arduino controller is used because it has a built-in analog to digital converter (ADC) and PWM circuits. A communication protocol is used to connect a Raspberry Pi and an Arduino in order to transform the data read by the ADC in the Arduino to the Raspberry Pi controller; the C code for the fuzzy-PI controller downloaded on the Raspberry Pi, then, evaluates the duty for controlling the inverter switches. This duty cycle is transformed to the Arduino controller by the communication protocol between the microcontroller and a Raspberry Pi. The communication delay time in the communication between Arduino and Raspberry Pi = 100 µs. Figure 19 shows the output of the controller. It can be seen that the duty cycle of the produced pulse width modulation signal is changing with time, as there are around six edges on the right.

5.3. Inverter

Printed circuit board (PCB) hardware for the inverter is implemented. The inverter consists of six switches along with a driving chip that transforms the signal output by the controller to equivalent driving voltages for the six switches. The inverter inputs are the controller that controls signal along with DC voltage. The output is filtered using the transforms that work as a filter. The schematic diagram of the inverter is given in Figure 20. As shown in the figure, six switches and driver chip IR2110 are used. The signals coming from the right are the six control signals that control the switches. Three current fuses are used for circuit protection. The Inverter PCB circuit is shown in Figure 21. The detailed description of the hardware components is shown in Table 4.
Table 4 shows a detailed description of the hardware components.
Detailed Explanation of Inverter:
Principles of Operation:
Two switch cells in the phase make up the half-bridge converter. The S1 and S4 de note the upper and lower switch cells, respectively. Each switch cell is created by connecting an antiparallel connection of a fully controlled diode and unidirectional switch Node 0 represents the common point of the voltage source. This node is used as the voltage reference node and is referred to as the DC-side midpoint. As a result, the three AC-side terminal voltages are as follows:
V ta ( t ) = ma t VDC 2
V tb ( t ) = mb t VDC 2
V tc ( t ) = mc t VDC 2
The preceding equations demonstrate that in order to obtain a balanced three-phase line current and a balanced three-phase AC-side voltage, and ma(t), mb(t), and mc(t) should be formed into a balanced three-phase signal, which is typically carried via a closed-loop control method [25,31].
The half-bridge converter operates by switches S4 and S1 alternately. The turn-on/off commands of S4 and S1 are delivered using the pulse-width modulator (PWM). The PWM is a modulation method and can be carried out in a variety of ways.
The most mutual PWM technique compares a high-frequency waveform of periodic triangular, known as the signal of the carrier, to a slow-varying waveform identified as the modulating signal. The signal of the carrier has a periodic waveform with time Ts and fluctuates between −1 and 1 as in the equation
  S t = 1 ,   if   the   switch   is   commanded   to   conduct 0 ,   if   the   switch   is   turned   off  
As shown in Figure 22, when the carrier signal is lower than the modulating signal, a turn-on command for S1 is delivered, while the turn-on command for S4 is canceled [25].
Figure 23 shows the waveforms of the switching functions S4 and S1, which depend on the output of the PWM diagram, that is, S1(t) + S4(t) = 1 [25].
Figure 16 is used to power the PWM circuit, as shown in Figure 22.
The comparison between output R.M.S voltage from the three-phase of the experimental results and simulation result for input DC voltage = 50 V is shown in Figure 24 and Figure 25.
There are two and a half divisions; each division = 10 V, therefore, VP = 25 V, and output phase voltage (V) (R.M.S) = 25/√2 = 17.6 V. The specifications for the hardware design and power rating of the inverter as shown in Table 5.
Matlab Simulink simulation.
The three-phase peak voltage output from the inverter in experimental and simulation results (VP) = 25 V, therefore the output phase voltage (V) (r.m.s.) = 25/√2 = 17.6 V
Figure 24 shows the final results generated by the inverter. As seen, the three-phase signal synchronized has the same peak-to-peak values. It can also be seen that the signal is smooth but with low total harmonic distortion (THD). This proves that the controller works experimentally and produces a voltage that is synchronized with the grid and that has a small total harmonic distortion.
A capacitor, CBB 22, 474J400 V, is used in each phase for smoothing the output three-phase signals [32].

6. Conclusions and Future Works

In this work, the system uses GUI Matlab software to study the dimensions of inverters, boost converters, and photovoltaic arrays. In this paper, a design is introduced alongside the hardware implementation of a fuzzy-PI controller for the inverter part of a grid-connected PV system. In the hardware implementation, a 70 W prototype is used to test the controller. The proposed method does not need complex programming, as a Matlab compiler is proposed to transform the developed Simulink controller to a C code that can be utilized to operate the microcontrollers in the hardware of the grid-connected inverter. The experimental results show that the proposed methodology works well and produces the required C code of the controller. The experimental results show that the proposed fuzzy-PI controller achieves good performance with an inverter efficiency = 97.8%. The main conclusion is that the fuzzy-PI controller for a three-phase grid-connected system can be implemented using low-cost reconfigurable microcontrollers. In addition, the measured and simulated output current waveforms are similar, validating the correctness of our design and our method.
In future work, one may scale up the power of the grid-connected system to realistic value for the household power as in our Simulink model.

Author Contributions

Corresponding author, S.M.; methodology, S.M. and A.Y.; software, S.M. and A.Y.; implementation, S.M.; validation, A.Z. and A.Y.; writing—original draft preparation, S.M., A.Z. and A.Y.; formal analysis, S.M. and A.Y.; investigation, A.Z. and A.Y.; resources, A.Y. and A.Z.; data curation, W.R.A. and S.M.; writing—review and editing, A.Y., S.M. and A.Z.; supervision, A.Z. and A.Z.; project administration, A.Z. and A.Z. All authors have read and agreed to the published version of the manuscript.

Funding

The author(s) received no financial support for the research, authorship, and/or publication of this article.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

Not applicable.

Conflicts of Interest

The author’s declare that they have no competing interests.

Abbreviations

PVPhotovoltaic solar cell.
MPPTMaximum power point
THDTotal harmonic distortion
PLLPhase-locked loop
PSIMPhysical security information management
FLCFuzzy logic controller
SFPICSimplified fuzzy-PI controller
MMCModular multilevel converter
PIProportional integral
PWMPulse width modulation
ADCAnalog to digital converter
P.FPower factor
PWMPulse-width modulator

Nomenclature

Id, IqDirect and quadrature current
Vd, Vq Direct and quadrature voltage
Kp, Ki Proportional and integral gains of the PI controllers
fnThe nominal frequency

References

  1. Abdalhalim, Z. Computer-aided analysis of stepped sine wave inverters. Sol. Cells 1991, 31, 559–580. [Google Scholar]
  2. Rajasekar, S.; Rajesh, G. Rapid prototyping of power electronics converters for photovoltaic system application using Xilinx system generator. IET Power Electron. 2014, 7, 2269–2278. [Google Scholar]
  3. Sayed, K.; Gabbar, H. Electric vehicle to power grid integration using three-phase three-level AC/DC converter and PI-Fuzzy controller. Energies 2016, 9, 532. [Google Scholar] [CrossRef]
  4. Abdalhalim, Z.; Slim, A. Investigations on Stepped sine wave push-pull inverter. In Proceedings of the 12th International Mechanical Power Engineering Conference IMPEC, Mansoura, Egypt, 30 October–1 November 2001; p. 12. [Google Scholar]
  5. Abobakr, A.; Abdalhalim, Z. Three-Phase Grid-Connected Inverter. Ph.D. Thesis, Ain-Shams University, Cairo, Egypt, 2008. [Google Scholar]
  6. Abdalhalim, Z.; Ahmed, A.; Ahmed, A. Simulation and implementation of grid-connected inverters. Int. J. Appl. 2012, 60, 41–49. [Google Scholar]
  7. Ahmed, A.; Abdalhalim, Z. Control of the grid-connected inverter using Dspic microcontroller. In Proceedings of the 2013 Second International Japan-Egypt Conference on Electronics, Communications, and Computers (JEC-ECC), Cairo, Egypt, 17–19 December 2013; IEEE: New York, NY, USA, 2013; pp. 159–164. [Google Scholar]
  8. Tchoketch, G.; Larbes, C.; Ilinca, A.; Obeidi, T.; Tchoketch, S. Study of the intelligent behavior of a maximum photovoltaic energy tracking Fuzzy controller. Energies 2018, 11, 3263. [Google Scholar] [CrossRef] [Green Version]
  9. Bakkar, M.; Aboelhassan, A.; Abdelgeliel, M.; Galea, M. PV Systems Control Using Fuzzy Logic Controller Employing Dynamic Safety Margin under Normal and Partial Shading Conditions. Energies 2021, 14, 841. [Google Scholar] [CrossRef]
  10. Othmane, S.; Mohamed, B.; Abdelmoumen, T. Control of Three-Phase Grid-Connected Photovoltaic Power Systems. In Proceedings of the December 2018 IEEE 5th International Congress on Information Science and Technology (CiSt), Marrakech, Morocco, 21–27 October 2018; pp. 542–546. [Google Scholar]
  11. Radwan, E.; Nour, M.; Awada, E.; Baniyounes, A. Fuzzy Logic Control for Low-Voltage Ride-Through Single-Phase Grid-Connected PV Inverter. Energies 2019, 12, 4796. [Google Scholar] [CrossRef] [Green Version]
  12. Thiagarajan, Y.; Sivakumaran, T.S.; Sanjeevikumar, P. Design and simulation of Fuzzy controller for a grid-connected standalone PV system. In Proceedings of the 2008 International Conference on Computing, Communication, and Networking, Karur, India, 18–20 December 2008; IEEE: New York, NY, USA, 2008; pp. 1–6. [Google Scholar]
  13. Ayman, Y.; Mohammed, E.-T.; Abdalhalim, Z. Design and simulation of Fuzzy controller for three-phase grid-connected PV systems. Int. J. Eng. Technol. 2018, 7, 5554–5557. [Google Scholar]
  14. Mansiri, K.; Sukchai, S.; Sirisamphanwong, C. Fuzzy control for smart PV-battery system management to stabilize grid voltage of 22 kV distribution system in Thailand. Energies 2018, 11, 1730. [Google Scholar] [CrossRef] [Green Version]
  15. Roselyn, J.; Chandran, C.; Nithya, C.; Devaraj, D.; Venkatesan, R.; Varun, G.; Sai, M. Design and implementation of Fuzzy logic based on modified real-reactive power control of inverter for low voltage ride through enhancement in grid-connected solar PV system. Control. Eng. Pract. 2020, 101, 104–494. [Google Scholar] [CrossRef]
  16. Mutlag, A.; Mohamed, A.; Shareef, H. A nature-inspired optimization-based optimum Fuzzy logic photovoltaic inverter controller utilizing an eZdsp F28335 board. Energies 2018, 9, 120. [Google Scholar] [CrossRef] [Green Version]
  17. Ngoc, -T.N.; Hong, -H.L. Fuzzy-PI controller for grid-connected inverters. In Proceedings of the International Conference on Intelligent Computing; 7th International Conference, ICIC 2011, Zhengzhou, China, 11–14 August 2011; Springer: Berlin/Heidelberg, Germany, 2011; pp. 300–308. [Google Scholar] [CrossRef]
  18. Ayob, S.M.; Salam, Z.; Azli, N.A. Inverter control using a simplified Fuzzy-PI controller. In Proceedings of the 5th IET International Conference on Power Electronics, Machines and Drives (PEMD 2010), Brighton, UK, 19–21 April 2010; IET: London, UK, 2010. [Google Scholar] [CrossRef]
  19. Sefa, L.; Altin, N.; Ozdemir, S.; Kaplan, O. Fuzzy-PI controlled inverter for grid-interactive renewable energy systems. IET Renew Power Gener. 2015, 9, 729–738. [Google Scholar] [CrossRef] [Green Version]
  20. Sameh, M.; Abdalhalim, Z.; Ayman, Y.; Wagdi, R.A. Average household grid-connected PV generator with different intelligent controllers. In Proceedings of the 2021 38th National Radio Science Conference NRSC, Mansoura, Egypt, 27–29 July 2021; IEEE: New York, NY, USA, 2021; Volume 1, pp. 186–198. [Google Scholar] [CrossRef]
  21. Lauris, B.; Andrejs, S.; Ilja, G. Comparison of a traditional diode photovoltaic model and simplified I-V curve based model. In Proceedings of the 5 the International Symposium Topical Problems in the Field of Electrical and Power Engineering, Doctoral School of Energy and Geotechnology, Kuressaare, Estonia, 14–19 January 2008. [Google Scholar]
  22. Mohamed, A.E.; Wagdy, M.; Khaled, E.-M.; Fahmi, B. Fuzzy stabilizer design for renewable energy-based distribution networks. In Proceedings of the 22nd International Conference and Exhibition on Electricity Distribution (CIRED 2013), Stockholm, Sweden, 10–13 June 2013; pp. 1–4. [Google Scholar]
  23. Lin, B.R. Analysis of Fuzzy Inverter Control. Eur. Trans. Electr. Power 2007, 5, 239–246. [Google Scholar] [CrossRef]
  24. Harsha, A.; Lakshmikantha, B.R.; Shanmukha, S. Fuzzy self-tuning PI controller based-inverter control for voltage regulation in off-grid hybrid power system, VIT University, Chennai Campus. Energy Procedia 2017, 117, 409–416. [Google Scholar] [CrossRef]
  25. Yazdani, A.; Iravani, R. Voltage-Sourced Converters in Power Systems: Modeling, Control, and Applications; John Wiley & Sons: Hoboken, NJ, USA; IEEE: New York, NY, USA, 2010; p. 541. [Google Scholar]
  26. Mohammad, P.; Khadivi, Y. Optimization of Space Vector Pulse Width Modulation Switching Algorithms for Two-Level Inverters Regarding Different Objective Functions. J. Basic Appl. Sci. Res. 2012, 2, 7632–7644. [Google Scholar]
  27. Kamran, Z.; Saif, I.; Waqar, D.; Imran, K.; Muhammad, I.; Tiago, B.; Iftikhar., A.; Hee, K. Design of Fuzzy-PI and Fuzzy-sliding mode controllers for single-phase two-stage grid-connected transformerless photovoltaic inverter. Electronics 2019, 8, 520. [Google Scholar] [CrossRef] [Green Version]
  28. Essaghir, S.; Benchagra, M.; El-Barbri, N. Comparative study of three-phase grid-connected photovoltaic system using pi, pr and Fuzzy logic PI controller with harmonic analysis. Int. J. Electr. Comput. Eng. 2020, 8, 43–53. [Google Scholar]
  29. LM358 ACTIVE Dual, 30-V, 700-kHz Operational Amplifier. Available online: https://www.ti.com/product/LM358 (accessed on 25 July 2021).
  30. ACS712 Datasheet (PDF)-Allegro Micro Systems. Available online: https://www.alldatasheet.com/datasheet-pdf/pdf/205336/ALLEGRO/ACS712.html (accessed on 25 July 2021).
  31. Safaa, A.; Amin, B.; Nabi, M. The Common Use of Pulse Width Modulation “PWM” Technique in Power Electronics. Int. J. Sci. Res. 2014, 3, 2129–2132. [Google Scholar]
  32. 250V Polypropylene Film Capacitor CBB22 184J Supplier. Available online: https://capacitorsfilm.com/product/cbb22-474j400v-film-capacitor-manufacturer (accessed on 25 July 2021).
Figure 1. Complete Simulink model of the grid-connected photovoltaic system.
Figure 1. Complete Simulink model of the grid-connected photovoltaic system.
Energies 15 00843 g001
Figure 2. Simulink model of fuzzy-PI inverter controller.
Figure 2. Simulink model of fuzzy-PI inverter controller.
Energies 15 00843 g002
Figure 3. Direct and quadrature current error (ΔId and ΔIq). Membership functions for the fuzzy-PI inverter control.
Figure 3. Direct and quadrature current error (ΔId and ΔIq). Membership functions for the fuzzy-PI inverter control.
Energies 15 00843 g003
Figure 4. Direct and quadrature current variation of error (ΔΔ Id and ΔΔ Iq). Membership functions for the fuzzy-PI inverter control.
Figure 4. Direct and quadrature current variation of error (ΔΔ Id and ΔΔ Iq). Membership functions for the fuzzy-PI inverter control.
Energies 15 00843 g004
Figure 5. Proportional gain membership function (KP).
Figure 5. Proportional gain membership function (KP).
Energies 15 00843 g005
Figure 6. Integral gain membership function (KI).
Figure 6. Integral gain membership function (KI).
Energies 15 00843 g006
Figure 7. Circuit diagram of an ideal two-level inverter.
Figure 7. Circuit diagram of an ideal two-level inverter.
Energies 15 00843 g007
Figure 8. Voltage and current of phase are the unity power factor.
Figure 8. Voltage and current of phase are the unity power factor.
Energies 15 00843 g008
Figure 9. Low-load fuzzy-PI controller of the three-phase inverter and grid current.
Figure 9. Low-load fuzzy-PI controller of the three-phase inverter and grid current.
Energies 15 00843 g009
Figure 10. Synchronization of inverter voltage and grid voltage with fuzzy-PI controller.
Figure 10. Synchronization of inverter voltage and grid voltage with fuzzy-PI controller.
Energies 15 00843 g010
Figure 11. AC output (inverter, grid, and load) power supply for low-load fuzzy-PI controllers.
Figure 11. AC output (inverter, grid, and load) power supply for low-load fuzzy-PI controllers.
Energies 15 00843 g011
Figure 12. Three-phase grid and inverter current for fuzzy-PI controller of low load.
Figure 12. Three-phase grid and inverter current for fuzzy-PI controller of low load.
Energies 15 00843 g012
Figure 13. Total inverter control building blocks.
Figure 13. Total inverter control building blocks.
Energies 15 00843 g013
Figure 14. Block diagram of the proposed hardware.
Figure 14. Block diagram of the proposed hardware.
Energies 15 00843 g014
Figure 15. Hardware experiment setup.
Figure 15. Hardware experiment setup.
Energies 15 00843 g015
Figure 16. This circuit uses a single-supply operational amplifier to generate a full-wave rectifier.
Figure 16. This circuit uses a single-supply operational amplifier to generate a full-wave rectifier.
Energies 15 00843 g016
Figure 17. Voltage-sensing PCB.
Figure 17. Voltage-sensing PCB.
Energies 15 00843 g017
Figure 18. The rectified signal is sensed from the grid (input).
Figure 18. The rectified signal is sensed from the grid (input).
Energies 15 00843 g018
Figure 19. Change in the duty cycle in pulses input for inverter.
Figure 19. Change in the duty cycle in pulses input for inverter.
Energies 15 00843 g019
Figure 20. Inverter circuit schematic.
Figure 20. Inverter circuit schematic.
Energies 15 00843 g020
Figure 21. Inverter PCB circuit.
Figure 21. Inverter PCB circuit.
Energies 15 00843 g021
Figure 22. Schematic diagram of generating PWM gate pulses for S4 and S1.
Figure 22. Schematic diagram of generating PWM gate pulses for S4 and S1.
Energies 15 00843 g022
Figure 23. The signal depends on the PWM operation technology: (A) Modulation signal and carrier signal; (B) S1 switching function; (C) S4 switching function.
Figure 23. The signal depends on the PWM operation technology: (A) Modulation signal and carrier signal; (B) S1 switching function; (C) S4 switching function.
Energies 15 00843 g023
Figure 24. The three-phase voltage output by the inverter in the experiment.
Figure 24. The three-phase voltage output by the inverter in the experiment.
Energies 15 00843 g024
Figure 25. The three-phase grid and inverter current of the fuzzy-PI controller.
Figure 25. The three-phase grid and inverter current of the fuzzy-PI controller.
Energies 15 00843 g025
Table 1. The specifications of the fuzzy-PI controller are shown in Figure 11.
Table 1. The specifications of the fuzzy-PI controller are shown in Figure 11.
ParametersValues
Settling time(s)0.121
Peak time(s)0.076
Overshoot(per.)5.941
Average THD of inverter current (per.)0.744
Table 2. The THD comparison between the works in the literature and the work presented in this article.
Table 2. The THD comparison between the works in the literature and the work presented in this article.
InverterValues (%)
Work presented in this paper0.7440
[16]3
[27]2.194
[28]1.10
Table 3. SunPower SPR305-WHT-D manufacturer data for the PV system.
Table 3. SunPower SPR305-WHT-D manufacturer data for the PV system.
ParameterValues
Irradiance1000 W/m2
No. of cells per module96 Cells/module
Max. power (Pmax)305.226 W
Module open-circuit voltage (Voc) 64.2 V
Module short-circuit current (Ish) 5.960 A
Voltage at max. power point of module (Vmp) 54.70 V
Current at max. power point of module (Imp) 5.580 A
Cell temperature 25 deg.C
Temperature coefficient of Voc 0.27269%/deg.C
Module light generated current (IL) 6.0092 A
Module diode saturation current (Io) 6.3014 × 10−12A
Shunt resistance (Rsh)269.5934 ohms
Series resistance (Rs)0.37152 ohms
Table 4. Inverter components.
Table 4. Inverter components.
InverterParameters
MOSFETIRFP450
Gate DriversIR2110
Capacitor1 µF
Table 5. Specifications for the hardware design and power rating of the inverter.
Table 5. Specifications for the hardware design and power rating of the inverter.
ParametersValues
Input DC voltage (V)50
Input DC current (A)1.5
Input DC power (W)75.11
Output phase current (A) (r.m.s)1.4
Output phase voltage (V) (r.m.s)17.6
Output three-phase power (W)73.42
Inverter efficiency (%) 97.8
Active load power (p) (W) 70
The nominal frequency fn (Hz) 60
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Mostafa, S.; Zekry, A.; Youssef, A.; Anis, W.R. Raspberry Pi Design and Hardware Implementation of Fuzzy-PI Controller for Three-Phase Grid-Connected Inverter. Energies 2022, 15, 843. https://doi.org/10.3390/en15030843

AMA Style

Mostafa S, Zekry A, Youssef A, Anis WR. Raspberry Pi Design and Hardware Implementation of Fuzzy-PI Controller for Three-Phase Grid-Connected Inverter. Energies. 2022; 15(3):843. https://doi.org/10.3390/en15030843

Chicago/Turabian Style

Mostafa, Sameh, Abdelhalim Zekry, Ayman Youssef, and Wagdi Refaat Anis. 2022. "Raspberry Pi Design and Hardware Implementation of Fuzzy-PI Controller for Three-Phase Grid-Connected Inverter" Energies 15, no. 3: 843. https://doi.org/10.3390/en15030843

APA Style

Mostafa, S., Zekry, A., Youssef, A., & Anis, W. R. (2022). Raspberry Pi Design and Hardware Implementation of Fuzzy-PI Controller for Three-Phase Grid-Connected Inverter. Energies, 15(3), 843. https://doi.org/10.3390/en15030843

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop