A leakage relay is a protective device that can cut off the power supply of a protected line when the leakage current of the protected line reaches a set value. It plays a very important role in the power system and is the basis for ensuring power supply reliability. With the development of electronic technology and computer technology, the relay protection of power systems has broken through the traditional digital protection relays and has emerged as an intelligent protection relay with a microprocessor as the core [1-2]. This paper uses the PIC18F6585 microcontroller to design an intelligent leakage relay with multiple functions such as self-diagnosis, fault recording, and data communication, which facilitates fault analysis and has high reliability.
1 PIC series microcontroller features
PIC18F6585 is a PIC series microcontroller developed, manufactured and produced by Microchip. The technical performance of this series of microcontrollers has the following advantages [3]:
(1) Harvard bus structure. The PIC series of microcontrollers adopts a unique Harvard bus structure in terms of architecture. The data bus and instruction bus are separated inside the chip and different widths are used to facilitate instruction extraction, pipelining, and single-byte and single-cycle implementation of all instructions, thereby improving the speed at which the CPU executes instructions and ensuring data security.
(2) Reduced Instruction Set Computing (RISC) technology. The instruction set consists of only 35 instructions, which are easy to learn, remember, and understand. It also greatly facilitates program writing, reading, debugging, modifying, and communicating. It is easy to learn and use.
(3) The addressing mode is simple. There are only four addressing modes: register indirect addressing, immediate addressing, direct addressing, and bit addressing. These are relatively easy to understand and master.
(4) High operating speed. Due to the adoption of Harvard bus structure, the reading and execution of instructions adopt pipeline operation mode, which greatly improves the operating speed. The operating speed of PIC series microcontrollers is much higher than that of other microcontrollers of the same grade. Among all 8-bit microcontrollers, PIC series microcontrollers are one of the fastest in the world.
(5) Extremely low power consumption. Its I/O port has a strong load driving capability, and the maximum input and output current of each port can reach 25 mA, which can directly drive LEDs, optocouplers or micro relays.
(6) The PIC18F6585 chip has ADC, I2C and SPI serial bus ports, and has external circuits. It is simple, easy to develop, can be programmed in C language, and has strong program confidentiality.
2 Relay Hardware Structure and Working Principle
(1) Hardware structure
The CPU of the leakage relay uses the PIC18F6585 chip. The detection of the leakage signal is completed by the zero-sequence current transformer, which can convert the detected leakage current of the protected line into a millivolt-level AC voltage signal, and then obtain a DC voltage through signal rectification, amplification and filtering, and cooperate with the corresponding control circuit to drive the execution loop to achieve the control purpose of cutting off the power supply of the protection line. The implementation process is: signal detection → filtering → secondary amplification → control circuit → drive execution loop → cut off the power supply of the protected line. The hardware structure block diagram is shown in Figure 1.
The functions of each part in Figure 1 are:
① Zero-sequence current transformer circuit. The current transformer of this device uses high-performance Permalloy as the magnetic material of the iron core to ensure that the current transformer output has good linearity within a certain range.
②Signal processing. The factors that affect system reliability are mainly the odd harmonic currents of the line power frequency, so this circuit uses a set of active low-pass filters, which mainly filter out the odd harmonic AC components, and then perform AC-DC conversion to ensure the correct operation of the leakage relay.
③CPU. This is the core component of the device. PIC18F6585 mainly includes FLASHROM, RAM, TM2RX, A/D conversion, serial communication, etc. It is the central processing unit of the entire system. The system's instruction fetching, judgment, and execution are all completed by it. Among them, the A/D converter is a 10-bit converter. When the main frequency is 20 MHz, its conversion time is 16μs; FlashROM and RAM are storage spaces for storing programs and data.
④Digital display and operation circuit. The digital display is used to display the line leakage current and the delay time of the system tripping. It is mainly composed of a digital drive circuit and an LED digital display. The execution circuit is mainly composed of a photoelectric isolation and a relay drive circuit.
⑤Serial communication interface circuit: MAX422 from MAXIM company is used to expand the serial communication port.
⑥ Human-machine interface circuit: The human-machine interface circuit is mainly used to set the protection setting value and the system delay tripping time.
⑦ Power supply circuit: Provides working power for the microcontroller system, one of which is an isolated power supply.
(2) Relay working principle
After the system is turned on, the system sets the TMR0 timer interrupt and generates a timer interrupt signal every 2 ms. The microcontroller responds to this interrupt signal and enters the interrupt processing subroutine. The interrupt processing subroutine determines whether it is an RB port interrupt or a TMR0 interrupt, and then calls the timer interrupt A/D processing subroutine or keyboard processing subroutine respectively. The system compares the A/D conversion result with the predetermined setting value. If it is greater than the setting value, it will perform tripping, accident alarm and other processing. All results are sent to the main program for display.
3 Software Design
3.1 Software Design Flowchart
This single-chip microcomputer system uses a 20 MHz main frequency, performs a timer interrupt processing every 1 ms, and has a simple software structure. The software design includes the main program, RB port interrupt service subroutine, timer service subroutine, A/D conversion subroutine, data processing subroutine, and display subroutine, and is designed in C language.
(1) System main program. It mainly completes the initialization of the system's ports, timers, A/D converters, constants, variables and other quantities, and also completes the leakage current cycle display. The main program flow chart is shown in Figure 2.
(2) Interrupt service subroutine. It mainly judges whether TMR0 overflows according to the data of T0IF bit of INTCON register. If overflow occurs, it will enter TMR0 interrupt entry subroutine. It also judges whether RB has input changes according to the data of RBIF bit of INTCON register. If changes occur, it will enter keyboard interrupt entry subroutine. The flow of interrupt service program is shown in Figure 3.
(3) Timing interrupt service subroutine and A/D conversion subroutine. It mainly completes the A/D conversion task, performs one processing every 1 ms, and samples 6 times in succession each time. The sampling results are stored in the specified memory unit. The flow of the timing interrupt service subroutine is shown in Figure 4, and the flow of the A/D conversion subroutine is shown in Figure 5.
(4) Data processing subroutine. It mainly completes digital filtering, improves the anti-interference performance of the system, calculates the average value of A/D conversion data, performs data comparison, determines whether to trip and alarm, etc. The data processing subroutine flow is shown in Figure 6.
(5) Keyboard processing subroutine. It mainly provides a channel for human-computer dialogue and is used to set the protection setting value, delayed tripping time, etc.
3.2 Programming
The program is designed in C language. The core statements in the A/D conversion subroutine and data processing subroutine are given below [4].
(1) A/D conversion subroutine
The performance of the designed intelligent relay is far superior to that of traditional relay products. The designed system is based on the PIC18F6585 single-chip microcomputer to form a real-time data acquisition system, which can analyze, calculate and process the collected data in real time to obtain various protection characteristics. It is easy to modify and has good selectivity and coordination. It integrates measurement, monitoring and protection, and can be connected to the computer through the communication interface to form an intelligent monitoring protection and information management system, which has high industrial use value.
Previous article:Design and implementation of real-time wireless monitoring system for high-voltage switch contact temperature
Next article:Wireless sensor network construction and communication design based on CyFi
- High signal-to-noise ratio MEMS microphone drives artificial intelligence interaction
- Advantages of using a differential-to-single-ended RF amplifier in a transmit signal chain design
- ON Semiconductor CEO Appears at Munich Electronica Show and Launches Treo Platform
- ON Semiconductor Launches Industry-Leading Analog and Mixed-Signal Platform
- Analog Devices ADAQ7767-1 μModule DAQ Solution for Rapid Development of Precision Data Acquisition Systems Now Available at Mouser
- Domestic high-precision, high-speed ADC chips are on the rise
- Microcontrollers that combine Hi-Fi, intelligence and USB multi-channel features – ushering in a new era of digital audio
- Using capacitive PGA, Naxin Micro launches high-precision multi-channel 24/16-bit Δ-Σ ADC
- Fully Differential Amplifier Provides High Voltage, Low Noise Signals for Precision Data Acquisition Signal Chain
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- Please tell me how to use the IS pin of BTS7960
- Share a summary of CNC power supply solutions, very detailed
- DIY flapping-wing aircraft, focusing on the mechanical structure and flight control system principles (including open source materials)
- Hongmeng Development Board Neptune (Part 2) - Development Environment
- Main steps when configuring the EMIFA module using CSL
- RF chips have a market value of hundreds of billions, and domestic alternatives are a reference
- Seeking advice on work
- This is me, confession of a base station
- Hi guys!
- ST MEMS Creative Competition Post 4 - Robotic Arm Control