Single chip microcomputer realizes the control system of power compensation device

Publisher:EtherealGraceLatest update time:2011-09-20 Keywords:MCU Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

The power compensation control system with 80C196KC single chip microcomputer as the core samples the three-phase voltage and current through analog input circuit, and controls the switching of capacitors through output unit after calculation, so as to realize the compensation of reactive power of power grid. This paper introduces the design method of system hardware and software.

introduction

At present, there are many compensation methods in the power compensation system. The compensation system in this paper is based on the optimization of the minimum negative sequence current. The system calculation requires sampling of the single-phase voltage u and current I within 20 ms of one cycle of AC power, and the sampling times in one cycle are required to be at least 100 times. In view of this feature, a control system based on 80C196KC is designed. Intel's high-performance 16 b single-chip microcomputer 80C196KC has a fast computing speed and can meet the requirements of high-speed sampling of the system.

1 System Hardware Design

The hardware part of this system is mainly composed of four parts: sampling input circuit, central control unit, program storage unit, and output drive circuit. The overall block diagram of the system is shown in Figure 1.

1.1 Analog Input Circuit

The sensors used for data acquisition in the system are voltage transformers and current transformers. The voltage and current of the three phases need to be collected separately, requiring a total of six inputs. The 80C196KC has a successive approximation A/D converter with a total of 8 input channels. Its input pins ACH0~ACH7 are shared with P0.0~P0.7. The internal A/D converter is 8 b/10 b adjustable and has its own sampling and holding circuits, which reduces peripheral circuits, interference and interference sources, increases the stability and anti-interference of the system, and reduces the size of the control board. In this system, the 10 b conversion method is used.

In order to protect the A/D converter and increase reliability, an input interface circuit as shown in FIG. 2 may be used at the input end of the A/D channel.

Input interface circuit

Two diodes D1 and D2 act as overload protection. When the input voltage is higher than VREF+0.7 V, D1 is turned on and the input level is clamped at VREF+0.7 V; when the input voltage is lower than -0.7 V. This overload is often a spike interference and lasts for a short time. The technical conditions of MCS-96 stipulate that the voltage of the analog input terminal to the analog ground ANGND cannot be lower than -0.3 V, which can be guaranteed by the low-pass filter R4 and C1 at the input terminal. The time constant of this filter in the figure is τ=R4C1=270×0.01=2.7μs. If -0.7 V is used as the step input of this filter, it takes time for the output of this filter (i.e. the analog signal input terminal of 80C196KC) to reach the level of -0.3 V:

t = -τln(1-0.3/0.7) = 1.15μs

Usually, the peak duration of this type of spike noise is much shorter than the above time, so this input circuit can effectively play the role of overload protection.

1.2 Central Control Unit

80C196KC is a new branch of CHMOS high-performance 16b microcontrollers, with an internal EPROM/ROM of 16b, an internal RAM of 488b, and 24b of dedicated registers. The 80C196KC uses a "vertical window" structure, so that the newly added 256b RAM can also be accessed as a general register through window mapping. 80C196KC can use a 16MHz crystal oscillator, and the internal clock is divided by 2. Its running speed is 33% faster than the 12MHz 80C196KB and 1 time faster than the 12MHz 8096BH. The minimum circuit refers to the minimum peripheral devices added to make the microcontroller work, generally including a reset circuit and a crystal oscillator. The minimum circuit of 80C196KC is shown in Figure 3.

Minimum circuit of 80C196KC [page]

1.3 Output Unit

There are 12 outputs in total, of which P1.0~P1.3 control phase A, P1.4~P1.7 control phase B, HSO.0, HSO.1, P2.6, and P2.7 control phase C. The output is isolated by the photo-controlled thyristor MOC3061, and then driven by a first-level bidirectional thyristor, and then added to the control stage of the bidirectional thyristor to control the conduction of the bidirectional thyristor, thereby controlling the switching of the capacitor. The output circuit is shown in Figure 4.

Output Circuit

The signal current output from the output pin of 80C196KC is only a few μA, which is not enough to drive the photocoupler behind it, so a TTL chip 5407 is added as a current driving element. MOC3061 is a commonly used photocoupler with bidirectional thyristor output. Its output end is a photosensitive bidirectional thyristor. When 15 mA current flows into the input end of the photocoupler, the thyristor is turned on. The output end of MOC3061 is also equipped with a zero-crossing detection circuit to control the zero-crossing triggering of the thyristor to reduce the impact of electrical appliances on the power grid when they are turned on.

2 Software Design

The system software is written in high-level language PL/M-96 embedded in assembly language and adopts modular structure design. For parts with high real-time requirements such as A/D conversion, assembly language is used to write A/D conversion program because of its good flexibility and fast code conversion speed. At the same time, the instruction system of 80C196KC is efficient and fast in execution. Other parts are written in high-level language, which makes the program readability good.

The whole software consists of 7 parts, namely: main program, A/D conversion subroutine, switching subroutine, voltage switching subroutine, current calculation subroutine, output subroutine, software timer interrupt service program. The following introduces the design of the main program and A/D conversion subroutine.

2.1 Main program design

The main program flow chart is shown in Figure 5.

2.2 A/D conversion subroutine

Data sampling is completed by combining A/D conversion with the interrupt service routine of the software timer. At the beginning of each cycle measurement, the main program determines the analog channel; the software timer is used for timing, and then the A/D conversion is started. When the software timer timing time is reached, the software timer interrupt service routine is entered, and the software timer interrupt service routine returns to the main program to complete a cycle of sampling process.

