Rapid development of an FPGA Controller for a Wind / Photovoltaic Power System A. Parera-Ruiz*, M.N. Cirstea*, Senior Member, IEEE, D.N. Ilea** *Anglia Ruskin University, Cambridge, UK **Transilvania University of Brasov, Romania alberto.ruiz@student.anglia.ac.uk , marcian@ieee.org, ilea@leda.unitbv.ro Abstract-The efficient control of Distributed Energy Resources (DERs) is the key for the optimization of renewable energy supplies used in stand-alone micro-generators. A Wind / Photovoltaic combined power generator, with the possibility to incorporate a hydrogen fuel cell as energy backup or connect the system to the grid [2], in order to achieve reliable, self-sufficient, continuous power to variable sources and loads, is the structure tackled in this research project and the control of the integrated Wind/PV system is the scope of this paper. The research work takes advantage of the new generation of Computer Aided Design (CAD) tools, able to generate a fast hardware implementation from synthesizable high level modelling code [3], [4]. The proposed system uses DK5, from Agility Design Solutions [5], design and modelling software environment based on Handel-C programming language. The research led to the rapid development, prototyping and testing of an FPGA based controller for the integrated renewable power generation system. I. INTRODUCTION An increasing concern about climate change due to carbon dioxide emissions, crude oil and gas conflicts that increase fuel prices as well as the recent debate about the revival of nuclear power stations is demanding researchers to develop cost effective, efficient and reliable alternative energy sources. The control of power converters is well known in generators and electric motors applications; however, the control of power converters in the emerging field of Renewable Energies and Distributed Power Generation Systems (DPGS) is still a field of study in the industry and in the academic world [2]. Different areas need to be developed and a range of subjects must be addressed in order to effectively consider the DPGS as alternatives to conventional fossil fuelled power stations and generators responsible for the emission of carbon dioxide (CO2) and Greenhouse Gasses (GHGs) causing global warming. DERs (Distributed Energy Resources) are constituting an increasingly appealing alternative [7], [8], [9] that provides a significant and growing contribution to the grid as well as being widely used as stand-alone generators for relatively small power networks, for example those associated with isolated networks, weak grids, island systems and a whole range of small / medium power applications. The advances in EDA (Electronic Design Automation) techniques and VLSI (Very Large Scale Integration, millions of transistors on a chip) technology in recent years has created the opportunity for the development of complex and compact high performance control configurations for power systems [6]. This paper presents a study of an integrated (holistic) design, model and simulation of a Wind / Photovoltaic power system controller, based on synthesisable digital hardware from C-like languages and FPGA rapid prototyping. The use of synthesisable C as opposed to Hardware Description Languages (HDL), i.e. VHDL or Verilog, accelerates design and the use of FPGAs provides the flexibility for designers to re-program in the field to fix bugs. An integrated DER energy system, combining wind and photovoltaic power as main energy sources is the structure tackled by the paper. The introduction of a Fuel Cell as energy back up in order to supply continuous power to variable loads from variable sources is covered in a separate paper [14]. The control of the integrated system is the key to optimising its efficiency. In a first stage, the energy sources are modelled using Matlab / Simulink software tools to analyse their dynamic behaviour and in a second stage DK5 (Agility) design and modelling environment based on Handel-C programming language will be used. This is a design environment that allows all aspects of the system simultaneously to be considered, in particular maximising operational performance to achieve energy efficiency and power quality and fast implement of a hardware prototype of an FPGA using an evaluation and development board from Agility, RC100. The employment of FPGAs for commissioning trials provides further benefits such as: rapid prototyping, simple hardware / software design and compact implementation. The complete digital controller circuit design was synthesized, implemented and tested. II. INTEGRATED SYSTEM The research work is focused on photovoltaic and wind power. These renewable sources are being used for the majority of DERs installations. The integration of a Fuel Cell or battery, although essential for this type of variable energy systems, is not in the scope of this paper. A brief description of wind and PV resources is presented below. A. Wind Energy Wind energy [11] is the Kinetic energy 1 2 mv 2 Joules (1) of a flow of air, where ρ is the air density, through a unit area A perpendicular to the wind direction which is available over a given period of time: V= 1 ρAv∆tv 2 2 Joules (2) In the majority of systems, permanent magnet synchronous generators are used to transform the mechanical energy into electrical energy, variable in frequency - depending on wind speed. The mathematical model equation for the mechanical power generated from the wind can be expressed as dV 1 (3) = ρAv 3 W dt 2 where the power in the wind, Pw , is the time derivative of the PW = kinetic energy. The basic system is shown in Fig. 1. Fig. 1. Wind electric system. The power in the wind, Pw, passes through the turbine to generate mechanical power, Pm, at a turbine angular velocity ωm. The fraction of power extracted from the power in the wind by a practical wind turbine is usually given the symbol C p , standing for the coefficient of performance. Using this notation and dropping the subscripts of equation (3), the actual mechanical power output can be written as: ⎛1 ⎞ (4) Pm = C p ⎜ ρ Av 3 ⎟ = C p Pw [W] 2 ⎝ ⎠ which is then supplied to the transmission. The transmission output power Pt is given by the product of the turbine output power Pm and the transmission efficiency ηm: Pt = η m Pm [W] (5) B. Solar energy The photovoltaic (PV) cells [10], as fundamental elements, convert the solar light into electrical energy, having about 1W/cm² peak power for an output voltage of about 0.5V. They are together connected into solar panels (units) to provide higher power. The mathematical model expression is based on curve shifting (translation) from one measured I-V curve to a new one, under another set of solar irradiance and solar cell temperature conditions, using algebraic equations (7), (8) and (9): I 2 = I 1 + ∆I sc (7) ⎛ L2 ⎞ ∆I sc = ⎜ − 1⎟ + α (T2 − T1 ) ⎝ L1 ⎠ (8) V2 = V1 − β (T2 − T1 ) − ∆I sc Rs − KI 2 (T2 − T1 ) (9) Where: I = current, A I sc = short circuit current, A α = current temperature coefficient, A/°C β = voltage temperature coefficient, V/°C K = curvature coefficient, Ω //°C Rs = series resistance, Ω V = voltage, V L = solar intensity, W/m² The curve translation method is easier to use, compared to other mathematical models, because the constants α , β , Rs and K are easier to determine from empirical measurements. Fig. 3 illustrates the power of the PV system depending on the irradiance. If the irradiance level of the photovoltaic system is changed from the standard 1000W/m2, then the C-V characteristic will change as shown in Fig. 3. Finally, the equation of the generator output power, Pe, is given by the product of the transmission output power and the generator efficiency ηg: Pe = η g Pt [W] (6) Fig. 2 shows the output power of a wind turbine versus wind speed. Fig. 3. Voltage/Current dependence on irradiance C. Power system architecture Fig. 2. Wind Speed/Power curves The integrated system presented is based on a 2.5kW micro-wind turbine and a 215W photovoltaic array, as main energy sources. The following discussion, which concentrates on the combination of these two sources, applies to any combination of renewable energy resource. Thus, the control and management strategies do not relate to this specific combination only, but they are also relevant, after adjusting the necessary parameters, to any other combination using the same power conversion topology. Referring to Fig. 4, it can be seen that each power source connects to the DC bus through its own DC/DC [12] converter in parallel. Two different type of DC/DC converters are used in this integrated system. On the Wind Turbine power source, a Buck converter (Fig. 5) is used to reduce the 48Vdc voltage down to the DC bus voltage level. On the PV array, a Boost DC/DC converter (Fig. 6) is used to increase the lower voltage generated to match the level of the DC bus. These converters are used in order to create a constant DC voltage on their outputs regardless of the voltage variation on their inputs. Allowing the voltage on the inputs of the DC/DC converters to vary almost freely, gives more flexibility to the control of the power sources. In the case of renewable power sources in particular, the flexibility is very important because it allows extracting the maximum available power in various circumstances. Fig. 4. Diagram of an Integrated Energy System This approach uses Handel-C in the design development stage and a Spartan3 (Xilinx) FPGA for the circuit implementation. Systems combining renewable energy sources such as Photovoltaic [10] (solar energy) and Wind energy [11] with compensatory more stable sources such as fuel cells [14] or electric batteries are the key to minimising the disadvantages of renewable sources and extending their applicability in the future. The converters are individually controlled, but they also have to be supervised by an Energy Management System as shown in Fig. 7. This research work identifies appropriate separate functional models to then merge into a combined integrated model in a unique CAD evaluation environment (DK5, Design Suite Agility). The aim is to explore the separate modelling and simulation of power systems topologies employing intelligent controllers, using Handel-C language (Agility) and FPGA for rapid prototyping. Hardware synthesis languages can create hardware from software (Handel-C) to target a variety of technologies. The holistic modelling, design and simulation is first done in Matlab/Simulink, to study the dynamic behaviour. In a second stage, the integrated system is co-simulated using Matlab/Simulink and DK5/Handel-C, to study the dynamic behaviour of the prototype controller. The actual design of the complete control system is then synthesised and uploaded into a Xilinx Spartan 3 3S1500L-4 FPGA for rapid prototyping. FPGAs are customized by loading configuration data into internal static memory cells; reprogramming is possible an unlimited number of times. Fig. 5. Step-down DC-DC Buck converter III.MODELLING & DESIGN METHODOLOGY The advances in VLSI technology enable the simultaneous development, design and implementation of compact high performance intelligent controllers for power systems. This paper is based on the use of Electronic Design Automation (EDA); therefore, the methodology followed is based upon the usual approach enabled by the use of an EDA environment for electronic system design and development. The procedure includes the following stages: - Investigation, identification and / or development of mathematical models for renewable power systems and associated controllers. - The holistic behavioural modelling, simulation and evaluation of the proposed controller against outlined system requirements. - Development of synthesisable Handel-C design code for the controller components. - Simulation & verification (timing analysis) of the design. - Rapid hardware implementation of the system using an FPGA development board. Fig. 6. Step-up DC-DC Boost converter Fig. 7. Diagram of an integrated Photovoltaic / Wind power generation control topology. FPGAs are ideal for shortening design and development cycles and also offer a cost effective solution. Although Handel-C is a ‘hardware synthesizable’ language and as such is primarily used for digital circuit design, it has the fundamental characteristics of any software programming language. This allows complete power system modelling and simulation, prior to digital controller design and implementation. IV. CONTROL SYSTEM ARCHITECTURE The control and power management strategy followed in this research programme is centralised on a FPGA controller. Parallelism allows the management of various renewable power sources at the same time, in order to achieve an efficient, reliable, self-sufficient, continuous power to variable loads. PV and Wind energy sources are connected in parallel and controlled by a common Energy Management FPGA Controller through their individual DC/DC converters. The power generated by these sources is given by look-up tables for both sources, which simulate the voltage for the PV generator and the current for the Wind Turbine. Even though every source has its individual control in this system, all of them share a similar configuration: a closed-loop feedback PI system controls the constant voltage level required from the load as well as the current through every individual PWM controller for each converter. A similar structure is used for the Buck and Boost converters, as seen in Fig. 8. reference signal for the Pulse Width Modulator, to generate the pulses (switch status) for the dc-dc converter. V. CO-SIMULATION RESULTS A useful feature of DK5, from Agility Design Solutions, is the Co-simulation Manager (Fig. 9). Co-simulation Manager allows easily implementing and running co-simulation between a variety of different simulators. The Co-simulation Manager does not alter data, or perform any algorithm in itself, but it facilitates the data transfer between different simulators. This allows creating a single system, with different components created in the most appropriate simulator. In this research project, the control system was first designed, modelled and simulated with Matlab/Simulink. Afterwards, the controller was modelled with Handel-C programming language to produce and FPGA prototype code. Then, in order to test and simulate the Handel-C code generated, a Simulink / DK5 co-simulation was used to test and validate the precision and accuracy of the Handel-C code previous to being synthesized on an FPGA. In order to verify the correct operation of the proposed integrated renewable energy system, PV and Wind sources, were simulated using Matlab/Simulink to behave as if the Wind source and the PV array worked separately and simultaneously for different periods of time. Fig. 10 and Fig. 11 represent values of PV irradiance and wind speed for a given period of time respectively. These signals were used during DK5 / Simulink co-simulation. Fig. 8. Common power control strategy of DC/DC converters for Wind and Photovoltaic Sources. Fig. 10. Irradiance simulation signal for a Photovoltaic Array Figure 9. Co-simulation Manager (Agility Design Solutions) The wind turbine and the photovoltaic array voltage are controlled based on the error signal. The error is fed into a proportional integrator (PI) type controller, which provides the reference current for the second PI that controls the Fig. 11. Wind speed simulation signal for a Wind Turbine Fig. 12, plot 1 and 2 represent Wind and PV current. These two sources complement each other in the absence of one of the renewable sources, to achieve a reliable, selfsufficient, continuous renewable distributed integrated PV / Wind power system. In plots 3 and 4, the constant 24Vdc voltage is maintained throughout the whole time when any one of the RES is present and generating enough power. Fig. 13 illustrates the control performed by the FPGA controller to maintain voltage and current combining Photovoltaic and Wind Turbine power sources. Plot 1 represents the PI output (current control) to the PWM pulses for the switch status on the Buck converter. As seen in the wind speed simulation (Fig. 11), this source is generating power throughout most of the simulation. Therefore, its contribution is higher than the PV source (Fig. 13, plot 2). Finally, plot 3 and 4 illustrate the switching of Buck and Boost converters used on this system. It clearly shows how both converters complement each other to achieve the system’s load power demand. VI. HARDWARE IMPLEMENTATION AND HANDEL-C TESTING Handel-C code (Fig. 14) was successfully co-simulated and tested using DK5 Design Suite and Matlab/Simulink. The control program running in parallel, enabled by the helpful feature from higher level C-based languages for hardware description, manages different energy sources simultaneously in order to achieve a reliable, self-sufficient, continuous power to variable sources and loads. int 32 Err1, Err2, PIDout, Vfbk, Ifbk, Triwave, Iwind; unsigned j=0; while (1) { par { { Vfbk= WindTurbine.input1_VLoad; // Load Voltage Ifbk= WindTrubine.input2_ILoad; // Load Current Iwind= WindTrubine.input3_I_WTurbine; // Wind Turbine Current Iwind=Iwind*10000; Err1=REFVOLTAGE-Vfbk; // Voltage error PIDout= PID (Err1, Iwind) // Current reference PIDout=PIDout/10000; Err2=PIDout-Ifbk; // Current error PIDout= PID (Err2) //PID output to generate Output_pulses = PWM (PIDout, Triwave);// PWM pulses } { fcount=fcount/10; Triwave = triwave [j]; j++; if (j>3) { j=0; } // Carrier wave running // in parallel } } Fig. 12. Load current result from the combination of PV and WT Current. Fig. 14. DK5.0/Handel-C Code for energy management controller This project, currently in its final stage of implementation, is being tested using a RC100 evaluation board (Agility, Fig. 15). Handel-C code synthesized into hardware, using a Xilinx Spartan 3 FPGA, generates the rapid prototype of a controller for the renewable energy management system. The final code for the controller, implemented onto the Spartan3 3S1500L-4 FPGA, has after compilation approximately 250K NAND gates equivalent, 1k FFs and 128 memory bits (Fig. 16). Fig. 13. Photovoltaic Array / Wind Turbine power control comparison Fig. 15. RC100 Evaluation Board (Agility) Fig. 16. DK5/Handel-C compilation report Further testing in a lab environment is currently being carried out on the test rig presented in Fig. 17. The testing uses an oscilloscope for monitoring output pulses for the power converters and a signal generator for Wind / Photovoltaic power source emulation. This work contributes to the large scale implementation of Distributed Energy Resources (DER), energy storage technologies and systems for grid connected applications and the development of key enabling technologies for distributed energy networks with high power quality and service security. A high quality output power under variable loading conditions for an autonomous system is another expected advantage of the applications using such a controller. REFERENCES [1] [2] [3] [4] [5] [6] Figure 17. FPGA simulation and testing VII. CONCLUSIONS This research paper presents a wind-photovoltaic integrated energy system controller, designed, modelled, simulated and tested using the DK5 Design Suite (Agility) design and modelling software environment based on Handel-C hardware synthesis programming language. The project achieves an integrated model of a distributed renewable power generation system that allows rapid prototyping of a global controller, targeted for FPGA implementation using Handel-C and the real-time verification RC100 (Agility) Spartan3 3S1500L-4 (Xilinx) FPGA development board. [7] [8] [9] [10] [11] [12] [13] [14] Blaabjerg, F, Teodorescu, R, Liserre, M and Timbus A V. 2006. Overview of Control and Grid Synchronization for Distributed Power Generation Systems. IEEE Transactions on Industrial Electronics. 53 (5), pp.1398-1409. Carrasco, J M et al. 2006. Power-Electronic Systems for the Grid Integration of Renewable Energy Sources: A Survey. IEEE Transactions on Industrial Electronics. 53 (4), pp.1002-1016. Edwards, S A. 2005. The Challenges of Hardware Synthesis from Clike Languages. In: Proceedings of Design Automation and Test in Europe. Munich, Germany. March 2005. Vol. 1, pp. 66- 67. Budiu, M and Goldstein, S C. 2002. Compiling Application-Specific Hardware. In: Proceedings of the 12th International Conference on Field Programmable Logic and Applications, FPL. September 2002.Montpellier, France, pp. 119-131. Agility Design Solutions Inc: www.agilityds.com Cirstea, M, Dinu, A, McCormick, M and Khor, J. 2002. Neural and Fuzzy Logic Control of Drives and Power Systems. Oxford: Newnes. Dettmer, R. Empowering Distributed Generation. The IEE Review, January 2003. Kennedy, M. Distributed Generation: Harder than it looks. The IEE: Power Engineer, February 2003. Fell, N. Distributing Power. The IEE: Power Engineer, June/July 2003. Markvart, T. Solar Electricity. UNESCO energy engineering series, Wiley, 2000. Gipe, P. Wind Power, James & James, 2004. Mohan, N. Undeland, T., Robbins, Power Electronics, Wiley, 2003. Das, D, Esmaili, R, Xu, L, Nichols, D. An Optimal Design of a Grid Connected Hybrid Wind / Photovoltaic / Fuel Cell System for Distributed Energy Production. The 31st Annual Conference of the IEEE Industrial Electronics Society, IECON, 2005, pp. 2499-2. Petrinec, K, Cirstea, M N. 2006. Holistic Modelling of a Fuel Cell Power System and FPGA Controller using Handel-C. In: Proceedings of Annual Industrial Electronics Conference (IECON’06) of IEEE Industrial Electronics Society, Paris, Nov. 2006, pp. 4951-4956.