82
Degree project An FPGA based MPPT and monitoring system suitable for a photovoltaic based microgrid Author: Rongpeng Zheng Supervisor: Pieternella Cijvat Examiner: Pieternella Cijvat Date: 19-05-28 Course code: 2ED34E, 15 hp Topic: Electrical Engineering Level: Bachelor of Science Department of Physics and Electrical Engineering Faculty of Technology

An FPGA based MPPT and monitoring system

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Regeldokument - Linnéuniversitetetmonitoring system
Author: Rongpeng Zheng
Supervisor: Pieternella Cijvat
Examiner: Pieternella Cijvat
Topic: Electrical Engineering
Engineering
Nowadays there is increased interest in microgrids based on renewable
sources, containing for example photovoltaic (PV) cells and wind power.
These microgrids may work in stand-alone mode ("islanding") or be
connected to the main grid. In both modes of operation, power quality must
be monitored and controlled.
This report focuses on microgrids and aims to implement a monitoring
system for microgrids, based on FPGA. Based on the monitoring system,
two applications could be achieved, firstly a PAS-MPPT algorithm in a DC-
DC boost converter to improve the maximun power point tracking, secondly
switching of grid mode, including detection of the grid mode (stand-alone or
connected to the main grid) as well as switching. Simulation results prove
that Verilog programs in FPGA are suitable to be used in microgrids.
3
Abstract
Microgrids containing photovoltaic (PV) cells and wind power gain more
and more interest. These microgrids may work in stand-alone mode
("islanding") or be conncted to the main grid. In both modes of operation,
power quality must be monitored and controlled.
This report focuses on microgrids and aims to implement a monitoring
system based on FPGA. In the monitoring system, two applications can be
achieved, firstly a PAS-MPPT algorithm in a DC-DC boost converter to
improve the maximun power point tracking of a PV unit, and secondly a
detection and switching system of the grid mode - stand-alone or connected
to the main grid. Simulation results prove the Verilog programs in FPGA are
suitable to be used in microgrids.
Keywords: Microgrids, Monitoring System, Maximum Power Point
Tracking (MPPT), Stand-alone Mode, Grid-connected Mode, FPGA,
Verilog HDL.
2. Monitoring system ___________________________________________ 9
2.2 Guideline for photovoltaic system monitoring .................................. 10
2.3 An piecewise adaptive step MPPT ...................................................... 11
2.4 V/f control ............................................................................................. 11
2.5 P-Q control ........................................................................................... 12
3. PAS-MPPT for the PV system _________________________________ 14
3.1 PV array characteristics ...................................................................... 14
3.2 Piecewise and adaptive step theory in PAS-MPPT ........................... 15
3.3 The flow chart of PAS-MPPT ............................................................. 16
4. Stand-alone mode switch _____________________________________ 17
5 FPGA ____________________________________________________ 18
5.2.1 Sensor out .................................................................................... 20
6. Simulation ________________________________________________ 27
7.1 Monitoring system ............................................................................... 29
7.3 Stand-alone mode detection and switching ........................................ 32
8. Discussion and conclusion ____________________________________ 35
References __________________________________________________ 37
1. Introduktion
1.1. Background
A microgrid is an integrated platform consisting of a low-voltage (LV)
distributed system with distributed energy resources (Fig. 1), for example,
microturbines, fuel cells, photovoltaic (PV) cells, and corresponding storage
units such as flywheels, energy capacitors and batteries. Besides, it also has
requirements such as different loads. For the characteristics of the microgrid,
it can be connected to a low voltage level, which means that it is usually at a
low voltage, and its total installed microgenerated capacity is lower than the
MW range, but it is also possible that part of the medium voltage (MV)
network is attached to the microgrid for interconnection [1]. However,
microgrids are also suitable to provide local electric power, in case there is
no national or regional grid or in case of interrupted power supply. On this
basis, the microgrid should have the ability to handle both grid-connected
and islanded state.
Fig. 1. Microgrid as a LV grid [1]
With the popular trend of microgrids, some parameters in microgrids need to
be monitored for improving their the operation and design [2], such as the
power delivered from the microgrid, the generated power of distributed
energy resource and the power quality.
There are many control algorithms used in microgrids, such as maximum
power point tracking(MPPT) [3] for PV systems, regulating a DC-DC boost
7
converter, or when the microgrid is in stand-alone mode, applying voltage-
frequecy (V/f) control, e.g in a DC-AD inverter, or lastly active power and
reactive power control (PQ control) in a DC-AC inverter when the PV
system is in grid-connected mode [4]. However, the prerequisite of
monitoring some parameters and using those algorithms is that they need
sensors for collecting information from the microgrid. Thus, implementing a
monitoring system for the microgrid is extremely necessary. It could collect
instantaneous voltage, current, frequency from the microgrid.The central
controller would get this information, use some equations to get some
monitoring parameters and give corresponding control signals to some
devices in the microgrid through control algorithms.
Based on the monitoring system, some control algorithms in microgrids can
be implemented. For example, traditional MPPT needs average output
current and voltage from PV arrays to generate pulse width modulation
(PWM) signals with corresponding duty cycle to quickly track the maximum
power point and ensure the PV system makes full use of its generation
power. Another example is a MPPT in wind-turbine generation system [5].
This algorithms needs to detect wind velocity and rotor speed of the wind
turbine from sensors to judge how the wind turbine input torque changes so
that the MPPT makes the wind turbine track the maximun power point and
maintain the ideal torque.
About the control center, the field-programmable gate arrays (FPGA) chip is
a good choice for its scalability, programmability and integration. Scalability
of FPGA chips is one of the advantages in microgrids, as modules in FPGA
chips are able to be reused when it satifies the requirements of input and
output. Parameters in programs are easy to change. For those reasons, FPGA
chips could be used in some extension to microgrids including larger
microgrids and control algorithms could handle multi-channel control.
Another advantage is that FPGA chips are programmable so that they could
update or improve the control algorithms at any time and be a testing
platform by programming [6]. In addition, FPGA chips could integrate the
functions of many kinds of components which makes the cost of
implementations less than digital signal processors (DSP) which just focuses
on digital processing [7].
The report focuses on implementing a monitoring system for microgrids.
Based on the monitoring system, there are some control algorithms that can
be achieved, such as a piecewise adaptive step MPPT (PAS-MPPT) in [3]
and stand-alone mode detection and switching based on FPGA. However, a
microgrid is a large system which is hard to build in hardware so that this
report will test the Verilog programs in FPGA by co-simulation of Simulink
and Modelsim. The model of microgrids in Simulink is limited to a grid-
connected PV system, which has the basic components as that in micorgrids.
8
Due to time restrictions, other algorithms such as V/f control, PQ control
and wind power control are not implemented.
1.3. Purpose and objectives
The aim of the report is to implement a monitoring system with a PV system
as example, and use data from the monitoring system to achieve the PAS-
MPPT algorithm. Moreover, stand-alone mode detection as well as
switching based on FPGA is to be implemented.
In order to achieve the above objectives, the following research questions
will be answered:
(1) Based on microgrids connection, PV system guidelines and applied
algorithms, which information needs to be monitored?
(2) Using the PV system as an example, how can the PAS-MPPT algorithm
be implemented and how does it perform?
(3) Can the stand-alone mode detection as well as switching be implemented?
(4) How to build the FPGA programs in Verilog HDL?
9
2.1 Basic components of a PV based microgrid
Fig. 2. A model of a microgrid based on a PV system [3]
Shown in Fig. 2 is model of a PV-based microgrid. It clearly shows the basic
components, such as solar array, battery storage, DC-DC boost converter,
DC-AC inverter, loads and utility grid1. For each part of the PV system, PV
array would produce power from solar energy whose maximun power could
be tracked by MPPT in the DC-DC boost converter. After the DC-DC boost
converter, the DC volatge would be provided to the battery storage and the
DC-AC inverter. The battery, in parallel to the DC-DC boost converter,
1 Wind power is not included in Fig. 2, however, if the wind power unit is including an AC-DC converter
(rectifier), the DC output could be connected similiar to the battery.
10
could absorb or inject active power by a bidirectional DC-DC converter. In
the DC-AC inverter, there are two control algorithms, V/f control in
standalone mode and PQ control or synchronous generator control in grid-
connected mode. Then, the whole PV system would provide three phase
volatge and current to the point of commom coupling (PCC) which is the
point connecting the utility grid, load and the microgird. Finally, there is a
breaker between the PCC and utility grid to make the microgird into stand-
alone system when the electricity from the microgird is not satisfying the
requirements of connecting utility grid.
2.2 Guideline for photovoltaic system monitoring
In [2], there is a guideline about how to judge if the design goals are met and
to improve the system design and operation through monitoring parameters
of a PV system. According to the a table of Recorded Parameters for
Analytical Monitoring, this report conbines with the Fig. 2 to get table I.
There are many parameters that need to be monitored for analysising the PV
system. This can be done by current trasformers and voltage transformers.
Table I: Monitor parameters based on system model
PARAMETER SYMBOL UNIT
Array output current
Converter output
The principle of the piecewise adaptive MPPT(PAS-MPPT) is explained
clearly in [3]. The MPPT needs two parameters: array output voltage(Vpv)
and array output current (Ipv) which are shown in Table I. The priciple of
PAS-MPPT will be explained in section 3 of the report.
2.4 V/f control
When the PV system is in stand-alone mode, the PV system lose the surport
voltage and frequency from the untility grid. Therefore,the load needs to
follow the frequency and voltage of the microgird which needs to maintain
frequency and voltage at PCC. In [4], it is explained how to achieve V/f
control. From Fig. 3, the algorithm needs the instantaneous voltage(vta, vtb,
vtc) and the instantaneous current (ica, icb, icc) at point of common coupling
(PCC) to get the power from DC-AC inverter (PAC measured), the frequency
(fa, fb, fc) from three phase DC-AC inverter and the average current and
power delivered to the DC-AC inverter (PDC).
Fig. 3. The V/f control diagram [2]
12
2.5 P-Q control
When the PV system is in grid-connected mode, PQ control is used to
improve the system performance so that the system could set the perfect
active power and reactive power from the PV system output and maintain
the system operation in the reference active and reactive power. In [4], the
active power (P) and reactive power (Q) could be defined by the following
equations:
1
2
Thus, the system needs the instantaneous voltage (vta, vtb, vtc) to get their
RMS value (Vt) at PCC and instantaneous current (vca, vcb, vcc) as the
output of the PV system to get their RMS value (Vc) after the DC-AC
inverter. The α in equation (1) and (2) is the phase angle between Vc and Vt.
The PQ control diagram is shown below. The system could set the value of
Pref as well as Qref and finally maintain the ideal output active and reactive
power.
2.6 Other monitoring parameters
There are other parameters for the microgrid (PV system) that can be
monitored, listed in Table II.
13
Other monitoring
converter
booster converter
Ica_rms RMS value of output current in the A
phase from DC-AC inverter
phase from DC-AC inverter
Vta RMS value of voltage in the A phase at
PCC
system
PV system
PV system
Rate_power_inverter Power conversion efficiency of DC-AC
inverter
Pload Load power consumption
14
3. PAS-MPPT for the PV system
The detailed priciple has been explained in [3]. This part will show the basic
priciples of PAS-MPPT.
3.1 PV array characteristics
The basic simplified boost circuit of the PV array is shown below in Fig. 5:
Fig. 5. Simplified boost converter in PV system
Then, Eq.(3) below shows how the ducy cycle affects the PV output power (Ppv):
(3)
R’L is the load resistance and RL is the resistance of the PV array. When the
duty cycle(D) of PWM signal is changed and a different PWM signal would
be sent to the IGBT, the power of the PV array (Ppv) will be changed. When
the D is a proper value, R’L will match RL so that Ppv will be the maximum
power produced by the PV array.
15
3.2 Piecewise and adaptive step theory in PAS-MPPT
The Ppv-D curve and dp/dD curve are shown in Fig. 6 Here, Ppv is the
output power of PV arrays and D is the duty cycle of PWM which is sent to
DC-DC boost converter. The Ppv-D curve shows the relationship between
the output D from PAS-MPPT and the output power of PV arrays. Then, the
dp/dD curve is the derivative curve from the Ppv-D curve. When D is
increased from 0 to 1, the dp/dD increase firstly, which is the B area but far
away from A area. When D continues to be increased, the second derivative
of P-D curve, Δ2P/ΔD2 is less than 0. From this point to the second
intersection point with M, the area is B area and close to A area. The A area
is limited by second and third intersection point with M. After the A area,
there are the same way to judge different area. According to different area
judgement, the calcution of the adaptive step of duty cycle is different in
these three areas in Fig. 7 ΔDmax is a large fixed step and ΔD0 is a small
fixed step. Based on this control algorithms, the speed of tracking would be
quickly baceuse of the large fixed step and the maximun point would be
precise without large oscillation because of the small step in A area.
Fig. 6. Three areas: A,B and C [5]
B, C area but far away from A
B, C area but close to A
A area
(3)
16
3.3 The flow chart of PAS-MPPT
Below is the flow char of PAS-MPPT. The PAS-MPPT of Verilog programs
would be based on Fig. 8 [3].
Fig. 8. The flow chart of PAS-MPPT [3]
17
4. Stand-alone mode switch
In [8], there are some recommended practices for a utility interface of
photovoltaic (PV) systems:
(1) RMS voltage Vta/Vtb/Vtc at PCC, any one should be 88-110% of the
rated voltage at the interface (in the simulation program, the RMS
voltage at the interface is 220V).
(2) When encountering voltage problems, the PV system will not enter the
island mode immediately which is dependent on the current voltage in
Table III. Table III is based on 120V, but this report uses 220V as a
reference. Cycles is the voltage acquisition period of 1 Vt (PCC voltage).
For example, when V<50%, if it has not returned to normal within the
specified 6 cycles, the PV system will enter the stand-alone mode.
Table III : Response to abnormal voltage [8]
Voltage (at PCC) Maximum trip time
V<50% 6 cycles
V≥137% 2 cycles
(3) The system output frequency and grid input frequency should be 59.3-
60.5Hz. If it exceeds 6 cycles or is out of range, it will enter the stand-
alone mode.
(4) If it is due to a grid fault and enters an island, it is necessary to detect
that the grid Vsa and frequency fsa have been in normal operation for at
least 5 minutes before the grid is restored.
(5) If the PV system is faulty, Vta/Vtb/Vtc+fa/fb/fc can be restored to the
grid after returning to the specified value for at least 5 minutes.
18
5 FPGA
In this part, the whole structure of the FPGA and each module will be shown.
The RTL view diagrams show the connection of each module and the
interconnection of each module. In addition, the block diagrams display the
input and output of each module.
5.1 Top-down design of FPGA
In Fig. 9, there is the module division for the FPGA which also shows the
call level. MPPT_test_tops is the top level and can call other mudules.
The second level inculdes clk_divider, sensor_out, fpga_calculation,
fifo_tops, MPPT module, pwm_gen and islandcheck. The clk_divider
module is used to generate different clock signals which are provided to
other modules for sampling, calculating and controlling the output signals.
Sensor_out module is used to receive the information from sensors. The
fpga_calculation module is used in calculating some parameters which need
to be calculated from the sensor information, such as the power of PV arrays
(Ppv). The fifo_tops (first input first output) could control the data flow in
order and make the output data steady. MPPT module is including the PAS-
MPPT algorithm which calls the multi_core for calculating the power of PV
arrays (Ppv). The pwm_gen could generate PWM signals with different duty
cycle and it uses triangual signals as fundamental wave. The island_chek can
judge the power quality from sensors and detemine if make the PV system
should get into stand-alone mode.
Fig. 9. Top-down design of the FPGA
In Fig. 10, the relationship between different modules is shown, including
the data width and data flow. Analog sensor from Simulink will send the
digital value to the FPGA chip. Two parameters, Ipv and Vpv of the PV
arrays, will go through the fifo_tops for controling the data flow to FPGA.
Then, the power calculation would receive the Ipv and Vpv from fifo_tops
module and send the power value of the PV arrays to MPPT. Finally, the
FPGA will generate PWM signals to the DC-DC boost converter, stand-
19
alone mode detection as well as switching and show all the parameters,
collected by analog sensors and calculated to chipscope to monitor values
changed in the Fig. 10.
Fig. 10. The FPGA block diagram
In Fig. 11, the synthesized register-transfer level (RTL) view for the FPGA
cjip shows the connection of each module and the data flow from the whole
system.
20
5.2 Modules in the FPGA
In this part, more details will be shown about Verilog programs and the RTL
view of each module. 5.2.1 Sensor out
This module is used to get the Ipv and Vpv from simulink. The Verilog
program is shown in Appendix 1. Its internal connection diagram is shown
in Fig. 12.
Fig. 12. The block diagram of Vpv and Ipv diagram 5.2.2 MPPT_module
The block diagram and the RLT view diagram of MPPT_mode is shown in
Fig. 13. Its Verilog program is in Appendix 2.
Fig. 13 (a). The block diagram of MPPT_module
21
5.2.3 The fifo_tops module
The block diagram of the fifo_tops module is shown in Fig. 14. Its Verilog
program is in Appendix 3.
Fig.14 (a) The block diagram of the fifo_tops module.
22
5.2.4 The clk_divider module
The block diagram and the RLT view diagram of the clk_divider module is
shown in Fig. 15. Its Verilog program is in Appendix 4.
Fig. 15 (a) The block diagram of the clk_divider module.
Fig. 15 (b) The RLT view diagram of the clk_divider module.
23
5.2.5 The pwm_gen module
The RLT view diagram of the the pwm_gen module is shown in Fig. 16. Its
Verilog program is in Appendix 5.
Fig. 16. The RLT view diagram of the pwm_gen module
5.2.6 The fpga_calculation module
The block diagram and a part of RLT view diagram of the the
fpga_calculation module is shown in Fig. 17. Its Verilog program is in
Appendix 6.
24
Fig.17 (b) A part of the RLT view diagram of the fpga_calculation module
5.2.7 The sensor_out module
The block diagram and a part of the RLT view diagram of the the sensor_out
module is shown in Fig. 18. Its Verilog program is in Appendix 7.
Fig.18 (a) The block diagram of the sensor_out module.
25
Fig.18 (b) A part of the RLT view diagram of the sensor_out module.
5.7.8 The islandcheck module
The block diagram and a part of the RLT view diagram of the the
islandcheck module is shown in Fig. 19. Its Verilog program is in Appendix
8.
26
Fig.19 (b) The RLT view diagram of the islandcheck module
27
6. Simulation
Because a real environment to test the project is lacking, co-simulation of
Simulink and Modelsim is used in this report. The simulation method is
explained below.
Firstly, a model of a three phase grid-connected PV system is built in
Simulink. It is shown in Fig. 20 and is based on Fig. 2.
Fig. 20. A model of a three phase grid-connected PV system
In the simulink model, the PAS-MPPT and synchronous generator control
are used for tracking maximun power point and making the voltage output
of the PV system follow the untility voltage. The simulation conditions are T
= 25 , S = 1000 W/m2 at t=0s, S = 1200 W/m2 at t=0.05s and S = 1400
W/m2 at t=0.09s. It is assumed that PV cells have an efficiency of 16-17%
and an area of 50 m2. Thus, the maximum power from the PV is 8000W,
10000W and 12000W. After the first simulation, the sensor data from
simulink would be collected to the FPGA chip.
Then, three functions can be achieved, monitoring system, PAS-MPPT and
stand-alone dection as well as switching.
For the monitoring system, the FPGA can get the sensor information from
the simulink which will go through fpga_calculation and sensor_out module.
Then the FPGA would send those data to Chiscope. The sensor information
and parameters in Section 3 will be shown in Chiscope.
For PAS-MPPT, the same algorithm is used in Simulink and the FPGA so
the output duty cycle of PWM signals in the FPGA would be approximately
the same as in Simulink. The output duty cycle and the input Ipv and Vpv
28
correspond in time. Thus, this step provides the right sensor information to
the FPGA. Then, the output file of PWM signals in the FPGA can be saved
and be used in the Simulink model without PAS-MPPT. In this way,
comparing the Ppv-t curve will prove whether the PAS-MPPT programs in
FPGA is effective.
For stand-alone detection and switching, the corresponding value from
sensors in section 4 can be changed in modelsim and it can be checked
whether the programs work. After resetting the programs, the value of
voltage Vta or frequency fa in a signal phase at PCC is changed at t=3300 ns.
Moreover, the rated RMS voltage of the model at PCC is 220V. Then the
modelsim simulation will show the cnt, signal and breaker, which are
counting the acquisition clocks, showing the unnormal situation and
disconnecting from the utility grid respectively. There are 6 situations to test
the module below [8]:
(1) Vta <50%*220V: After 6 acquisition clocks, if the Vta collected by each
sensor is still <50%*220V, then the signals of Signal_1 =1 and breaker =1
are given. (Signal_1=1 means that the detected fault is Vta <50%*220V,
initial Signal_1 =0)
(2) 50%*220V<=Vta <88%*220V: After 120 acquisition clocks, and if the
Vta collected by each clock is still within the range of 50%*220V and
88%*220V, then Signal_2 =1 and breaker =1.
(3) 110%*220V<Vta <137%*220V: After 120 acquisition clocks, if the Vta
collected by each clock is still within the range of 110%*220V and
137%*220V, then Signal_3 =1 and breaker =1.
(4) Vta >=137%*220V: After 2 acquisition clocks, if the Vta collected by
each clock is still more than 137%*220V, then Signal_4 =1 and breaker =1.
(5) fa<59.3Hz or >60.5Hz: After 6 acquisition clocks, if each clock is still
outside the specified range, then Signal_5 =1 and breaker =1 will be given.
(6) Restore to grid-connected mode: When Vta and fa are within the
specified range for 5 minutes, then Signal_6 =1, breaker =0 and Signal_1~5
=0.
29
7. Results and analysis
In this section, some simulation results are shown based on the method of
section 6.
30
From fig. 21-23, output power of the PV arrays, the active power and
reactive power of the PV system can be minitored by FPGA and the curves
can be shown in Chipscope.
7.2 PAS-MPPT algorithm in PFGA
From the first simulation in simulink, Fig. 24 is obtained which shows the
duty cycle of PWM signal (D), power (Ppv), voltage (Vpv) and current (Ipv)
of the PV arrays.
31
From the second simulation, with the PWM file from the FPGA, Fig. 25. is
obtained.
Fig. 25. Second simulation result in simulink,with the FPGA
From these figures, the reponding time is 0.02s from the beginning at S =
1000 W/m2. Then, the S is changed to 1200W/m2, suddently but the
maximun power point tracking is very fast so that it is hard to see what is the
exact time it takes to track. Comparing these two figure, the result of second
simulation shows a little bit more ripple which is caused by the harware of
the FPGA and is unavoidable. The oscillation error is approximately 50W
which is just 0.5% at S = 1000 W/m2. Moreover, the efficiency of the
tracking maximum power point is 99.4% at S = 1000 W/m2. In conclusion,
this method to test the programs in FPGA is feasible and obtains the
approximate same result as the software simulation. That means the PAS-
MPPT in FPGA will work in a real system.
32
7.3 Stand-alone mode detection and switching
In this part, there are six figures from modelsim corresponding to six
situations in section 6.
From the Fig. 26, the o_cnt1 starts to count the 6 acquisition clocks, but the
the value of Vta is still less than 50%*220V so the o_signal1 and o_breaker
turn to 1 which mean the abnormal situation is Vta is less than 50%*220V
and the breaker in the untility side would be switched off with the help of a
ralay.
Fig. 26. Simulation result of Vta <50%*220V
From the Fig. 27, the o_cnt2 starts to count the 120 acquisition clocks, but
the value of Vta is still within the range of 50%*220V and 88%*220V so
the o_signal2 and o_breaker turn to 1.
Fig. 27. Simulation result of 50%*220V<=Vta <88%*220V
33
From the Fig. 28, the o_cnt3 starts to count the 120 acquisition clocks, but
the value of Vta is still within the range of 110%*220V and 137%*220V so
the o_signal3 and o_breaker turn to 1.
Fig. 28. Simulation result of 110%*220V<Vta <137%*220V
From the Fig. 29, the o_cnt4 starts to count the 2 acquisition clocks, but the
value of Vta still exceeds 137%*220V so the o_signal4 and o_breaker turn
to 1.
34
From the Fig. 30, the o_cnt5 starts to count the 6 acquisition clocks, but the
value of fa is still out of the boundary so the o_signal5 and o_breaker turn to
1.
Fig. 30. Simulation result of fa<59.3Hz or >60.5Hz
From the Fig. 31, based on the Fig. 26, the value of Vta is normal at 5500 ns.
Then, the o_cnt6 starts to count the 1000 acquisition clocks which is on
behalf of five minutes. When the value of Vta is still normal after 1000
acquisition clocks, the o_signal6 turns to 1 but o_breaker turns to 0.
Fig. 31. Simulation result of restoring to grid-connected mode
35
8. Discussion and conclusion
Based on the good simulation results, the research questions are solved in
different sections of the report.
Section 2 solves the problem about how to implement a monitoring system
in microgrids with the example of a PV system. Guidelines show the
information that needs to be monitored in PV plants. Some control
algorithms, such as MPPT, V/f control and PQ control, ask for some
parameters as inputs. Those sensor information and parameters compose the
monitoring system in the microgrid. In the presented implementation,
Chipscope shows those parameters in figures.
Scetion 3 explains how to achieve the PAS-MPPT based on the monitoring
system and make full use of the generation power in microgrids with the
example of the PV system. Firstly, this section shows the characteristic of
PV arrays and how the duty cycle of PWM signals affects the output power.
Then, the piecewise and adaptive step theory are explained in detail. Finally,
the flow chart of PAS-MPPT can guide how to write the Verilog programs.
Therefore, comparing with the figures of the first simulation with MPPT, the
figures of Ppv show the Verilog programs work successfully and can be
used in a real system.
Section 4 shows some standards about when grid-connected microgrids
should be switched off. There are four situations with regard to the abnormal
voltage at PCC and one situation for abnormal frequency. The FPGA chip
can get the sensor information from the microgrid, judge whether the system
should be disconnected from the utility grid and how long it takes. As the
results of simulations show, the FPGA chip can detect the islanding
requirements or restoring requirements and send the breaker signal to switch
off or on the grid-connected mode. However, due to time constraints in the
project, V/f control in the PV model is not implemented so the system can
not recover the voltage and frequency in the normal range automatically.
Section 5 shows how to implement the above functions in the FPGA chip.
The top-down design shows the modules and their calling level. The block
diagram shows the relationship between modules. Moreover, the Verilog
programs and block diagrams of each module show how to implement the
Verilog programs in the FPGA chip.
In conclusion, the monitoring system is implemented and two application,
MPPT and stand-alone detecion as well as switching, are achieved. The
Verilog programs in the FPGA chip can be used in real microgrids because
of the good simulation results. In the future, the Verilog programs in the
report could be resued or more programs can be added for monitoring more
parameters or implementing more control algorithms to update the microgrid
system.
36
37
References
Architectures and Control. New York: John Wiley & Sons, Incorporated,
2014, ch.1, sec.1.3, pp. 4-5.
[2] G. Blaesser and D. Munro, “Guidelines for the assessment of
photovoltaic plants : Document A: Photovoltaic System Monitoring,”
European commission: Institute for Systems Engineering and Informatics,
Rep. EUR 16338 EN, 1995.
[3] Y. Xue et al., “A new piecewise adaptive step MPPT algorithm for PV
systems,” in 2017 12th IEEE Conf. on Industrial Electronics and
Applications, Siem Reap, Cambodia, 2017, pp. 1652-1656.
[4] S. Adhikari, F. Li, “Coordinated V-f and P-Q Control of Solar
Photovoltaic Generators With MPPT and Battery Storage in Microgrids,”
IEEE Trans. on Smart Grid, vol. 5, no. 3, pp. 1270 -1281, May 2014.
[5] Y. Chen, “Grid-connected and control of MPPT for wind power
generation systems based on the SCIG,” in 2010 2nd International Asia
Conference on Informatics in Control, Automation and Robotics (CAR
2010), Wuhan, China, 2010, pp. 51-54.
[6] A. Messai et al., “FPGA-based implementation of a fuzzy controller
(MPPT) for photovoltaic module,” Energy Conversion and Management,
vol. 52, iss. 7, pp. 2695-2704, Jul. 2011.
[7] H. Mekki et al., “FPGA-Based implementation of a real time
photovoltaic module simulator,” Prog. Photovolt: Res., vol. 18, iss. 2, pp.
115–127, Appl. 2010.
[8] IEEE Recommended Practice for Utility Interface of Photovoltaic (PV)
Systems, IEEE Standard 929, 2000.
38
39
Appendix 2: The Verilog code of MPPT_module
Appendix 3: The Verilog code of fifo_tops
Appendix 4: The Verilog code of clk_divider
Appendix 5: The Verilog code of pwm_gen
Appendix 6: The Verilog code of fpga_calculation
Appendix 7: The Verilog code of sensor_out
Appendix 8: The Verilog code of islandcheck
Appendix 1 The Verilog code of Ipv and Vpv
module sensor_out2(
module MPPT_module(
);
begin
if(i_rst)
begin
reg signed[31:0]Pk1;
reg signed[15:0]Uk1;
reg signed[15:0]Uref;
begin
if(i_rst)
begin
begin
if(i_rst)
begin
Uref <= Uref +
{dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15:6]};
o_state <= 2'd0;
Uref <= Uref -
{dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15
:6]};
Uref <= Uref -
{dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15
:6]};
Uref <= Uref +
{dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15],dU0[15
:6]};
begin
if(i_rst)
begin
dU0<= {16'd16};
module fifo_tops(
begin
if(i_rst)
begin
.wr_en (1'b1), // input wr_en
.rd_en (flag), // input rd_en
10
.wr_en (1'b1), // input wr_en
.rd_en (flag), // input rd_en
.full (), // output full
.almost_full (), // output almost_full
.empty (), // output empty
.almost_empty() // output almost_empty
module clk_divider(
begin
if(i_rst)
begin
assign o_clock3 =~cnt[0];//cnt[10];
endmodule
// pwm-gen top level
input i_clk;
input i_rstn;
begin
begin
begin
begin
module fpga_calculation(
output signed[31:0]o_Rate_power_inverter;
output signed[31:0]o_Rate_loss;
output signed[31:0]o_Pload;
output signed[31:0]o_Pg;
// Ppv of PV arrays
);
// Pdc of the output power of the DC-DC booster converter
multi_core multi_core_u2(
22
//----------- Begin Cut here for INSTANTIATION Template ---// INST_TAG
divider divider_u3 (
.dividend(o_Pdc), // input [31 : 0] dividend
.divisor({o_Ppv[31],o_Ppv[31],o_Ppv[31],o_Ppv[31],o_Ppv[31],o
_Ppv[31],o_Ppv[31:6]}), // input [31 : 0] divisor
.quotient(o_Rate_boost), // output [31 : 0] quotient
.fractional()
);
multi_core multi_core_u5(
);
FPGA
assign
o_Icarms={Icarms[15],Icarms[15],Icarms[15],Icarms[15],Icarms[15],Icarms
[15],Icarms[15],Icarms[15],Icarms[15],Icarms[15],Icarms[15],Icarms[15],Ic
arms[15],Icarms[15],Icarms[15],Icarms[15],Icarms};
// Vca_rms the output RMS voltage value of the A phase
wire signed[15:0]Vcarms;
assign
o_Vcarms={Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],
Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],
Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],Vcarms[15],Vcarms};
// Vta the RMS voltage value of the A phase at PCC
wire signed[15:0]Vtarms;
assign
o_Vtarms={Vtarms[15],Vtarms[15],Vtarms[15],Vtarms[15],Vtarms[15],Vta
rms[15],Vtarms[15],Vtarms[15],Vtarms[15],Vtarms[15],Vtarms[15],Vtarms
[15],Vtarms[15],Vtarms[15],Vtarms[15],Vtarms[15],Vtarms};
// active power P of the PV system
wire signed[15:0]P;
assign
o_P={P[15],P[15],P[15],P[15],P[15],P[15],P[15],P[15],P[15],P[15],P[15],P[
15],P[15],P[15],P[15],P[15],P};
// reactive power Q of the PV system
wire signed[15:0]Q;
assign
o_Q={Q[15],Q[15],Q[15],Q[15],Q[15],Q[15],Q[15],Q[15],Q[15],Q[15],Q[1
5],Q[15],Q[15],Q[15],Q[15],Q[15],Q};
// apparent power S of the PV system
assign o_S = o_P+o_Q;
assign
o_alpha={alpha[15],alpha[15],alpha[15],alpha[15],alpha[15],alpha[15],alph
a[15],alpha[15],alpha[15],alpha[15],alpha[15],alpha[15],alpha[15],alpha[15]
,alpha[15],alpha[15],alpha};
//rate of loss power in the Inverter
divider divider_u4 (
.dividend(o_Pii), // input [31 : 0] dividend
.divisor({o_Pdc[31],o_Pdc[31],o_Pdc[31],o_Pdc[31],o_Pdc[31],o_
Pdc[31],o_Pdc[31:6]}), // input [31 : 0] divisor
.quotient(o_Rate_power_inverter), // output [31 : 0] quotient
.fractional()
wire signed[31:0]Rate_loss;
.dividend(o_Pii), // input [31 : 0] dividend
.divisor({o_Ppv[31],o_Ppv[31],o_Ppv[31],o_Ppv[31],o_Ppv[31],o
_Ppv[31:5]}), // input [31 : 0] divisor
.quotient(Rate_loss), // output [31 : 0] quotient
.fractional()
);
// Pg from grid
);
endmodule
26
module sensor_out(
module islandcheck2(
//3
34
begin
if(i_rst)
begin
begin
o_breaker <= 1'b1;
if(r_signal6 ==1'b1)
o_breaker <= 1'b0;
Tel 0772-28 80 00