<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://projectswiki.eleceng.adelaide.edu.au/projects/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=A1757608</id>
	<title>Projects - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://projectswiki.eleceng.adelaide.edu.au/projects/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=A1757608"/>
	<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php/Special:Contributions/A1757608"/>
	<updated>2026-04-21T18:26:40Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.4</generator>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14985</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14985"/>
		<updated>2020-06-09T01:09:11Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* LabView Data Display */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
== IQ Demodulation ==&lt;br /&gt;
[[File:Quarter.png|thumb]]&lt;br /&gt;
To obtain real and imaginary information of the phasor the input waveform needs to be down-convert&lt;br /&gt;
ed. The IQ down-conversion will utilise quadrature signals that generated from the previous sections. The process of IQ down-conversion will cause the signals to be in the baseband region. &lt;br /&gt;
 &lt;br /&gt;
The digitised 16 bits input from the ADC is multiplied with quadrature signals generated from the LuT. The multiplication process utilises the 18-bit x 18-bit embedded multiplier inside the MAX10. Although there many multiplication algorithms that can be implemented such as Booth multiplication algorithms, using the embedded multiplier prove to be the easiest to implement. The embedded multipliers take account the signed integer during the multiplication process. There no need for an extra algorithm to sort the signed bits for the multiplication.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== FLL Results ===&lt;br /&gt;
&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14984</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14984"/>
		<updated>2020-06-09T01:07:17Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* LabView Data Display */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
== IQ Demodulation ==&lt;br /&gt;
[[File:Quarter.png|thumb]]&lt;br /&gt;
To obtain real and imaginary information of the phasor the input waveform needs to be down-convert&lt;br /&gt;
ed. The IQ down-conversion will utilise quadrature signals that generated from the previous sections. The process of IQ down-conversion will cause the signals to be in the baseband region. &lt;br /&gt;
 &lt;br /&gt;
The digitised 16 bits input from the ADC is multiplied with quadrature signals generated from the LuT. The multiplication process utilises the 18-bit x 18-bit embedded multiplier inside the MAX10. Although there many multiplication algorithms that can be implemented such as Booth multiplication algorithms, using the embedded multiplier prove to be the easiest to implement. The embedded multipliers take account the signed integer during the multiplication process. There no need for an extra algorithm to sort the signed bits for the multiplication.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== LabView Data Display ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;gallery&amp;gt;&lt;br /&gt;
Example.jpg|Caption1&lt;br /&gt;
Example.jpg|Caption2&lt;br /&gt;
&amp;lt;/gallery&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== FLL Results ===&lt;br /&gt;
&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14983</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14983"/>
		<updated>2020-06-09T01:06:49Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
== IQ Demodulation ==&lt;br /&gt;
[[File:Quarter.png|thumb]]&lt;br /&gt;
To obtain real and imaginary information of the phasor the input waveform needs to be down-convert&lt;br /&gt;
ed. The IQ down-conversion will utilise quadrature signals that generated from the previous sections. The process of IQ down-conversion will cause the signals to be in the baseband region. &lt;br /&gt;
 &lt;br /&gt;
The digitised 16 bits input from the ADC is multiplied with quadrature signals generated from the LuT. The multiplication process utilises the 18-bit x 18-bit embedded multiplier inside the MAX10. Although there many multiplication algorithms that can be implemented such as Booth multiplication algorithms, using the embedded multiplier prove to be the easiest to implement. The embedded multipliers take account the signed integer during the multiplication process. There no need for an extra algorithm to sort the signed bits for the multiplication.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
=== LabView Data Display ===&lt;br /&gt;
[[File:LabView Interface.png|thumb]]&lt;br /&gt;
&lt;br /&gt;
=== FLL Results ===&lt;br /&gt;
&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=File:LabView_Interface.png&amp;diff=14982</id>
		<title>File:LabView Interface.png</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=File:LabView_Interface.png&amp;diff=14982"/>
		<updated>2020-06-09T01:06:43Z</updated>

		<summary type="html">&lt;p&gt;A1757608: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;LabView interface with FPGA to view Voltage, Phase , Frequency, RoCoF&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14981</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14981"/>
		<updated>2020-06-09T01:04:02Z</updated>

		<summary type="html">&lt;p&gt;A1757608: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
