Embedded Electric Power Network Monitoring System

/table> Yahoo! is not affiliated with the authors of this page or responsible for its content.
Embedded Electric Power Network Monitoring System
Nios II Embedded Processor Design ContestOutstanding Designs 2005

300

Third Prize

Embedded Electric Power Network
Monitoring System

Institution:
Jiangsu University
Participants:
Xu Leijun, Guo Wenbin, and Sun Zhiquan
Instructor:
Zhao Buhui




Design Introduction
Electric power is the mainstay of a nations economy and the lifeline of industrial production and social
life. All parameters of an electric grid, especially harmonic parameters, are related to the quality of
electricity generated, which guarantees safe operation of electric equipment. Therefore, this design
combines a web-based electric grid parameter measurement system with a video-monitoring system to
arrive at an integrated monitoring system of embedded electric grid/station. In the measurement of
electric grid parameters, we check the voltage, current, harmonics, etc. in the target areas. The video
section monitors the key instruments and environment and transfers these results to a web interface in
real time. Therefore, no matter where the monitoring personnel are, they can observe the electric grid
parameters and inspect both equipment and environment in real time, as long as they are connected to
the Internet. Our design applies to electric stations at all levels, enterprises with requirements of a
reliable network, as well as applications requiring remote monitoring.
The Altera
®
system-on-a-programmable-chip (SOPC) solution is a flexible, efficient solution,
integrating the function modules necessary to system design such as CPU, memory, and I/O interface
into an FPGA. The SOPC design approach makes for a flexible system design allowing you to modify,
expand, and upgrade system modules using Altera-supplied software and hardware tools. We chose the
Nios
®
II soft core embedded processor because of its low cost and abundant FPGA logic resources,
which can cater to the demands of different applications. In addition, Altera provides a complete
solution based on the Nios II processor, which includes the Quartus
®
II and integrated development
environment (IDE) tools, further reducing product development cost.
Embedded Electric Power Network Monitoring System

301

Function Description
The system design consists of two parts: the measurement and delivery of electric grid parameters and
video monitoring.
Measurement
& Delivery of Electric Grid Parameters
Our measurement circuit uses an application-specific DSP chip to collect, store, and send the following
data:
A measurement of valid values
The harmonic component of three-phase voltage/current and neutral current
The voltage imbalance factor
The DSP chip also measures real power, reactive power, power factor, power supply frequency, and
power cut times, calibrated against the national standard precision.
During measurement, the three-phase voltage and current circuitry was isolated using voltage and
current sensors for data collection and attenuation, and then sent to A/D converter with 128 sample
points in every phase. The DSP chip performed FIR filtering, fast Fourier transform (FFT) operation,
storage, and display of sample data. The communication between the circuit being measured and the
Nios II processor was conducted through a serial port, based on the Modbus protocol.
Remote measurement of electric grid parameters can be divided into two parts: measurement of real-
time electric grid data and monitoring power cut data. Measuring the real-time electric grid data is
handled through a web interface. When the user clicks the Measure Now button in a web browser, a
measurement command is sent to the system based on the Nios II processor, which in turn instructs the
DSP chip to start real-time measurement. Then, the DSP chip returns the measurement results back to
the web browser for users to verify. For example, the application software displays history of the most
recent 25 blackouts.
The measurement functions of the electric grid parameters are realized in a dynamic web page display,
using the Boa web server under uClinux and common gateway interface (CGI) technology. When the
user sends a measure/check data command through the web browser, CGI scripts compiled with C
language send the user command to the web server (Boa), which interprets and executes the CGI script
and sends the results back to the browser.
Video Monitoring
Video monitoring is needed to guarantee safe, normal operation of important measuring instruments in
real time. To implement video monitoring, our system has two critical components: video data
collection and video data transmission.
Video data collection is realized using both hardware and software. The hardware part comprises a web
camera and USB adaptor. Today, web cameras are a popular low-cost network video capture devices
that are convenient for use in embedded applications. Because there is no support for USB devices on
the Cyclone EP1C20 board included in the Altera Nios II development kit, we designed a USB
interface to read video data from a web camera. We developed the software modules by modifying open
source software like vgrabbj and xawtv, whose main function is to capture video from a web camera
and convert it to the JPEG format. Next, this video data is sent to the network in real time using CGI. Nios II Embedded Processor Design ContestOutstanding Designs 2005

302
We implemented video transmission using CGI and the web server. Working with the available electric
grid parameters, the application software combines video information with electric grid information in
an easy format that remote users can view through a web browser.
Performance Parameters
The performance is based on electric grid parameters and video image parameters.
Electric Grid ParametersThe measurement accuracy of the electric frequency is 0.01 Hz. For the
three-phase voltage and current measurement, the accuracy is 0.5%. For the three-phase voltage
imbalance factor, the accuracy is 0.2%. For the three-phase current imbalance factor, the accuracy
is 1%. The harmonic measurement accuracy meets the GB/T 14549-93 B standard. The shortest
measurement interval is 3 seconds.
Image ParametersThe screen-capture function adopts a 320[x]240 JPEG format with a 1-Hz
refresh frequency. This performance meets the requirement of normal video monitoring.
Design Methodology
Our design comprises the following parts: software/hardware modules for measuring electric-grid
parameters, uClinux OS kernel and file system configuration, web server configuration, CGI program
development, USB interface board design, and development of an image capture program.
Hardware Design
The hardware circuitry is based on Texas Instruments TMS320LF2407A DSP chip as the computing
engine. The TMS320LF2407A features a 40-MHz clock and a single-cycle instruction execution time of
25 ns. Because the DSP chip operates at 3.3 V, and because all other chips in the system operate at 5 V,
we needed to perform voltage-level conversion. Therefore, we chose the Altera EPM7128S device to
implement level conversion and logic control. We also took advantage of the devices compatibility
with 3.3-V and 5-V levels for use in communication control and address decoding functions between
the DSP chip and other chips in the system.
To measure the three-phase voltage and current, we designed a protective circuit that deploys voltage
sensors and current transformers for safe isolation from high voltage and currents. This circuit performs
AC attenuation, acts as an anti-aliasing low-pass filter, performs A/D conversion, and passes data to the
DSP chip for computation. The results are displayed and then stored for further analysis. At this point,
all operations, including synchronous sampling by software, measuring signal frequency before
sampling, and calculating sampling frequency based on the signal frequency, must be handled carefully
to avoid FFT errors caused by frequency fluctuations.
Software Design
We can code DSP programs in C or Assembly language; C programs are easily readable, changeable,
and are good for porting. However, their executable code has low efficiency. In contrast, Assembly
language routines yield highly efficient executable code. To improve code efficiency and meet the
requirements of a real-time system, we deployed the C2xxAssembly language routines for each
software module and interrupt program. For example, we used Assembly language to take advantage of
DSP special instructions in the FFT subprogram of the DSP data processing software module: bit-
reversed indirect addressing, which is designed for real-time implementation of FFT arithmetic.
Embedded Electric Power Network Monitoring System

303

Configuration of uClinux OS Kernel & File System
We configured the uClinux OS kernel and file system as described in the following section.
uClinux Kernel ConfigurationThe embedded uClinux utilizes a customized Linux kernel with
high flexibility, and is an open-source code that is stable and reducible. In this design, we adopted
the uClinux version 1.3 edition, which was developed by Microtronix for the Nios/Nios II
processor.