“Embedded system refers to a software and hardware system with a microprocessor or microcontroller as the core that is embedded in various products or engineering applications. The combination of embedded system and Internet technology, the embedded Internet technology formed is an emerging technology that has developed with the popularization of computer network technology in recent years. Engineering and technical personnel, management personnel or debugging personnel can obtain remote data through the Web without visiting the site in person, and control and calibrate the measurement and control instruments.Here is an introduction to the remote measurement and control server that uses the embedded soft core processor Nios II and the widely used embedded operating system uClinux to realize the power grid parameters
“
Authors: Zhao Bubri, Sun Zhiquan, Xu Leijun, Guo Wenbin
Embedded system refers to a software and hardware system with a microprocessor or microcontroller as the core that is embedded in various products or engineering applications. The combination of embedded system and Internet technology, the embedded Internet technology formed is an emerging technology that has developed with the popularization of computer network technology in recent years. Engineering and technical personnel, management personnel or debugging personnel can obtain remote data through the Web without visiting the site in person, and control and calibrate the measurement and control instruments. This article introduces the use of embedded soft core processor Nios II and widely used embedded operating system uClinux to realize the function of remote measurement and control server for power grid parameters.
1. Function and system structure
Figure 1 is the system structure, in which the embedded Web server and the monitoring terminal are located on site, and the connection between them can be realized by serial port, parallel port, USB, etc. The on-site monitoring terminal completes the detection of power grid parameters (voltage, current, harmonics, etc.) in the target area, and transmits the detection results to the web interface in real time, so that no matter where the monitoring personnel is, they can connect to the Internet network to check the target area. Real-time observation of power grid parameters. The realization process is: the three-phase voltage and current are respectively transformed by voltage transformer and current transformer, and then sent to AID conversion after circuit conditioning. 128 points are sampled per cycle, and the DSP chip performs FIR digital filtering, FFT calculation and calculation on the sampled data. Various parameter values, storage, Display and other operations. The communication between the measurement circuit and Nios is transmitted through the serial port, and the measured data can be easily sent to the embedded server with the Nios II processor as the core according to the pre-appointed communication protocol (based on the Modbus protocol). Through CGI technology, complete the command transmission of the remote monitoring terminal and transmit the measurement data to the remote monitoring terminal in real time.
Figure 1 System structure diagram
2. Hardware structure
The hardware structure of the system is shown as in Fig. 2. The core of the hardware system is the Nios II embedded soft core processor built in Ahera Cyclone FPGA. The Nios II series of embedded processors is a general-purpose RISC structured CPU, which is positioned in a wide range of embedded applications. The Nios II processor series includes three cores: fast (Nios II/f), economical (Nios II/e) and standard (Nios II/s) cores, each of which is tailored for different performance ranges and costs. optimization. These three cores all use a common 32-bit instruction set structure (ISA) and are compatible with binary code.
Figure 2 Hardware system diagram
The configuration of Nios II is done in SOPC Builder. By configuring the required external/internal components, SOPC Builder will automatically generate a CPU suitable for the selected components to meet the needs of the system. The 16M CF card is used as the external memory of the system to store measurement data, web files and applications. The Ethernet interface chip uses the Lan91cl11 chip of SMSC, which is a non-PCI interface single-chip network controller with 8k FIFO, which can interface with 8-bit, 16-bit, and 32-bit CPUs, and is widely used in embedded System design is in progress.
3. Software structure
The system software structure is shown as in Fig. 3. uClinux is a project and fully developed code in full compliance with the GNU/GPL (General Public License) convention. It is a branch of standard Linux and is now supported and maintained by Lineo. It is specifically aimed at CPUs without MMU, and has done a lot of miniaturization work for embedded systems. uClinux For Nios is a uClinux operating system customized by Microtronics for Nios CPU. It is easy to use and does not require a complicated transplantation process. It is automatically integrated into the Nios/Nios II development environment (IDE). As long as you configure the kernel and file system according to your own needs, the Web server, TCP/IP protocol stack and the underlying interface driver are integrated in uClinux. In addition, write your own CGI scripts to realize the functions of dynamic web pages. CGI (Common Gate Interface) dynamic gateway interface is a standard interface for external extended applications to interact with WWW servers. External extension applications written in accordance with the CGI standard can process the collaborative work data input by the client (usually a WWW browser) and complete the interactive operation between the client and the server. CGI external extension programs can be written to access external data systems, and client users can query data through it and WWW servers. CGI can be written by PERL, C and most of the scripting languages, but because it is used for programs in embedded systems, and the scripting language needs an interpreter, it is more appropriate to choose C language to write CGI scripts, and it can save a lot of money. Large system resources.
Figure 3 Software structure diagram
3.1 Configuration of uClinux operating system kernel and file system
(1) The kernel configuration of uClinux. The kernel is the core of an operating system. It is responsible for managing the system’s processes, memory, device drivers, files, and network systems, and determines the performance and stability of the system. Embedded uClinux has a highly flexible and customizable kernel, which keeps the Linux source code open, stable, and scalable. The uClinux1.3 version transplanted by Microtronix company specifically for Nios/Nios II is used here, and reconfigured according to the needs: In the “Developing Board” option, you should select the development board you use, and add the CF card as the hard disk of the system.
(2) File system configuration. The file system is an important part of the operating system. For users, the file system is also the most directly visible part of the operating system. It is responsible for managing files on external storage, and providing the operating system and users with functions such as file access, sharing, and protection. Here, in the file system configuration, select Install Minimal, and then add options such as agetty, boa, dhcpcd, ftpd, inetd, init, ping, route, and telnetd.
3.2 Web server configuration
Figure 4 Web server workflow
The Web Server used in this article is Boa, which is a single-task http server with open source code, high performance and fast speed. Its workflow is shown in Figure 4. At present, the source code of Boa has been included in uClinux’s code. To implement Boa under uClinux, some configuration and modification are needed for Boa. Configuring Boa includes the following steps:
(1) Open the “boa.conf” file in the “/target/etc/config” folder in the established file system.
(2) Change “ChRoot” to “/mnt/ide0/www”, the purpose is to use the “www” folder on the CF card as the main folder of the Web Server. When typing in the system IP, the server automatically resolves to find a web page named “index.htm” in this directory, which is the home page of this design.
(3) Add a command in the “SeriptAlias” option: “ScriptAlias/mnt/ide0/www/cgi-bin//cgi-bin/”, the purpose is to map the address of the previous folder with the complete path to the latter Folder, one is that it can save a lot of time to enter the address in the address bar, which is convenient for users to operate; the other is that it increases the confidentiality and security of the system. Other options can choose the default options.
(4) Save the configured file. After downloading the file system, in the “/mnt/ide0/www” file, create a “csi-bin” directory to store the CGI script files.
3.3 CGI programming
CGI programs are written in C language and embedded with html scripts, so when CGI is executed, operations on specific ports can be completed, and the returned results can be displayed on the web page for monitoring personnel to view. The specific operations are: First, the CGI script uses GET to receive the “QUERY_STRTING” transmitted from the web page parsed by the Web Server, which represents the user’s monitoring command. After receiving the command, the CGI program decodes the command and transmits it to the serial port, sends a collection command to the on-site monitoring module, and accepts the collection result returned by it, and quickly transmits it to the web interface browsed by the monitoring user. It should be noted that after the CGI program has been written and successfully compiled, it should be moved to the relevant directory of the CF card, which is the “www/csi-bin” set by the Boa Web Server described above, and its suffix Change to “.cgi” and change the attribute to “executable”, so that Web Server can correctly recognize and execute this CGI program.
Figure 5 Web page showing real-time measurement results
4 Conclusion
This article combines the embedded system with Internet technology, develops an embedded Web server on FPGA, and combines it with the power grid parameter measurement instrument to form a remote power grid parameter measurement system, which provides technical support for the networked management of the power grid system. Very good application prospects.
The Links: M150XN05-V6 SKKD16212 MITSUBISHI-IGBT
0 Comments for “Design of remote measurement and control system for power grid parameters based on uClinux and Nios II processor”