== IQ Demodulation ==&lt;br /&gt;
[[File:Quarter.png|thumb]]&lt;br /&gt;
To obtain real and imaginary information of the phasor the input waveform needs to be down-convert&lt;br /&gt;
ed. The IQ down-conversion will utilise quadrature signals that generated from the previous sections. The process of IQ down-conversion will cause the signals to be in the baseband region. &lt;br /&gt;
 &lt;br /&gt;
The digitised 16 bits input from the ADC is multiplied with quadrature signals generated from the LuT. The multiplication process utilises the 18-bit x 18-bit embedded multiplier inside the MAX10. Although there many multiplication algorithms that can be implemented such as Booth multiplication algorithms, using the embedded multiplier prove to be the easiest to implement. The embedded multipliers take account the signed integer during the multiplication process. There no need for an extra algorithm to sort the signed bits for the multiplication.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
=== FLL Results ===&lt;br /&gt;
&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=File:Quarter.png&amp;diff=14980</id>
		<title>File:Quarter.png</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=File:Quarter.png&amp;diff=14980"/>
		<updated>2020-06-09T01:03:34Z</updated>

		<summary type="html">&lt;p&gt;A1757608: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Quarter wave waveform is used in the LUT to save resource .&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14976</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14976"/>
		<updated>2020-06-09T00:57:44Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* FLL RESULTs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
=== FLL Results ===&lt;br /&gt;
&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14974</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14974"/>
		<updated>2020-06-09T00:57:03Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
== FLL RESULTs ==&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14969</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=14969"/>
		<updated>2020-06-09T00:55:10Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Phasor Measurement Units (PMUs) are used by the power industry to measure Voltage, Phase, Frequency and Rate of Change of Frequency (RoCoF) of the power system. The IEEE standard requires these measurements to be available within 2 mains cycles (40 mS) of the waveform sampling time. These PMU’s are an integral part of keeping the power system stable  by controlling circuit breakers  and generator settings in a high level of renewable power supply  grid. Implementing the PMU algorithm in an FPGA is required to ensure the speed of operation and reliability required for this critical instrumentation.During 2018, Dr. Kikkert used Matlab to develop an algorithm to perform the PMU calculations quicker and with better accuracy than is possible at present. Hardware to digitise the 3 phase mains voltages has just been completed by Thesis students. This  project  aims  to  implement  the  floating  point Matlab  algorithm  as  a  fixed point  algorithm  on  a  DE10-Lite  FPGA development board from Terasic, using VHDL or Verilog. The code to be produced is to read the data from the digital to analogue converters on the existing hardware, calculate  the  Voltage, Phase, Frequency and RoCoF and send this data to a computer to be displayed using existing Labview code.As a second priority task, for higher grades,  the  same FPGA board is to be  used with an available GPS receiver and existing hardware to produce a GPS time stamp for the Voltage, Phase, Frequency and RoCoF data. &lt;br /&gt;
&lt;br /&gt;
=== Project Group 25601 === &lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* Junwen Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar&lt;br /&gt;
&lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Dr. Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
This project aims to achieve goals as follow:&lt;br /&gt;
&lt;br /&gt;
 1. To produce a fully working Phasor Measurement Unit.&lt;br /&gt;
 2. Implement floating point Matlab algorithm in FPGA.&lt;br /&gt;
 3. Calculate Voltage ,Phase , Frequency and RoCoF with a GPS time stamp.&lt;br /&gt;
 4. Meet the requirement of IEEE/IEC standards.&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Project Overview&lt;br /&gt;
[[File: Overview of the project.png|thumb|Project Overview]]&lt;br /&gt;
Three-phase 50 Hz waveforms are applied to the analogue input of the hardware circuit that was designed by Kikkert. The hardware includes a 6 channel ADC chip with 16 bits accuracy. The waveforms are sampled by the ADC chip at 10 kHz sampling rate for a 50 Hz main and can be changed to 60 Hz mains. The frequency lock loop circuit that synchronized with the GPS provides accurate sampling frequency for the ADC. The waveforms sampled by the ADC chip are digitised as 16 bits twos-complement. &lt;br /&gt;
Digitised waveforms are shifted to the baseband signal by multiplying with the 50 Hz quadrature signal (Cosine and Sine) that generated by the oscillator which is synchronized with the GPS. The quadrature signals are digitally synthesized by Lookup Table (LuT). The nominal quadrature signals are created for each phase A, B, and C with ± 120° phase difference with each phase. I and Q signals produced by the multiplication are filtered using averaging filters. The voltage magnitude is obtained from equation (1):&lt;br /&gt;
	V=√(I^2+Q^2  )	(1)&lt;br /&gt;
