An Enhanced Inverter Controller for PV Applications Using the dSPACE Platform

This paper presents the simulation modeling and prototype development of an inverter controller for photovoltaic (PV) applications using the dSPACE DS1104 controller platform. The controller platform can link the simulation model developed in the MATLAB/SIMULINK environment to its prototype hardware. In the dSPACE controller, the voltage regulator controls the inverter by employing a proportional integral (PI) controller and the Park transformation method to generate sinusoidal pulsewidth modulation (SPWM) signals. The SPWM signals switch the insulated gate bipolar transistor (IGBT) to stabilize the 50-Hz sinusoidal AC output voltages of the inverter. The simulation was performed with a DC power supply that acts as the PV generator to supply the power to the inverter. The simulation model was then translated into the inverter prototype using the dSPACE platform and tested in the laboratory to prove the efficacy of the proposed controller. The experimental results for the inverter system demonstrated the feasibility of the proposed control strategy by maintaining the THD of the output voltage at 4.6%.


Introduction
The photovoltaic (PV) dc power is one of the most important alternative energy sources.It is cost-effective in remote applications, where utility power is unavailable, and pollution-free energy [1].In order to exploit PV dc power, an inverter is necessary for converting the dc power to an ac power [2][3][4].The conversion process is fully dependent based on the controller and its control algorithm [5].There are many types of controllers used to control the inverters of photovoltaic (PV) systems, for instance, analogue circuit controllers, digital circuit controllers, digital signal processors (DSP), microcomputers, and field programmable gate arrays (FPGAs) [6][7][8][9].By using these inverter controllers, high quality PV power can be transported to the utility through voltage synchronization [10].However, opportunities still exist for design engineers to improve the inverter controller because inverter failure remains one of the primary causes for photovoltaic system failure [11].Again, the inverter efficiency is not up to the mark due to its self-consumption losses [12].Moreover nowadays, the impact of unbalanced load on inverter output voltage [5], nonlinearity, and low efficiency of PV devices [13], electromagnetic interference, harmonics level, capability to operate with high speed and frequency for generating PWM [14], respectively, are the crucial issues for inverters and its controllers.Thus, for regulated inverter output voltage, an efficient and enhanced inverter controller is necessary to improve the inverter performance in PV or renewable energy applications.
Selvaraj and Rahim [8] and Mekhiled and Rahim [9] developed DSP TMS320F2812-and FPGA-based PV inverters using PI and PWM control algorithms, respectively.However, these inverters require users to develop software programming for the control algorithm, which might be a time-consuming task.In addition, a simulation model also must be developed prior to the hardware realization.A different approach for PV inverters adopts the dSPACE DS1104 control platform, which enables the user to employ MATLAB/SIMULINK tools for the development of the control algorithm and simulation as well as hardware implementation.The dSPACE DS1104 control platform simplifies the control algorithm programming task using its library block sets.Moreover, the data and codes of the successfully simulated model can be linked and loaded directly to the controller for real-time hardware operation.With the availability of a graphical object-oriented package, the dSPACE system has enabled the development of user friendly inverter control panels for online monitoring and supervision [15].The dSPACE system is quite popular in control platforms and is widely used in automation systems and car manufacturing industries [16].As an alternative application area, the dSPACE system can be used as a control platform in the development of PV standalone inverters.
In this paper, a simulation model was developed and linked with a dSPACE controller.The model generated the sinusoidal pulse-width modulation (SPWM) switching signal for the voltage control scheme in implementation of the real inverter hardware.A detail control strategy of dSPACE platform is discussed below.The real-time implementation of the enhanced inverter controller was carried out with the integration of dSPACE DS1104 platform.

The dSPACE Control Platform
A dSPACE DS1104 controller was used as an inverter control platform, which enables the linkage between the MATLAB/SIMULINK inverter models and the real hardware by introducing the dSPACE DS1104 input-output (I/O) interface blocks into the SIMULINK models.The I/O blocks are analog to digital converter (ADC), digital to analog converter (DAC) and BIT OUT CX block.By using the MATLAB/SIMULINK real-time workshop (RTW) function, the SIMULINK model with the dSPACE interface blocks is converted to the C-code automatically [17].Then the codes are compiled by a compiler and linked to the realtime dSPACE DS1104 processor board.With the application of the dSPACE graphical user interface (GUI) software, the monitoring of the performance and behavior of the inverter in real time is made possible.Moreover, the user is able to alter the controller parameters and see the performance in a real time.Salam et al. [18] introduced the utilization of the dSPACE DS1104 controller board in the design of a highfrequency link inverter.A digital proportional integral (PI) controller in the dSPACE is an alternative way to control and stabilize the ac output voltage.Figure 1 shows a block diagram of the dSPACE DS1104, which consists of a main processor PowerPC603 that runs at 250 MHz, a 64bit floating-point processor, and a slave of 16-bit DSP-TI TMS320F240 microcontroller.This controller is used due to its ideal hardware for a prototype development system for cost-sensitive rapid control prototyping.It is especially suitable for the development of high-speed multivariable digital controllers and real-time simulations in various fields.