The A/D conversion subroutine flow chart is shown in Figure 6.

The software timer interrupt subroutine in the system is written in the high-level language PL/M. The attached program is as follows:

Timing 20 ms program:

hso_command=18h;/*Use software timer 0, interrupt mode*/

hso_time=timer1+15000; /*timing 20 ms*/

3 Conclusion

The compensator has no contact, no heat, small impact, zero-crossing switching, safe and reliable, and maintenance-free. The control part uses the 80C196KC single-chip microcomputer as the core controller, realizing automatic compensation and unattended operation. It solves the problems of unreliable contact switching, high failure rate, high maintenance and short service life in the past.

Keywords:MCU Reference address:Single chip microcomputer realizes the control system of power compensation device

Previous article:RISC CPU's Processing Method and Simulation of Transfer Instructions
Next article:Design of intelligent fire alarm system based on MSP430F149

Recommended ReadingLatest update time:2024-11-16 23:39

How does a microcontroller work?
We have a general understanding of the structure and characteristics of the microcontroller. Next, we will mainly explain how the microcontroller works and what working methods it has. The microcontroller has four working modes: reset, program execution, low power consumption, and programming and encryption, which a
[Microcontroller]
How does a microcontroller work?
NavInfo: MCU still accounts for a relatively low proportion of overall revenue, and production capacity bottlenecks need to be overcome
On May 10, in response to an investor's question, "AC8015 can be seen as a breakthrough from 0 to 1 in the smart cockpit chip, and the revenue of MCU can be seen as a big step from 1 to 10, why the revenue has only increased by a dozen percent, far less than the chip revenue before 2019", NavInfo explained on the inve
[Mobile phone portable]
Delay adjustment module designed with single chip microcomputer and FPGA
    The system structure diagram is shown in Figure 1. Its hardware structure is relatively simple, mainly composed of three parts: single-chip microcomputer P89C51RD, RS-232/TTL interface circuit MAX232 and programmable logic device FPGA. The single-chip microcomputer P89C51RD2 is the link between the upper PC and FP
[Microcontroller]
Delay adjustment module designed with single chip microcomputer and FPGA
51 MCU button controls digital tube 0~9_51 MCU external interrupt
       The lighting of LED lights, digital tubes, and buttons introduced earlier only use the IO resources of the 51 microcontroller. If we only use the microcontroller to light up lights and operate digital tubes, it would be a waste of resources. These are just the tip of the iceberg of the 51 microcontroller's reso
[Microcontroller]
51 MCU button controls digital tube 0~9_51 MCU external interrupt
The detailed process of making a stopwatch using 51 single chip microcomputer
Previous words: Like many friends, in the process of learning 51 single-chip microcomputer, we will definitely involve making a stopwatch, which involves combining multiple parts of the single-chip microcomputer. This may seem a bit difficult for us beginners. Like everyone else, I was puzzled and finally made this st
[Microcontroller]
The detailed process of making a stopwatch using 51 single chip microcomputer
Detailed explanation of 51 single-chip microcomputer crystal oscillator
What is a crystal oscillator? The full name is quartz crystal oscillator, which is a high-precision and high-stability oscillator. Through a certain external circuit, a sine wave with stable frequency and peak value can be generated. When the microcontroller is running, it needs a pulse signal as a trigger signal for e
[Microcontroller]
The use of C51 microcontroller interrupt and using
The basic structure of the 8051 series MCU includes: 32 I/O ports (4 groups of 8-bit ports); two 16-bit timer counters; full-duplex serial communication; 6 interrupt sources (2 external interrupts, 2 timer/ Counter interrupt, 1 serial port input/output interrupt), two levels of interrupt priority; 128 bytes of built-i
[Microcontroller]
Real-time multi-task operating system based on MSP430F149 microcontroller
1 Basic Concepts of RTOS Real-time multitasking operating system (RTOS-Real Time Operating System) refers to the working characteristics of the operating system. Real-time refers to the real time of the physical process. A real-time operating system is an operating system that has real-time performance and can suppor
[Microcontroller]
Latest Microcontroller Articles
  • Download from the Internet--ARM Getting Started Notes
    A brief introduction: From today on, the ARM notebook of the rookie is open, and it can be regarded as a place to store these notes. Why publish it? Maybe you are interested in it. In fact, the reason for these notes is ...
  • Learn ARM development(22)
    Turning off and on interrupts Interrupts are an efficient dialogue mechanism, but sometimes you don't want to interrupt the program while it is running. For example, when you are printing something, the program suddenly interrupts and another ...
  • Learn ARM development(21)
    First, declare the task pointer, because it will be used later. Task pointer volatile TASK_TCB* volatile g_pCurrentTask = NULL;volatile TASK_TCB* vol ...
  • Learn ARM development(20)
    With the previous Tick interrupt, the basic task switching conditions are ready. However, this "easterly" is also difficult to understand. Only through continuous practice can we understand it. ...
  • Learn ARM development(19)
    After many days of hard work, I finally got the interrupt working. But in order to allow RTOS to use timer interrupts, what kind of interrupts can be implemented in S3C44B0? There are two methods in S3C44B0. ...
  • Learn ARM development(14)
  • Learn ARM development(15)
  • Learn ARM development(16)
  • Learn ARM development(17)
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号