The phase is obtained from equation (2):&lt;br /&gt;
	Phase=atan⁡(I/Q)	(2)&lt;br /&gt;
. The square root and inverse function to calculate voltage and phase are achieved in FPGA using interpolation. The calculated voltage magnitude and phase are filtered with IIR filter to attenuate the 2nd order harmonic and above. To get the accurate voltage magnitude, voltage correction is implemented due to the Sinc function of the rectangular filter. The frequency value of the phasor is calculated by doing a differentiation of the phase value. The RoCoF is calculated by differentiation of the calculated frequency. The values of Voltage, Frequency, RoCoF, and timestamp are displayed on Labview.&lt;br /&gt;
&lt;br /&gt;
== IIR Filter ==&lt;br /&gt;
[[File:IIR block diagram.png|300px|thumb|right|Block diagram of a second order IIR filter]]&lt;br /&gt;
&lt;br /&gt;
This topic presents the development of the IIR filter towards the implementation of FPGA.&lt;br /&gt;
The algorithm of the filter is designed by Adjunct A/Prof. C.J. Kikkert in MATLAB that suited&lt;br /&gt;
to implementation in an FPGA. The paper wrote by him proves that the filter utilise fewer&lt;br /&gt;
resources compared to the reference Finite Impulse Response (FIR) in the IEC/IEEE&lt;br /&gt;
standard 60255-118-1:2018 Part 118-1: Synchrophasor measurements for power&lt;br /&gt;
systems. This section shows the VHDL routines designed in the Quartus Prime software&lt;br /&gt;
based on the MATLAB algorithm. VHDL is a hardware description language used to&lt;br /&gt;
program the FPGA board. The IIR filter will make use of the IEEE 754 floating-point&lt;br /&gt;
standard. The operations are carried on mantissa, exponents, and sign components. This&lt;br /&gt;
includes the routine to convert the filter coefficients from the algorithms in a signed&lt;br /&gt;
floating-point format.&lt;br /&gt;
&lt;br /&gt;
=== Literature Review ===&lt;br /&gt;
Agarwal, Verma, Tiwari et al. [6] only used the anti-aliasing filter in their PMU design. Ref&lt;br /&gt;
[7] designing a virtual PMU to interact with the real-time simulators as a way emulating&lt;br /&gt;
the large number of real-life PMUs. They used the anti-aliasing filter to filter out the&lt;br /&gt;
voltage and current analog inputs before the computation begins. Ref [8] reports that&lt;br /&gt;
their PMU design is using the window method of FIR filter. The performance of the filter&lt;br /&gt;
is investigated based on out of band rejection, noise, and harmonic elimination. The sixth&lt;br /&gt;
order IIR filter in this project satisfies all the IEC/IEEE standard limit at 48 Hz main&lt;br /&gt;
frequency&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
=== Implementation of IIR Filter ===&lt;br /&gt;
[[File:Single Precision IEEE 754 Floating-Point Standard.png|300px|frame|centre|Single Precision IEEE 754 Floating-Point Standard]]&lt;br /&gt;
 &amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point addition operation ====&lt;br /&gt;
&lt;br /&gt;
      The addition operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. Smaller exponent number is rewritten to match with the larger exponent number.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. Adding of the mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the sum and checking process for the underflow and overflow.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Rounding the sum.&lt;br /&gt;
&lt;br /&gt;
The state machine of the addition operation is explained here. The operation is halted and&lt;br /&gt;
wait for the request signal goes high. If the signal is true, the input will enter exponent&lt;br /&gt;
alignment process. The exponents of both input signals are set as unsigned&lt;br /&gt;
std_logic_vector to make the comparison. The mantissa that having smaller exponent&lt;br /&gt;
value will be downshifted based on the different value of the comparison. To do the&lt;br /&gt;
comparison, the unsigned exponent value is converted to signed value. Then, the&lt;br /&gt;
downshifting of the mantissa is done in integer form of the exponent different.&lt;br /&gt;
In normalisation process, the overflow sum is downshifted by dropping the least&lt;br /&gt;
significant bit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
==== Floating point multiplication operation ====&lt;br /&gt;
&lt;br /&gt;
      The multiplication operation is performed based on the steps as follows:&lt;br /&gt;