Control Strategy
The proposed PV inverter control system consists of three main blocks, the voltage sensors, the dSPACE DS1104 controller, and the inverter, as shown in Figure 2. The inverter output is connected to the load and control process.
Because of the three-phase inverter, the voltage sensors block consists of three-sensor circuitry, which functions as an interface between the inverter and the input of the dSPACE controller board.The three-phase inverter outputs voltages, v a , v b , and v c , with a unity power factor can be assumed to read the voltage sensors: where the voltage magnitude is V and the voltage frequency is ω.
The voltages are read and scaled down to a safe and workable voltage level for the dSPACE DS1104 controller board.Otherwise, they might damage the board.These analog signals are then fed to the ADC channels of the dSPACE DS1104 board.The signals are sampled and used for the voltage regulation process in the voltage control scheme, as shown in Figure 3.By using the Park transformation method, the sampled signals are transformed from the three-axis abc frame into a dq0 reference frame system as shown in ( 2) [18].The transformation is applicable only with the condition that the three-phase load is a balance load.Hence, the ν 0 term in the dq coordinate frame can be neglected, which leaves only the ν d and ν q terms.This transformation employs the 50-Hz synchronization signal from a phase-locked loop (PLL) block: Next, these dq voltages are compared with the reference voltages, ν dref and ν qref .This process generates the error voltages, which are fed to the PI controllers for the output voltage regulation.The time domain PI control algorithm is shown in the following [8]: where u(t) is the output of the PI controller, K p and K i are the proportional and integral gains of the controller, and e(t) is the error, that is, the difference between the reference voltage and the measured one.The PI controller minimizes the rise time and the steady-state error of the inverter output voltage.The PI controller calculates the integral of the error and sums it with the proportionate error.Upon summation, the PI controller generates a control signal in such a way that the error signal is kept to a minimum value [19].Thus, the system is capable of keeping the output voltage as close as possible to the reference voltage.As a result, the inverter output voltage can be controlled and stabilized.
To shape the inverter output waveforms close to the sinusoidal waveforms, the output signals from the PI must be transformed back to the 3-phase coordinate system using the inverse Park transformation in (4) [18].The transformation of the abc coordinates employs the 50-Hz synchronization signal from the PLL as well: Finally, these abc signals are fed to the SPWM generator for the generation of the SPWM switching signals for the inverter.The SPWM modulates the switching signals for the inverter switches to shape the output ac voltages to be as close to a sine wave as possible [19].The duty ratios of the switches are modulated by the control signal, which is the desired fundamental frequency of the inverter.In this generator, a control signal of 50 Hz is compared to the triangular wave of 25 kHz used to generate the SPWM switching signals to drive the inverter switching devices.The triangular wave frequency establishes the inverter switching frequencies with the inverter switches.A control variable, called modulation index, M a , is responsible for the rms output voltage of the inverter.The modulation index is the ratio of the amplitude of control signal, A ref , to the amplitude of triangular wave signal, that is, the carrier signal, A tri , as shown in; The modulation index is varied by varying the control signal for the desired output waveform.The fundamental rms output line voltage is proportional to the modulation index and the dc input voltage, V dc , as shown in; The modulation index can be varied from 0 to 1.A modulation index M a > 1 causes over modulation and results in higher output voltages with more harmonics in the inverter output waveform.In this control system, the modulation index is kept below 1.The inverter consists of three main sections, a driver, IGBTs, and a filter.The driver serves as an interface between the SPWM signals of the DS1104 controller board and the IGBT of the inverter.For the inverter operation, it is important that the generated SPWM switching signals possess the correct voltage levels for the IGBT to switch completely on and off.Another important criterion is that there must be isolation between the system control circuit, International Journal of Photoenergy which operates with low voltage, and the high voltage of the inverter, which is achieved by the implementation of optocoupler driver circuits.
To produce a three-phase 50-Hz output voltage, the controller generates the SPWM gating signals for switching on and off the IGBT switches of the inverter.Thus, ac voltage waveforms are generated at the inverter output.These output voltages pass through the second order LC low pass filter to reduce the higher-order harmonic components and produce a nearly sinusoidal output waveform.To reduce the harmonic distortion, the LC filter is connected at the point of common coupling to the distribution system.The inductance, L, and capacitance, C, of the time domain filter models are given as follows: where V R is the receiving end voltage and i(t) is the periodic current of the system.It is recommended to set the filter cutoff frequency to one or two octaves above the fundamental frequency, that is, 200 Hz [20].The calculated capacitance and inductance values are 30 μF and 20 mH, respectively.Because the dc input voltage is small, the inverter output voltage need must be stepped up, which is achieved with the transformer.

