In three-phase Alternating Current (AC) systems, two common fault conditions are phase reversal and single phasing (phase loss). Phase reversal faults usually result from human errors during system installation or maintenance, while single phasing faults occur due to issues like broken wires, mechanical failures, worn contacts, blown fuses, and thermal overload. These faults pose significant risks to the system's operation, potentially causing severe damage and failures, as well as posing a danger to personnel. To address these concerns, a phase-sequence and phase-loss monitoring unit becomes essential for three-phase AC systems. This unit is responsible for detecting faults and promptly notifying the system to take necessary actions to protect the load.
This project details the implementation of a phase sequence and phase loss detection system for a three-phase AC supply. It demonstrates how to detect phase sequence and phase loss faults on emulated three-phase AC systems using the Nuvoton MS51 8 Bit microcontroller. The target board utilized in this project is based on the MS51FB9AE, and the firmware is developed with Keil IDE for 8051.
Z Score,T Score, Percential Rank and Box Plot Graph
3 DIGIT DISPLAY WITH 3-PHASE SEQUENCE DETECTOR USING MS51.pdf
1. 0123456
56896 6
6 6
5
46
645966
!#$
%
'('##'#
!)'
*+,-
./
0-
1
2/
3/
45
67
891
2
D
R
A
F
T
C
O
P
Y
2. Three-Phase Sequence
Detection RMS
Voltage Measurement
25 July
2023
In three-phase Alternating Current (AC) systems, two common fault
conditions are phase reversal and single phasing (phase loss). Phase
reversal faults usually result from human errors during system installation
or maintenance, while single phasing faults occur due to issues like broken
wires, mechanical failures, worn contacts, blown fuses, and thermal
overload. These faults pose significant risks to the system's operation,
potentially causing severe damage and failures, as well as posing a danger
to personnel. To address these concerns, a phase-sequence and phase-loss
monitoring unit becomes essential for three-phase AC systems. This unit is
responsible for detecting faults and promptly notifying the system to take
necessary actions to protect the load.
This project details the implementation of a phase sequence and phase loss
detection system for a three-phase AC supply. It demonstrates how to
detect phase sequence and phase loss faults on emulated three-phase AC
systems using the Nuvoton MS51 8 Bit microcontroller. The target board
utilized in this project is based on the MS51FB9AE, and the firmware is
developed with Keil IDE for 8051.
The project encompasses the following key contents:
1. Overview of the MS51FB9AE features specifically employed for the
three-phase sequence detection applications.
2. An introduction to the three-phase sequence detection application
itself.
3. An explanation of the three-phase AC supply emulator used in the
project.
4. The firmware was developed to facilitate phase-sequence
detection and phase-loss detection.
D
R
A
F
T
C
O
P
Y
3. 2
Cubix Kits Projects www.cubixkits.com
Three-Phase Sequence Detection
Contents
Nuvoton MS51 Family Overview ---------------------------------------------------------------------------------------- 3
Basics of Phase Sequence Detection------------------------------------------------------------------------------------ 5
Three-Phase Power Supply -------------------------------------------------------------------------------------------- 5
Phase Sequence Detection and Phase Reversal ------------------------------------------------------------------ 6
Positive Phase Sequence ----------------------------------------------------------------------------------------------- 6
Negative Phase Sequence---------------------------------------------------------------------------------------------- 6
Zero Phase Sequence --------------------------------------------------------------------------------------------------- 6
Phase Loss or Single Phasing Detection-------------------------------------------------------------------------------- 7
RMS VOLTAGE MEASUREMENT -------------------------------------------------------------------------------------- 7
CIRCUIT OF THE VOLTAGE SIGNAL CONDTIONER CIRCUIT -------------------------------------------------------- 9
3 DIGIT 7 SEGMENT DISPLAY --------------------------------------------------------------------------------------------10
TACTILE SWITCHES---------------------------------------------------------------------------------------------------------11
RELAY INTERFACE ----------------------------------------------------------------------------------------------------------11
MICROCONTROLLER SECTION-------------------------------------------------------------------------------------------12
IN-CIRCUIT PROGRAMMING INTERFACE FOR CODE DEBUGGING CODE DUMPING --------------------13
NUMICRO ICP PROGRAMMING TOOL---------------------------------------------------------------------------------14
POWER SUPPLY SECTION-------------------------------------------------------------------------------------------------15
FIRMWARE-------------------------------------------------------------------------------------------------------------------17
VRMS CALCULATION ---------------------------------------------------------------------------------------------------17
FREQUENCY CALCULATION ZERO CROSS DETECTION-------------------------------------------------------20
SERIAL LCD INTERFACE WITH 74HC595-------------------------------------------------------------------------------23
SERIAL LCD CODE--------------------------------------------------------------------------------------------------------24
DEMONSTRATION OF SERIAL LCD-----------------------------------------------------------------------------------24
TESTING-----------------------------------------------------------------------------------------------------------------------25
Calibration--------------------------------------------------------------------------------------------------------------------28
Calibration Constant Calculation ------------------------------------------------------------------------------------29
Calibration Process---------------------------------------------------------------------------------------------------------30
TESTING EQUIPMENT------------------------------------------------------------------------------------------------------31
Practical Application-------------------------------------------------------------------------------------------------------33
D
R
A
F
T
C
O
P
Y
4. 3
Cubix Kits Projects www.cubixkits.com
Nuvoton MS51 Family Overview
NuMicro® MS51FB9AE is embedded with based on 1T 8051-based CMOS microcontroller, runs up to
24 MHz, features 16 K bytes flash, 1 K bytes SRAM, and 4 K bytes loader ROM for the ISP, also equipped
with rich peripherals: 2 sets of UART; 1 set of I2C, and 1 set of SPI, 18 GPIO, 8 channels of 12-bit ADC,
Watchdog Timer, Window Watchdog Timer and 6 X 16-bit PWM channel, package is available in
TSSOP20.
Key Features:
• Operating Characteristics
• Voltage range: 2.4V to 5.5V
• Temperature range: - 40 ℃ to + 105 ℃
• EFT 4 kV
Core
• 1T 8051-based CMOS microcontroller running up to 24 MHz
Memories
• 16 K bytes Flash
• Configurable 4 K / 3 K / 2 K / 1 K Bytes of LDROM, which provides flexibility to user-developed
Boot Code
• 1 K bytes SRAM
• 256 Bytes on-chip RAM
• Flash Memory accumulated with pages of 128 Bytes each
• Built-in In-Application-Programmable ( IAP )
Clocks
• External clock input ( 32 K body only )
• 16 MHz high-speed internal oscillator trimmed to ± 1 % when VDD 5.0 V, ± 2 % in all conditions.
• 24 MHz high-speed internal oscillator trimmed to ± 1 % when VDD 5.0 V, ± 2 % in all conditions
• 10 kHz low-speed internal oscillator
• On-the-fly clock source switch via software
Power management
• Brown-out detection ( BOD ) with low power mode available, 4-level selection, interrupt or
reset options
• Power-on reset ( POR )
D
R
A
F
T
C
O
P
Y
5. 4
Cubix Kits Projects www.cubixkits.com
Peripherals
• Two 16-bit Timers / Counters 0 and 1 compatible with standard 8051
• One 16-bit Timer 2 with a three-channel input capture module and 9 input pins can be
selected.
• One 16-bit auto-reload Timer 3, which can be the baud rate clock source of UARTs.
• One 16-bit PWM counter interrupt for the timer
• 6 x 16-bit pulse width modulator ( PWM ) output, with different modes and Fault Brake
function for motor control.
• One programmable Watchdog Timer ( WDT )
• One dedicated Self Wake-up Timer ( WKT ).
• 2 full-duplex UART ports with frame error detection and automatic address recognition.
• 1 SPI port with master and slave modes, up to 12 Mbps when the system clock is 24 MHz.
• 1 I²C bus with master and slave modes, up to 400 kbps data rate.
• 8 channels of 12-bit ADC, up to 500 ksps converting rate.
• 18 general-purpose I / O pins and 1 input-only pin.
• Programmable pull-ups and pull-lows.
Development Tools
• Nuvoton Nu-Link with KEIL and IAR development environment
• Nuvoton Nu-Link In-Circuit-Programmer
• Nuvoton In-System-Programming ( ISP )
96-bit Unique ID ( UID )
128-bit Unique Customer ID ( UCID )
2-Byte ( 16-bit ) PDID
D
R
A
F
T
C
O
P
Y
6. 5
Cubix Kits Projects www.cubixkits.com
Basics of Phase Sequence Detection
This section gives a brief overview of the three-phase power supply system and its related faults.
Three-Phase Power Supply
The three-phase power supply system stands as the predominant approach for generating,
transmitting, distributing, and consuming electric power across the globe. It consists of three
alternating phases, typically labeled as L1, L2, and L3. Each phase generates AC voltages with the same
amplitude and frequency concerning ground potential. Notably, these three phase voltages exhibit a
phase shift of 120° from one another, as illustrated below.
Figure 3
Figure 4
Figure 1
Figure 2
D
R
A
F
T
C
O
P
Y
7. 6
Cubix Kits Projects www.cubixkits.com
Phase Sequence Detection and Phase Reversal
A three-phase power supply comprises three phases, usually labeled as L1, L2, and L3, each reaching
their peak voltages periodically in a specific sequence. This sequence of events is known as the phase
sequence. On the other hand, phase reversal occurs when two phases of the three-phase supply are
mistakenly interchanged from their normal sequence. Such faults can arise during equipment
installation, commissioning, or maintenance processes. Detecting phase reversal is essential, and it
can be accomplished by monitoring the phase sequence of the three-phase power supply.
Maintaining the correct phase sequence is crucial for the proper functioning of the three-phase AC
system. It ensures that the connected load operates as intended. If the phase sequence is incorrect,
the three-phase loads may operate in the opposite direction or lead to unintended load operations,
possibly causing damage to the system installation.
The phase sequence of a three-phase supply can be categorized into three possibilities:
1. Positive phase sequence
2. Negative or reversed phase sequence
3. Zero-phase sequence
To monitor the phase sequence, the phase shift among the three sinusoidal signals can be measured
in units of time. This process allows for accurate detection and correction of phase reversal, ensuring
the smooth and safe operation of the system.
Positive Phase Sequence
In the case of a positive phase sequence, the voltage on all three lines of the three-phase supply cycles
through 360° where phase L2 lags phase L1 by 120° and phase L3 lags phase L1 by +240°. The sequence
L1 – L2 – L3 is termed a positive phase sequence. Figure 1 shows the positive phase sequence of a
three-phase supply, where the phases L1, L2, and L3, attain their respective peak voltages periodically,
one after the other in the sequence.
Negative Phase Sequence
In case of a negative/reversed phase sequence, the voltage on all three lines of the three-phase supply
cycles through 360° while phase L3 lags phase L1 by 120° and phase L2 lags phase L1 by +240°. The
sequence L1 – L3 – L2 is termed a negative or reversed phase sequence. Figure 2 shows the negative
or reversed phase sequence of the three-phase supply, where phases L2 and L3 are interchanged from
the normal sequence.
Zero Phase Sequence
If the phases L1, L2, and L3 are parallel to each other, the sequence is referred to as a zero-phase
sequence. Figure 3 shows the zero-phase sequence, where phases L1, L2, and L3 are parallel to each
other.
D
R
A
F
T
C
O
P
Y
8. 7
Cubix Kits Projects www.cubixkits.com
Phase Loss or Single Phasing Detection
Single phasing, i.e. phase loss, is a very common electrical fault experienced by three-phase systems
and it occurs when any phase of the three-phase power supply is lost. The phase loss fault occurs due
to a blown fuse, thermal overload, broken wire, wire contact, or mechanical failure. In case of failure
to detect phase loss in the three-phase systems in time, the connected loads and infrastructure can
be seriously damaged. The phase loss of the three-phase supply can be detected either by measuring
the Root Mean Square (RMS) voltage of each phase or by monitoring the zero-crossings of the phases
using the ZCD peripheral. If the RMS voltage of any phase of the three-phase supply is 0, it is deemed
as phase loss. In the case of ZCD-based implementation, if the zero-crossing is not detected for any of
the phases in a specific time duration, it means loss of the phase. Figure 4 shows the signal phasing on
a three-phase supply. Phase L2 is lost, phase L3 lags L1 by 240°, and the three-phase signal is 120° out
of phase.
RMS VOLTAGE MEASUREMENT
The RMS (Root Mean Square) of an AC power supply is the equivalent DC value that would produce
the same average power dissipation in a resistive load. It represents the effective measurement of AC
power as a DC value. Mathematically, RMS is defined as the square root of the mean square, which is
the arithmetic mean of the squares of a set of numbers. For alternating signals, RMS can be expressed
as the integral of the squares of the instantaneous values during a cycle. In practical applications, the
RMS voltage of a three-phase input signal is determined by calculating the arithmetic mean of the
squared values on each phase.
The equations used for calculating RMS voltage are:
Here, n is the number of samples and V1, V2, V3.….Vn are the voltage samples acquired from the input
signal using ADC.
Figure 5 shows the signal, which is divided into 24 number of equal samples.
Figure 5
Figure 6
D
R
A
F
T
C
O
P
Y
9. 8
Cubix Kits Projects www.cubixkits.com
Figure 7
Figure 8
D
R
A
F
T
C
O
P
Y
10. 9
Cubix Kits Projects www.cubixkits.com
CIRCUIT OF THE VOLTAGE SIGNAL CONDTIONER CIRCUIT
The voltage divider circuit serves to reduce the high voltage to approximately 1.8V RMS, equivalent to
a peak voltage of 2.54V (Peak Voltage - 1.8 x √2 = 2.54V), which corresponds to a maximum input
voltage of 300V RMS. To ensure compatibility with the microcontroller's unipolar ADC, we perform
level shifting on the input sinusoidal signal by adding +2.2V to clamp the signal appropriately.
After shifting the AC signal to the zero level by 2.2V, we can proceed with digitizing the samples to
determine the RMS value and frequency. Additionally, analyzing the samples allows us to detect zero
crossings, enabling us to measure the phase difference in terms of time (milliseconds).
To ensure accurate RMS value measurement, it is essential to calculate and nullify the offset voltage.
We can achieve this by utilizing the same samples and calculating the offset value in real-time during
runtime.
Figure 9
Figure 10
D
R
A
F
T
C
O
P
Y
11. 10
Cubix Kits Projects www.cubixkits.com
3 DIGIT 7 SEGMENT DISPLAY
Due to the limited Io pins available in the controller, we opted for two serial to parallel converter,
specifically the 74HCT595, to handle the 3-digit 7-segment display in a cascaded manner while
operating in multiplexed mode. To achieve this, we utilized just three IO pins:
• DATA
• CLK
• LATCH
Figure 11
Figure 12
Figure 13
Figure 14
D
R
A
F
T
C
O
P
Y
12. 11
Cubix Kits Projects www.cubixkits.com
TACTILE SWITCHES
We have incorporated two tactile switches for several purposes, including:
1. Parameter Setting
2. Calibration
3. Mode Selection
RELAY INTERFACE
The circuit has been equipped with two relays, enabling the system to function as a three-phase
sequence corrector with the utilization of two three-phase contactors.
Figure 15
Figure 16
Figure 17
Figure 18
D
R
A
F
T
C
O
P
Y
13. 12
Cubix Kits Projects www.cubixkits.com
MICROCONTROLLER SECTION
• Pin 1 is assigned to the selection jumper pin with a 10k Pullup resistor for future application.
• Pin 2 is assigned to a Trim pot Resistance for variable time setting for delay start of the unit
using ADC channel 3 for future need.
• Pin 3 is assigned to R Phase Voltage measurement.
• Pin 4 is a Power Reset Pin and is also used for code dumping and code debugging.
• Pin 5 is used for the CLK signal for the Serial to Parallel Converter Interface (74595) for 3 Digit
Segment Display.
• Pin 6 is connected to an LED via a current-limiting resistor, serving to display the Correct Phase
Sequence with a constant glow and indicate an Incorrect Sequence through rapid blinking.
• Pin 7 is the GND pin of the IC microcontroller.
• Pin 8 is the ICP Data pin for Code Debugging and code dumping.
• Pin 9 is the VCC supply.
• Pin 10 14 are connected to RELAY1 RELAY2.
• Pin 11 is assigned to the selection jumper pin with a 10k Pullup resistor for future application.
• Pin 12 13 are assigned to the tactile switches.
• Pin 15 is used for the DATA signal for the Serial to Parallel Converter Interface (74595) for 3
Digit Segment Display.
• Pin 16 is used for the DATA signal for the Serial to Parallel Converter Interface (74595) for 3
Digit Segment Display.
• Pin 17 is free for miscellaneous use.
• Pin 18 is the ICP CLOCK pin for Code Debugging and code dumping.
• Pin 19 is assigned to B Phase Voltage measurement.
• Pin 20 is assigned to Y Phase Voltage measurement.
Figure 19
Figure 20
D
R
A
F
T
C
O
P
Y
14. 13
Cubix Kits Projects www.cubixkits.com
IN-CIRCUIT PROGRAMMING INTERFACE FOR CODE DEBUGGING CODE
DUMPING
Nu-Link supports ICP (In-
Circuit Programming) engineering based on SWD signal interface. Users can use Nuvoton NuMicro ICP
Programming Tool development software to update chip firmware, and it is also suitable for chip
firmware mass production. And support third-party development tools, such as Keil RVMDK, IAR
EWARM and CooCox CoIDE.
NU-LINK IN-CIRCUIT PROGRAMMER CUM DEBUGGER HARDWARE
• USB ⇔ SWD bridge
• Support ICP (In-Circuit Programming)
• USB Plug Play
• Support Device: NuMicro Families MS51/ N76E003 /N76E616 /N76E885 Series
Figure 21
Figure 22
Figure 23
Figure 24
D
R
A
F
T
C
O
P
Y
15. 14
Cubix Kits Projects www.cubixkits.com
NUMICRO ICP PROGRAMMING TOOL
Install this application to dump the hex code into the controller.
Figure 25
Figure 26
D
R
A
F
T
C
O
P
Y
16. 15
Cubix Kits Projects www.cubixkits.com
POWER SUPPLY SECTION
We have implemented a Linear power supply utilizing an LM7805T voltage regulator along with a
bridge rectifier MB10S equipped with filter capacitors. To mitigate potential electrical noise
originating from the transformer, we incorporated a 1 Ohm, 1 Watt resistance (R1).
See the Power Supply Unit YouTube Video - https://youtu.be/w8EzJFAb8JQ
Figure 27
Figure 28
D
R
A
F
T
C
O
P
Y
17. 16
Cubix Kits Projects www.cubixkits.com
Figure 29
Figure 30
Complete Circuit Diagram
Complete Circuit Diagram
D
R
A
F
T
C
O
P
Y
18. 17
Cubix Kits Projects www.cubixkits.com
FIRMWARE
VRMS CALCULATION
ADC Sampling of the three channels for phase voltage for R, Y B.
The module Get_ADC() captures 12-bit digitized samples of the input signal waveforms from R, Y,
and B phase voltages, storing them in the array variables named ADC_CHANNEL.
D
R
A
F
T
C
O
P
Y
19. 18
Cubix Kits Projects www.cubixkits.com
After verifying the sample values against the clamped voltage, which represents the mean position of
the applied sinusoidal signal and is approximately 2.4V, our next step is to determine the precise
clamped voltage value. This is essential for accurately calculating the RMS value.
We determine the precise clamped voltage value by calculating the average of the sinusoidal values
and storing it in the 'VOLTAGE_OFFSET' array for all three channels.
Then, we square the sample voltages and keep on adding 256 times.
During the Timer 0 interrupt routine, we perform the scanning process, and once 256 samples are
accumulated, we halt the sampling procedure by setting a flag variable named ADC_CYCLE_OVER to
compute the RMS value.
D
R
A
F
T
C
O
P
Y
20. 19
Cubix Kits Projects www.cubixkits.com
Once the flag ADC_CYCLE_OVER is high RMS value is calculated from the accumulated
D
R
A
F
T
C
O
P
Y
21. 20
Cubix Kits Projects www.cubixkits.com
FREQUENCY CALCULATION ZERO CROSS DETECTION
The number of zero crossings is tallied from the 256 collected samples. Once sample collection
concludes, VRMS and frequency are calculated simultaneously.
Upon detecting the zero crossing in the R Phase, Timer 1 is promptly initiated in 16-bit mode. Likewise,
when the zero crossing of the Y phase is identified, we record the time count value (TL1 TH1) into
the variable timer1_cnt_ry.
Similarly, upon detecting the zero crossing of the B phase, Timer 1 is halted, and the timer count value
(TL1 TH1) is captured into the variable timer1_cnt_yb.
.
In order to enhance calculation accuracy, we gather data from 256 samples of timer1_cnt_ry and
timer1_cnt_yb, thereby reducing errors. Additionally, we monitor the occurrences of zero crossings in
both the R and Y phases to determine the average time differences between RY and YB. It is
acknowledged that there is a 180° separation between the three phases. Specifically, for a frequency
of 50Hz, this corresponds to a time separation of approximately 6.6 milliseconds.
360° - 20𝑚𝑠𝑒𝑐 (1/50Hz period)
120 -
20∗120
360
= 6.6ms
We take the R phase as the reference to calculate phase differences to monitor the phase sequence.
D
R
A
F
T
C
O
P
Y
22. 21
Cubix Kits Projects www.cubixkits.com
The Timer0 interrupt is happening every 5ms, leading to a total consumption of 5ms x 256 = 1280msec
for 256 samples. As a result, the frequency can be readily derived using these given parameters.
D
R
A
F
T
C
O
P
Y
23. 22
Cubix Kits Projects www.cubixkits.com
MAIN HARDWARE SETUP
Power Supply 12V AC
Transformer
Power Supply 12V AC
Transformer
16x2 Line LCD
16x2 Line LCD
B
B
R
R
Y
Y
Figure 32
Figure 31
D
R
A
F
T
C
O
P
Y
24. 23
Cubix Kits Projects www.cubixkits.com
SERIAL LCD INTERFACE WITH 74HC595
Figure 33
Figure 34
Figure 35
Figure 36
Figure 37
D
R
A
F
T
C
O
P
Y
25. 24
Cubix Kits Projects www.cubixkits.com
SERIAL LCD CODE
The below piece of code is the basic serial LCD driver.
DEMONSTRATION OF SERIAL LCD
See the Serial LCD Software Testing YouTube Video - https://youtu.be/GFCs5JfXDCI
D
R
A
F
T
C
O
P
Y
26. 25
Cubix Kits Projects www.cubixkits.com
TESTING
Developing a system for 3 Phase application is very critical because we must handle three-phase
supply very closely with our instruments, computer, and obviously with our own life.
Working with 3 Phase can be extremely dangerous and could prove very fatal if we do not work under
proper guidance and discipline. Theoretical knowledge and common sense are essential when we are
going to develop any 3- Phase based embedded application.
During development, we will use a step-down transformer for all three phases to scale down the
voltages to approximately 12V AC. For that, we must change the scale-down resistors.
Scale Down Resistor Calculation
For Direct Connection of 3 Phase (without Transformer)
Let us assume the applied phase to neutral voltage be 300V RMS (maximum)
Then, RMS Current (I) through R35, R37, R36 R38 is.
𝐼 = 300/(R35 + R37 + R36 + R38)
I = 300/301.5
𝐼 = 0.995𝑚𝐴
So, the RMS voltage across R38 is VR38= 1.5 𝑥 0.995 =1.4925V
Therefore, Peak Voltage across R38 is 𝑉𝑝𝑒𝑎𝑘 = 1.4925 𝑥 √2 = 1.4925 𝑥 1.414 = 2.11𝑉 (2.2V
REF). This means, the negative peak of the AC cycle will not go beyond zero.
Since, we have clamped the neutral point at 2.2V, therefore, the effective Vpeak = 2.11 + 2.2 = 4.21V
which is well within the ADC reference voltage of 5V. That means that we can measure 300V RMS very
accurately.
Current through the circuit - I
Neutral
Figure 38
D
R
A
F
T
C
O
P
Y
27. 26
Cubix Kits Projects www.cubixkits.com
Similar calculation can be used to calculate the value of R38 for a maximum of 12V RMS from the
transformer output.
So, we know that RMS voltage should be around 1.4925V for accurate measurement. The same
current of 0.995mA should flow through the resistors R35, R37, R36 R38 with applied 12V RMS to
produce 1.4925V across R38.
Therefore, the summation value of the resistors R35, R37, R36
𝑅 = (12 − 1.4925)/0.995
𝑅 = 10.56𝑘
Therefore, we can set the value of R35, R37, and R36 to 3.5k which is available very easily.
Figure 39
Figure 40
Proteus Simulation Result with 12V AC
D
R
A
F
T
C
O
P
Y
28. 27
Cubix Kits Projects www.cubixkits.com
If you notice the figure 39, we have applied +2.2V to the ref point of R4 to shift the DC level from 0 to
2.2V. For a unipolar ADC can easily capture the samples of the signal voltages for RMS calculation.
See the complete Simulation of Voltage Divider with DC Level Shifting on YouTube Video -
https://youtu.be/AG1Q4mWIZz8
Proteus Simulation Graphical Result with 12V AC
D
R
A
F
T
C
O
P
Y
29. 28
Cubix Kits Projects www.cubixkits.com
Calibration
After calculating the RMS Voltage from the accumulated samples, we multiply the raw RMS values by
a constant. In the present target application with the hardware constants i.e., the voltage divider
resistors, we found that a multiplication factor of 3.3 would make the VRMS value very near to the
actual VRMS value.
Once the measured VRMS value is within ±20%, we can use the given equation to precisely calculate
the multiplication factor.
In the above piece of code, you will find that the constant is on the denominator and a multiplication
factor of 100 in the numerator. The reason is to increase the precision of calibration and to avoid float-
type and signed integer-type data which obviously consumes more memory and time.
For any calibration, we need a standard value with respect to which we need to calculate the new
constant to make the measured value very close or equal to the standard value. The code is shown
below
D
R
A
F
T
C
O
P
Y
30. 29
Cubix Kits Projects www.cubixkits.com
Calibration Constant Calculation
We will configure the applied voltage to 240V by utilizing a voltage VARIAC along with a highly precise
Multimeter operating in Voltage measurement mode.
Furthermore, let's take into consideration that the recorded voltage in our desired unit registers at
234V, and the associated calibration constant is established at 300.
To exhibit a 240V reading in our intended unit, an adjustment to the calibration constant becomes
necessary. Our initial step involves computing the correction factor relative to the existing constant.
Given Parameters:
Input Voltage (FEED_VOLTAGE) = 240V
Measured Voltage = 234V
Previous Calibration Constant (OLD CALIBRATION CONSTANT) = 300
𝐶𝑜𝑟𝑟𝑒𝑐𝑡𝑖𝑜𝑛 𝐹𝑎𝑐𝑡𝑜𝑟 = 1 +
𝐹𝐸𝐸𝐷_𝑉𝑂𝐿𝑇𝐴𝐺𝐸 – 𝑀𝐸𝐴𝑆𝑈𝑅𝐸𝐷_𝑉𝑂𝐿𝑇𝐴𝐺𝐸
𝑀𝐸𝐴𝑆𝑈𝑅𝐸𝐷_𝑉𝑂𝐿𝑇𝐴𝐺𝐸
𝐶𝑜𝑟𝑟𝑒𝑐𝑡𝑖𝑜𝑛 𝐹𝑎𝑐𝑡𝑜𝑟 = 1 +
240 – 234
234
𝐶𝑜𝑟𝑟𝑒𝑐𝑡𝑖𝑜𝑛 𝐹𝑎𝑐𝑡𝑜𝑟 = 1 +
𝐹𝐸𝐸𝐷_𝑉𝑂𝐿𝑇𝐴𝐺𝐸 – 𝑀𝐸𝐴𝑆𝑈𝑅𝐸𝐷_𝑉𝑂𝐿𝑇𝐴𝐺𝐸
𝑀𝐸𝐴𝑆𝑈𝑅𝐸𝐷_𝑉𝑂𝐿𝑇𝐴𝐺𝐸
𝐶𝑜𝑟𝑟𝑒𝑐𝑡𝑖𝑜𝑛 𝐹𝑎𝑐𝑡𝑜𝑟 = 1.0256
𝑁𝑒𝑤 𝐶𝑎𝑙𝑖𝑏𝑟𝑎𝑡𝑖𝑜𝑛 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 =
OLD CALIBRATION CONSTANT
𝐶𝑜𝑟𝑟𝑒𝑐𝑡𝑖𝑜𝑛 𝐹𝑎𝑐𝑡𝑜𝑟
𝑁𝑒𝑤 𝐶𝑎𝑙𝑖𝑏𝑟𝑎𝑡𝑖𝑜𝑛 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 =
300
1.0256
𝑁𝑒𝑤 𝐶𝑎𝑙𝑖𝑏𝑟𝑎𝑡𝑖𝑜𝑛 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 = 292
With this 𝑁𝑒𝑤 𝐶𝑙𝑖𝑏𝑟𝑎𝑡𝑖𝑜𝑛 𝐶𝑜𝑛𝑠𝑡𝑎𝑛𝑡 (which gets stored in the DATA FLASH), the measured voltage in
our target unit becomes 240V.
To cross-check the linearity, we must measure the voltage at four points.
• 150V
• 200V
• 250V
• 300V
D
R
A
F
T
C
O
P
Y
31. 30
Cubix Kits Projects www.cubixkits.com
Calibration Process
For calibration purposes, we make all Three Phase common and feed 240V AC between the phases
and the REF point. The power is fed using an Isolation Transformer and a VARIAC (to adjust the applied
voltage).
See the complete Calibration Process YouTube Video - https://youtu.be/PnmuXAJrz78
D
R
A
F
T
C
O
P
Y
32. 31
Cubix Kits Projects www.cubixkits.com
TESTING EQUIPMENT
VARIAC AUTO-TRANSFORMER
DIGITAL MULTIMETER
Figure 41
VARIAC AUTO-TRANSFORMER SPECIFICATION
D
R
A
F
T
C
O
P
Y
33. 32
Cubix Kits Projects www.cubixkits.com
ISOLATION TRANSFORMER
VARIAC
ISOLATION
TRANSFORMER
240 V
AC
O/P
D
R
A
F
T
C
O
P
Y
34. 33
Cubix Kits Projects www.cubixkits.com
Practical Application
To summarize, this unit basically measures RMS voltages, the Frequency of Three phases R, Y B
and from the samples of the R, Y B voltages we detect the zero crossing to measure the phase
differences between R-Y R-B.
Three-phase sequence detectors are primarily used to determine the sequence of phases in a three-
phase electrical system. The sequence of phases is important to ensure proper functioning and
protection of electrical equipment. The main applications of three-phase sequence detectors include:
1. Motor Control: In three-phase induction motors, the correct phase sequence is essential for
the proper rotation direction. Incorrect phase sequence could lead to motor damage and
inefficient operation. Sequence detectors are used to ensure the correct phase sequence is
maintained for safe and efficient motor control.
2. Generator and Alternator Protection: Generators and alternators need to maintain the
correct phase sequence to avoid damaging the equipment. A reversed-phase sequence can
lead to unbalanced loading and potential mechanical stresses. Sequence detectors help
protect these devices from such issues.
3. Power Distribution Systems: In large power distribution systems, maintaining the correct
phase sequence is crucial for balancing loads across different phases. Incorrect phase
sequence can lead to uneven loading and potential disruptions in power distribution.
4. Industrial Machinery: Many industrial machines and equipment, such as conveyor systems
and pumps, rely on three-phase power. Ensuring the correct phase sequence is essential for
their proper operation and preventing damage.
5. Transformer Connections: Three-phase transformers need to be connected with the correct
phase sequence to ensure proper voltage transformation and balanced loading. Sequence
detectors help technicians verify the correct connections during installation and maintenance.
6. Automation and Control Systems: Some automation and control systems require knowledge
of the phase sequence to synchronize various processes and equipment.
7. Safety and Maintenance: Detecting incorrect phase sequences is crucial for safety, as it can
prevent potential hazards caused by equipment malfunction due to incorrect connections.
Overall, three-phase sequence detectors play a crucial role in ensuring the proper functioning, safety,
and efficiency of various electrical systems and equipment that rely on three-phase power.
D
R
A
F
T
C
O
P
Y
35. 34
Cubix Kits Projects www.cubixkits.com
About the Author
Prashanta Chowdhury is a dedicated and accomplished individual with a background in Electronics
Communication engineering. With a solid foundation in instrumentation, electrical machines, and
energy metering, he possesses extensive expertise in the fields of electronics, embedded systems, and
C programming. Alongside his technical prowess, Prashanta is fueled by a deep passion for teaching
and mentoring aspiring engineers and enthusiasts in the realms of electronics and embedded systems.
His commitment to knowledge sharing is evident through his dynamic teaching approach, aimed at
fostering the growth of young engineers.
Prashanta can be contacted via email at prashanta.chowdhary@gmail.com and through WhatsApp by
scanning the below QR Code.
D
R
A
F
T
C
O
P
Y