&lt;br /&gt;
        1. The addition of exponents to find new exponent. The biased exponents are added&lt;br /&gt;
           twice and need to subtract it once afterward to compensate.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        2. The multiplication of mantissas.&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        3. Normalise the product.14&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        4. Round the result.&lt;br /&gt;
&lt;br /&gt;
The operation starts when the request input signal goes high. The inputs are loaded and&lt;br /&gt;
are multiplied with each other. Then, the normalisation process is done. Here, the&lt;br /&gt;
overflow of the product is checked. The result will in the form of sign, exponent, and&lt;br /&gt;
mantissa.&lt;br /&gt;
&lt;br /&gt;
=== Establishing FPGA Communication to host PC ===&lt;br /&gt;
[[File:FPGA to PC block diagram.png|300px|frame|center|FPGA to PC block diagram]]&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
The FPGA communication to host PC is established by using JTAG to Avalon MM Bridge&lt;br /&gt;
embedded IP core provided in Quartus Prime Lite. The block diagram shown in Figure&lt;br /&gt;
is the design approach that is used to establish the communication link between the DE10&lt;br /&gt;
board and the host PC. The design required the Altera serial JTAG cable (USB-Blaster)&lt;br /&gt;
connected between the JTAG port on the board and a host computer running the Quartus&lt;br /&gt;
Prime Programmer for the duration of the hardware duration period. &lt;br /&gt;
&lt;br /&gt;
[[File:Platform Designer.png|300px|thumb|centre|Platform Designer]]&lt;br /&gt;
The first step is to create the hardware part of the block diagram. The block diagram&lt;br /&gt;
shown in Figure aboce can be instantiated in Platform Designer (Quartus Prime Menu &amp;gt; Tools&lt;br /&gt;
&amp;gt; Platform Designer). Figure here shows a complete structure of the big block in Figure above designed&lt;br /&gt;
in the Platform Designer. Noted that, JTAG to Avalon Master Bridge is the only master and&lt;br /&gt;
other peripherals are the slaves. By assigning the unique base addresses for each of the&lt;br /&gt;
components, the interaction between them can simply be done by calling the specific&lt;br /&gt;
address of the peripheral and the master component can read or write the instruction.&lt;br /&gt;
The read and write are done in System Console or Tcl script.&lt;br /&gt;
&lt;br /&gt;
=== Global Positioning System ===&lt;br /&gt;
&lt;br /&gt;
Timestamp:The timestamp is the process of displaying the dte and time on the hardware. Receiving  a message containing a time stamp on the UART interface. Decode the received message in accordance with the NMEA-0183 protocol. Make a multiplexer to switch between the time stamp and the current date stamp. And also convert the data to code 7 of the segment indicator on the FPGA.&lt;br /&gt;
Frequency Lock Loop(FLL):		 	 	 		Locking a desired frequency using PID algorithm since the PID algorithm can compare the measured value with the desired value and out in automatic control. measure the frequency of the VCXO generator. Calculate the frequency error and determine the following DAC value using the PID algorithm. Transfer data to the DAC. &lt;br /&gt;
10Mhz Generator: There is a 20mhz crystal control voltage oscillator on the printed circuit board, a 10mhz is required to be measured  from the BNC connector, therefore a division of 2 algorithm will be performed.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
The result of 10 mhzs generation is shown below &lt;br /&gt;
[[File:DDF741B8-92B4-4A21-B3EA-535069D6F1D4 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of DAC sawtooth waveform is shown below &lt;br /&gt;
[[File:91F904F0-21DA-48C4-B0B2-073DC2BF7505 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the FLL is shown below&lt;br /&gt;
[[File:62668430-3528-4145-BCD4-E46A3716EDE8.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
The result of the time/date stamp are displayed below&lt;br /&gt;
[[File:0C129181-DEFC-44F4-86E1-E55D648C6D7F 4 5005 c.jpg|thumb]]&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
The DAC sawtooth waveform, 10 Mhz desired frequency generation and the time/date stamp have been successfully achieved, however, the frequency lock loop was not locking for the 20 Mhz due to the harmonics interference. A smaller capacitor should be considered for C80 since C83 is 100 time bigger then the DAC waveform could be smoothed out and the triangular waveform could not be observe when the jumper is on pin 2 and 3 of JP1&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=File:Overview_of_the_project.png&amp;diff=14967</id>
		<title>File:Overview of the project.png</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=File:Overview_of_the_project.png&amp;diff=14967"/>
		<updated>2020-06-09T00:53:52Z</updated>

		<summary type="html">&lt;p&gt;A1757608: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The project consists of multiple-stages which are IQ modulation, Averaging Filter, Phase and Voltage Calculation and IIR filter and lastly communication to computer&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12861</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12861"/>
		<updated>2019-09-21T11:44:19Z</updated>

		<summary type="html">&lt;p&gt;A1757608: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Phasor Measurement Unit(PMU) is essential in the power industry in order to maintain the stability of the power network. Thus a need for a PMU that has a very high precision is a must. This project will try to implement a Matlab algorithm that was created by Prof C.J Kikkert into FPGA&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Project description here&lt;br /&gt;
&lt;br /&gt;
=== Project team ===&lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* JunWeng Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar &lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
==== Advisors ====&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
Set of objectives&lt;br /&gt;
To Implement floating-point algorithm as fixed-point algorithm in FPGA&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Topic 1 ===&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12817</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12817"/>
		<updated>2019-09-19T10:01:40Z</updated>

		<summary type="html">&lt;p&gt;A1757608: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Abstract to be added&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Project description here&lt;br /&gt;
&lt;br /&gt;
=== Project team ===&lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* JunWeng Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar &lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
==== Advisors ====&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
Set of objectives&lt;br /&gt;
To Implement floating-point algorithm as fixed-point algorithm in FPGA&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Topic 1 ===&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12816</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12816"/>
		<updated>2019-09-19T10:00:30Z</updated>

		<summary type="html">&lt;p&gt;A1757608: /* Objectives */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Abstract here&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Project description here&lt;br /&gt;
&lt;br /&gt;
=== Project team ===&lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* JunWeng Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar &lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
==== Advisors ====&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
Set of objectives&lt;br /&gt;
To Implement floating-point algorithm as fixed-point algorithm in FPGA&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Topic 1 ===&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
	<entry>
		<id>https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12815</id>
		<title>Projects:2019s2-25601 Phasor Measurement Unit: FPGA Implementation</title>
		<link rel="alternate" type="text/html" href="https://projectswiki.eleceng.adelaide.edu.au/projects/index.php?title=Projects:2019s2-25601_Phasor_Measurement_Unit:_FPGA_Implementation&amp;diff=12815"/>
		<updated>2019-09-19T09:59:35Z</updated>

		<summary type="html">&lt;p&gt;A1757608: Created page with &amp;quot;Category:Projects Category:Final Year Projects 106 Abstract here == Introduction == Project description here  === Project team === ==== Project stu...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Projects]]&lt;br /&gt;
[[Category:Final Year Projects]]&lt;br /&gt;
[[Category:2018s1|106]]&lt;br /&gt;
Abstract here&lt;br /&gt;
== Introduction ==&lt;br /&gt;
Project description here&lt;br /&gt;
&lt;br /&gt;
=== Project team ===&lt;br /&gt;
==== Project students ====&lt;br /&gt;
* Rui Yang&lt;br /&gt;
* Mohamad Hafiz Mohamad Rodzi&lt;br /&gt;
* JunWeng Zheng&lt;br /&gt;
* Sayed Mohd Amir Shahirudin Sayed Sagar &lt;br /&gt;
==== Supervisors ====&lt;br /&gt;
* A/Prof. Cornelis Keith Kikkert&lt;br /&gt;
* Said Al-Sarawi&lt;br /&gt;
&lt;br /&gt;
==== Advisors ====&lt;br /&gt;
*&lt;br /&gt;
*&lt;br /&gt;
&lt;br /&gt;
=== Objectives ===&lt;br /&gt;
Set of objectives&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
=== Topic 1 ===&lt;br /&gt;
&lt;br /&gt;
== Method ==&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
&lt;br /&gt;
== Conclusion ==&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
[1] a, b, c, &amp;quot;Simple page&amp;quot;, In Proceedings of the Conference of Simpleness, 2010.&lt;/div&gt;</summary>
		<author><name>A1757608</name></author>
		
	</entry>
</feed>