Simulation Model
The inverter system simulation model was developed using the dSPACE controller, which runs in the MATLAB/ SIMULINK environment.The simulation was run for a period of 0.05 seconds with a sampling time of 2 μsec.The detailed inverter system simulation model using the dSPACE controller is shown in Figure 4.
The PV generator was developed using PV modules for the source of the dc power supply in this simulation model.The PV modules were formed with the larger unit of the solar cells and connected in a parallel-series configuration to form PV arrays [21][22][23].The output voltage of the solar cell is a function of the photocurrent, which depends on the solar irradiation level during operation [24][25][26][27].The output current of the solar cell is represented in (8).The PV voltage and current were developed by considering N s series modules and N p parallel branches of the PV array, as shown in (9).The power output of the PV array is the product of the output current and the output voltage of the PV array, which is given by the following [28]: The definitions of the parameters in the equations are in the nomenclature.
In the simulation model, the 40 V dc from the PV module is fed to the inverter to simulate the PV generator.The main components of the simulation model are the PV generator, IGBT-based inverter, LC filter, transformer, and the controller, which were connected to the resistive load of 500 W. The oscilloscopes are employed to measure the output waveform of the inverter before and after the filter.The system control is governed by a controller that reads the voltages of the inverter and then generates the PWM signals to drive the IGBTs.With the control scheme implemented, the inverter is able to maintain a phase and line voltage output as described in the results and discussion section.The dSPACE DS1104 enables the linking of the MAT-LAB/SIMULINK model to the real inverter hardware.The implementation of the control system with the dSPACE DS1104 RTI for the PV inverter system is shown in Figure 5.In this implementation, two blocks of the dSPACE DS1104 RTI library are used, the DS1104SL DSP PWM3 and the DS1104MUX ADC.The DS1104MUX ADC block is used to read and sample the output voltages of the inverter.It converts the voltages to digital form to be used by the controller.The output voltages generated from the control system block are then connected to the conversion block for the voltage level required by the DS1104SL DSP PWM3 block.The SPWM signals generated are then connected to the hardware of the inverter.

Results and Discussion
To verify whether the modeled inverter can be realized, simulations should be performed and evaluated.Thus, a simulation model was developed and linked with hardware implementation through a dSPACE DS1104 platform.The experimental setup, simulations, and experimental results are explained what follows.

Experimental Setup.
To verify the simulation model, an inverter prototype was build, tested, and evaluated in the laboratory.The main components of the inverter prototype are dc power supplies, an IGBT driver, a 6-pulse IGBT inverter, and a pc with DS1104.The measuring equipment used in the prototype included a digital multimeter, an oscilloscope, a Fluke 434 power quality analyzer, and the necessary connectors, as shown in Figure 6.For the inlaboratory evaluation, the dc input voltage was set to 40 V.The output of the inverter was connected to the three-phase adjustable resistive load which acquires a power capacity of 500 W to 1.5 kW.

Simulation Results
. Simulations were carried out to illustrate the effectiveness of the conversion of the dc voltage of the PV into an ac voltage using the dSPACE controller.The performances of the inverter and its controller model were investigated under different conditions using MAT-LAB/SIMULINK tools.Accordingly, three-phase inverter output voltage waveforms, v a marked as blue, v b marked as red, and v c marked as green, are shown in Figure 7.The phase voltages were measured at inverter before the filter.Each phase waveform was made up of a series of voltage pulses, which were varied between 0 V and ±40 V, due to the result of the PWM switching scheme of the proposed controller for the IGBT switches of the inverter.A better view of the inverter phase voltage, v a , waveform is shown in Figure 8.
However, the inverter three-phase output voltage waveforms contained lower-and higher-order harmonic components due to the switching effect of the inverter switches.Most of the higher-order harmonic components were reduced and filtered out by the LC filter.The threephase ac output voltage waveforms of the inverter after the filtering elements are shown in Figure 9, in which the waveform contains only the fundamental and the lowerorder harmonics.
The inverter output line voltage waveform, v ab , is shown in Figure 10.The waveforms were sinusoidal in shape.The frequency of the output waveform was determined by considering the period T, which was 0.02 seconds, that is, 50 Hz.It also can be seen that the three-phase waveforms are displaced by 120 • from each other, representing inverter output voltages v a , v b , and v c in (1).
Figure 11 shows the waveform of phase a load current.Like the voltage waveform, this current also has a shape of a sinusoidal waveform.
Fast Fourier transform (FFT) analysis was performed on the inverter output voltage waveform to determine the quality of the output voltage.In FFT, the total harmonic distortion (THD) is calculated, and the frequency spectrum of the voltage and current harmonics are shown in Figures 12 and 13, respectively.It was seen that both the inverter output voltage and load current THD were 0.29%, which is below the value of 5% of the IEEE standard.The fundamental harmonic magnitude was 100%, and the lower order harmonic components such as third, fifth, and seventh were below 0.3%.Thus, it can be concluded that the enhanced inverter controller developed was efficient enough for PV applications.

Experimental Results.
To assess the performance of the prototype inverter controller, the experimental results of the three-phase inverter voltages and currents were measured and are shown in Figure 14. Figure 14(a) shows that the three-phase voltage waveforms are quite satisfactory and nearly sinusoidal with a frequency of 50 Hz and a displacement of 120 • from each other, as in the simulation.Figure 14(b) also shows the three-phase output current waveforms of a frequency of 50 Hz, which were nearly sinusoidal.The output current waveforms were quite good and were similar to the voltage waveforms.
Figure 15 shows that the distorted waveform of the inverter output voltage and load current THD were 4.6% and 5.0%, respectively, which are below or at the value of 5% of the IEEE standard.However, there is room for further THD reduction, especially in the filtering of the lower orders of the harmonic components.

Conclusion
A three-phase PV inverter controller using the dSPACE DS1104 controller platform was presented in this paper.An accurate PV model including an inverter and its controller was simulated in the MATLAB/SIMULINK environment, and the prototype was tested in the laboratory.The test results showed that the inverter controller produced a stable and nearly sinusoidal shape for the 50-Hz line voltage and current, which was comparable to the simulation results.The simulation results were verified and validated the performance of the prototype of the inverter.The THD of the inverter output voltage was 4.6%, which was quite satisfactory.The proposed inverter is incomparable to the commercial inverter in terms of THD, because in both cases, the THD were almost similar in percentage.In some cases, the commercial inverters are bit better due to tuned industrial production compared to prototype development.However, the main advantage of the proposed inverter was the dSPACE DS1104 control platform, which employed the tools of control algorithm and simulation model as well as hardware implementation for regulated ac voltage.Moreover, the proposed inverter controller was highfrequency-linked high-speed multivariable digital controller, rapid prototyping, and cost-sensitive.Thus, the simulation and experimental results showed good reference tracking and properties, validating the desired functionality of the proposed controller.I d e a l i t yf a c t o r K:

Nomenclature
Boltzmann constant q: Electron charge G: Irradiance β: Voltage temperature coefficient N s : Modules number in series N p : Modules number in parallel α: Current temperature coefficient V PV : Output voltage of the PV array I PV : Output current of the PV array P PV : Output power of the PV array T: Stack temperature V ref : PV reference voltage I ref : PV reference current T ref : Reference stack temperature.

Figure 1 :
Figure 1: Block diagram of the dSPACE DS1104 controller board.

Figure 2 :
Figure 2: Block diagram of the dSPACE controlled inverter.

Figure 3 :
Figure 3: Block diagram of the voltage control scheme implemented in the dSPACE DS1104 controller board.

Figure 4 :
Figure 4: Inverter system simulation model using dSPACE controller.

Figure 5 :Figure 6 :
Figure 5: The dSPACE DS1104 RTI control system implementation of the PV inverter system.

Figure 7 :
Figure 7: Three-phase inverter output voltage before the filter.

Figure 8 :Figure 9 :
Figure 8: Inverter output phase voltage, v a , before the filter.

Figure 10 :Figure 11 :
Figure 10: Inverter output phase voltage, v a , after the filter.

Figure 12 :Figure 13 :
Figure 12: FFT analysis for simulation showing the THD and harmonic spectrum of the line voltage.

Figure 15 :
Figure 15: THD of the three-phase inverter (a) voltages and (b) currents.