CN203617782U - Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer - Google Patents

Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer Download PDF

Info

Publication number
CN203617782U
CN203617782U CN201320712918.XU CN201320712918U CN203617782U CN 203617782 U CN203617782 U CN 203617782U CN 201320712918 U CN201320712918 U CN 201320712918U CN 203617782 U CN203617782 U CN 203617782U
Authority
CN
China
Prior art keywords
chip microcomputer
power supply
single chip
unit
interface
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN201320712918.XU
Other languages
Chinese (zh)
Inventor
张晓光
翟志强
李�杰
车福来
武卫革
刘兰荣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baoding Tianwei Group Co Ltd
Original Assignee
Baoding Tianwei Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baoding Tianwei Group Co Ltd filed Critical Baoding Tianwei Group Co Ltd
Priority to CN201320712918.XU priority Critical patent/CN203617782U/en
Application granted granted Critical
Publication of CN203617782U publication Critical patent/CN203617782U/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Remote Monitoring And Control Of Power-Distribution Networks (AREA)

Abstract

The utility model relates to a double-power-supply automatic switching controller based on an ATmega16 single chip microcomputer and belongs to the electric-power electronic application equipment technology field. A technical scheme is characterized in that a frequently-used power supply (1) and a stand-by power supply (2) are mutually connected with an input interface A/D of a single chip microcomputer (8) through a voltage transformation unit (3); a waveform transformation unit (4) is arranged between the voltage transformation unit (3) and the single chip microcomputer (8); an output interface PD4 of the single chip microcomputer (8) is mutually connected with the waveform transformation unit (4) through a selection unit (5); a circuit breaker state detection unit (6), the single chip microcomputer and a circuit breaker control unit (7) are successively connected. The controller of the utility model has the advantages that the ATmega16 single chip microcomputer is taken as a core; abundant on-chip peripheral interfaces are fully used and the power supplies are automatically switched through detection and determination of two path power supply voltages, a frequency and a phase sequence; and a user can select a control mode, set normal working ranges of the voltage and the frequency and set switching time delay according to a need.

Description

A kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer
Technical field
The utility model relates to a kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer, belongs to power electronics application apparatus technical field.
Background technology
Along with expanding economy, power consumer is more and more higher to the requirement of the quality of power supply and continuous power supply.In some important electricity consumption departments (as hospital, airport, military installations etc.), normally work for guaranteeing important electrical, generally all adopt the power supply of two-way independent current source, wherein a road is conventional power supply, another road is stand-by power supply, and the switching controls of two-way power supply is completed by dual power supply automatic switching device.Dual power supply automatic switching device is made up of controller and the executive component with power supply monitoring and executive component monitoring function, and major function is the continuity that guarantees to greatest extent power supply.For requiring shorter load of electrical source exchange time, can adopt contactless electronic power switch as executive component, realize several cycles and even realize seamless switching with interior quick switching.Because most of important loads allow the interruptedly supplying power at several seconds zero point in even several seconds, dual power supply automatic switching device generally adopts contactor or circuit breaker as executive component.
Utility model content
The utility model object is to provide a kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer, make full use of its abundant On-Chip peripheral interface, by the detection to two-way supply voltage, frequency and phase sequence with judge auto switching electric source, and can by user select as required control model, setting voltage and frequency normal range of operation, set the switching delay time, solve the problems referred to above that exist in background technology.
The technical solution of the utility model is: a kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer, comprise conventional power supply, stand-by power supply, voltage transformation module, waveform transformation unit, selected cell, circuit-breaker status detecting unit, circuit breaker control unit, single-chip microcomputer, button, display unit and communication module, described conventional power supply, stand-by power supply is connected to each other by the input interface A/D of voltage transformation module and single-chip microcomputer, waveform transformation unit is arranged between voltage transformation module and single-chip microcomputer, its three-phase output end respectively with the interface ICP of single-chip microcomputer, interface INT0, interface INT1 is connected to each other, the output interface PD4 of single-chip microcomputer is connected to each other by selected cell and waveform transformation unit, circuit-breaker status detecting unit, single-chip microcomputer is connected successively with circuit breaker control unit, the parallel input interface of button and single-chip microcomputer is connected to each other, display unit, communication module is connected to each other with the output interface of single-chip microcomputer respectively.
Also comprise optical coupling isolation device, described optical coupling isolation device has two, is separately positioned between circuit-breaker status detecting unit and single-chip microcomputer, between circuit breaker control unit and single-chip microcomputer.
Described single-chip microcomputer comprises Flash program storage, SRAM, E 2pROM, external interface and programmable watchdog timer, wherein external interface comprises two 8 bit timings/counters, one and has 16 bit timings/counter, 8 path 10 position A/D converters, the I of input capture output comparison and PWM function 2analog comparator in C serial line interface, UART USB (universal serial bus), SPI synchronous serial interface and sheet.
Described display unit comprises charactron, light-emitting diode, spi bus and LED drive circuit.
Described communication module comprises data receiver line, data transmission line and RS485 driver MAX485.
The beneficial effects of the utility model are: take ATmega16 single-chip microcomputer as core, make full use of its abundant On-Chip peripheral interface, by the detection to two-way supply voltage, frequency and phase sequence with judge auto switching electric source, and can by user select as required control model, setting voltage and frequency normal range of operation, set the switching delay time.Take the dual interference protection measure of hardware and software to improve the reliability of controller.
Accompanying drawing explanation
Fig. 1 is structured flowchart of the present utility model;
In figure: conventional power supply 1; Stand-by power supply 2; Voltage transformation module 3; Waveform transformation unit 4; Selected cell 5; Circuit-breaker status detecting unit 6; Circuit breaker control unit 7; Single-chip microcomputer 8; Button 9; Display unit 10; Communication module 11; Optical coupling isolation device 12.
Embodiment
Below in conjunction with accompanying drawing, by embodiment, the utility model is described in further detail.
A Dual-power automatic switching controller based on ATmega16 single-chip microcomputer, comprises conventional power supply 1, stand-by power supply 2, voltage transformation module 3, waveform transformation unit 4, selected cell 5, circuit-breaker status detecting unit 6, circuit breaker control unit 7, single-chip microcomputer 8, button 9, display unit 10 and communication module 11, described conventional power supply 1, stand-by power supply 2 is the input interface A/D(ac/dc with single-chip microcomputer 8 by voltage transformation module 3) be connected to each other, waveform transformation unit 4 is arranged between voltage transformation module 3 and single-chip microcomputer 8, its three-phase output end respectively with the interface ICP(input capture end of single-chip microcomputer 8), interface INT0(external relay 0), interface INT1(external relay 1) be connected to each other, the output interface PD4 of single-chip microcomputer 8 is connected to each other by selected cell 5 and waveform transformation unit 4, circuit-breaker status detecting unit 6, single-chip microcomputer 8 is connected successively with circuit breaker control unit 7, and button 9 is connected to each other with the parallel input interface of single-chip microcomputer 8, display unit 10, communication module 11 is connected to each other with the output interface of single-chip microcomputer 8 respectively.
Also comprise optical coupling isolation device 12, described optical coupling isolation device 12 has two, is separately positioned between circuit-breaker status detecting unit 6 and single-chip microcomputer 8, between circuit breaker control unit 7 and single-chip microcomputer 8.
Described single-chip microcomputer 8 comprises Flash program storage, SRAM(static random access memory), E 2the modifiable read-only memory of PROM(user), external interface and programmable watchdog timer, wherein external interface comprises two 8 bit timings/counters, one and has input capture output comparison and PWM(pulse width modulation) 16 bit timings/counter, 8 path 10 position A/D converters, the I of function 2c(twin wire universal serial bus) serial line interface, the universal asynchronous reception/dispensing device of UART() USB (universal serial bus), SPI(Serial Peripheral Interface) analog comparator in synchronous serial interface and sheet.
Described display unit 10 comprises charactron, light-emitting diode, spi bus and LED(light-emitting diode) drive circuit.
Described communication module 11 comprises data receiver line, data transmission line and RS485 driver MAX485.
In the time that controller detects that deviation that conventional supply voltage or frequency occur exceeds scope that user sets or phase sequence mistake, conventional power circuit breaker separating brake order is sent in time delay, sends power generation command request diesel engine simultaneously and starts generating; When backup power source voltage and frequency reach normal range (NR) and phase sequence when correct, the auxiliaries-supply circuit-breaker order of closing a floodgate is sent in time delay; If conventional power up is normal, first the order of auxiliaries-supply circuit-breaker separating brake is sent in time delay, and then the order of closing a floodgate of conventional power circuit breaker is sent in time delay, automatically load is switched to conventional power supply and sends power failure instruction request diesel engine simultaneously and stop generating.
The time-delay characteristics of design are recoverable, and the state variation detecting in delay time stops time delay process while reinstatement.This time delay control can prevent that the interference in testing process from causing controller misoperation, can effectively prevent due to the electric operating mechanism of circuit-breaker inconsistent moment that may cause of the operate time phenomenon of closing a floodgate simultaneously simultaneously.
Two circuit breakers of dual power supply automatic switching device are conventionally with mechanical interlock, in controller design, consider again software electrical interlocks, determine circuit breaker order according to switch logic and circuit-breaker status, thereby the signal that guarantees can not send during in "on" position when a circuit breaker combined floodgate of another circuit breaker, has further improved functional reliability.
Two-way power supply is transformed into through voltage transformer (PT) AC signal that maximum amplitude is 2.5 V, and the direct current biasing of stack 2.5 V accesses the A/D input of ATmega16 (in the sheet of ATmegal28, ADC can only carry out unipolarity A/D conversion) later and measures supply voltage amplitude; AC signal becomes square-wave signal through the waveform transformation processing of circuit of zero-crossing comparator composition, three-phase accesses respectively input capture end (ICP), external interrupt 0 (INT0) and external interrupt 1 (INTl) and measures supply frequency and phase sequence, and by an I/0 mouth line (PD4), the square-wave signal of two-way power supply is selected.
In order to improve antijamming capability, the circuit-breaker status signal of introducing from two-way auxiliary contacts of circuit breaker accesses single-chip microcomputer parallel interface (PB3 mono-PB0) through optical coupling isolation device, and provides indication by the LED on panel.The circuit-breaker switching on-off control command of being sent by parallel interface (Pc7, PC6, PC1, PC0) is also through the motor-operating mechanism of optical coupling isolation device and drive circuit access circuit breaker.The button of parameters is accessed single-chip microcomputer and is adopted on inside by parallel interface (PA7, PA6, PD7) and draws input mode, and the demonstration of charactron and light-emitting diode is realized through LED display driver circuit MAX7219 by spi bus (PB4, PB5, PB7).
Communication module is for compatibility Control Networks of Intelligent Electrical Apparatus in the past, select RS485 full-duplex communication to provide power state information and automatic change-over running state information to computer or other RS485 controllers, and can work by computer or other RS485 controller control automatic change-overs, or revise automatic change-over operational factor.Physical circuit allows control line (PD5) to complete through RS485 driver MAX485 by the data receiver line of USB (universal serial bus) UART and data transmission line (RXD, TXD) and selected transmission.
Hardware and software debugging is by JTAG(joint test behavior tissue) interface carries out.When debugging and after program Solidification completes, utilize the 2 piece I/O mouth lines shared with jtag interface to realize the start-stop control of diesel engine generator by the drive circuit identical with breaker control circuit.
In application process, 1, supply voltage detect
According to frequency monitoring result, utilize respectively 8 bit timings/counter T0 and T2 to set sampling interval of conventional power supply (ADC0 mono-ADC2) and stand-by power supply (ADC3 mono-ADC5) in the mode of interrupting, every cycle 16 points of sampling.The analog to digital converter of ATmega16 single-chip microcomputer is 10, and its sampling error is l/2 10≈ 0.1%.Voltage effective value can use discrete Fourier transform (DFT) to process the voltage sample value of one-period, by calculating sinusoidal component and the cosine component of fundamental voltage, obtains fundamental voltage effective value.Its advantage is can directly filtering DC component, but for containing the signal of harmonic component, has certain error, between first-harmonic effective value and total effective value especially in the time that harmonic components is larger.And adopt the amount of calculation of DFT calculating higher harmonic components very large, although ATmega16 is high-speed microprocessor but still the requirement that can not meet real-time calculating, through experiment relatively, in practical application, adopt according to the method for effective value definition calculating voltage effective value, and the data of 5 cycles of continuous acquisition are calculated with filtering noise, wherein the numerical value of DC component by experiment the mode of (calibration) determine and be stored in EEPROM.
2, supply frequency detects
With zero passage voltage comparator, the three-phase alternating voltage of conventional power supply and stand-by power supply is shaped to square-wave signal respectively, utilize a L/O mouth line traffic control of single-chip microcomputer select for three group 21 digital switch (data selector) by A, B, C three-phase square wave signal be input to respectively the input capture port IcP of single-chip microcomputer and exterior interrupt input port IN Ah, INTl (being all set to rising edge input capture and external interrupt request).The clock setting of 16 bit timings/counter Tl is 8 frequency divisions of crystal oscillator frequency (8 MHz), and the clock frequency of counter is 1 MHz, and counter adds 1.In the time of input capture pin generation positive transition, the count value of timer conter T1 is automatically latched into input capture register and sends and interrupts application, can in interrupt service routine, read the count value of input capture register, and the difference of the count value of twice input capture interrupt is the signal period, get final product calculated rate according to the cycle.In order to improve precision and the reliability of frequency measurement, in actual design, take equally how all wave measurements, be averaged by catching multiple rising edges the cycle that obtains pulse signal.The count value of supposing input capture passage Timer/Counter L in the time the rising edge of the 1st and n+1 pulse signal being detected is respectively m 1, m 2, counter overflow number of times is IV, institute's measured frequency is:
In the time of A phase voltage phase shortage, utilize the square-wave signal (INT0) of B phase voltage or the square-wave signal (INTl) of C phase voltage to carry out frequency measurement.The count value that now need to read timer in service in interrupt service routine, this mode has introduced interrupt response and break in service starts the measure error causing to the time delay of read counter process.This error is conventionally negligible, also can reduce this error by the method for fixed compensation.
3, phase sequence detects
Phase sequence detects and frequency detecting adopts same set of signal conditioning circuit and similar monitoring method, timer count value (moment occurs) t write down respectively signal rising edge in the input capture interrupt of A phase square wave and the service of the external interrupt of B phase square wave time 1and t 2, its difference △ t is corresponding to the signal positive going zeror crossing time interval, then according to the definition of phase difference, the cycle is all two signals of fourth, and the pass between its phase difference and time difference △ £ is
Figure 325131DEST_PATH_IMAGE002
Draw thus the phase difference that AB two is alternate, and judge, if 1100≤
Figure 931693DEST_PATH_IMAGE003
≤ 130 zero, can think that phase sequence is normal.In the time of A phase voltage phase shortage, because do not meet the normal phase order relation of three-phase alternating voltage, thus no longer measure the phase difference that BC two is alternate, and be directly judged to be phase sequence mistake.

Claims (4)

1. the Dual-power automatic switching controller based on ATmega16 single-chip microcomputer, is characterized in that: comprise conventional power supply (1), stand-by power supply (2), voltage transformation module (3), waveform transformation unit (4), selected cell (5), circuit-breaker status detecting unit (6), circuit breaker control unit (7), single-chip microcomputer (8), button (9), display unit (10) and communication module (11), described conventional power supply (1), stand-by power supply (2) is connected to each other with the input interface A/D of single-chip microcomputer (8) by voltage transformation module (3), waveform transformation unit (4) is arranged between voltage transformation module (3) and single-chip microcomputer (8), its three-phase output end respectively with the interface ICP of single-chip microcomputer (8), interface INT0, interface INT1 is connected to each other, and the output interface PD4 of single-chip microcomputer (8) is connected to each other by selected cell (5) and waveform transformation unit (4), circuit-breaker status detecting unit (6), single-chip microcomputer (8) is connected successively with circuit breaker control unit (7), and button (9) is connected to each other with the parallel input interface of single-chip microcomputer (8), display unit (10), communication module (11) is connected to each other with the output interface of single-chip microcomputer (8) respectively.
2. a kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer according to claim 1, it is characterized in that: also comprise optical coupling isolation device (12), described optical coupling isolation device (12) has two, is separately positioned between circuit-breaker status detecting unit (6) and single-chip microcomputer (8), between circuit breaker control unit (7) and single-chip microcomputer (8).
3. a kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer according to claim 1, is characterized in that: described display unit (10) comprises charactron, light-emitting diode, spi bus and LED drive circuit.
4. a kind of Dual-power automatic switching controller based on ATmega16 single-chip microcomputer according to claim 1, is characterized in that: described communication module (11) comprises data receiver line, data transmission line and RS485 driver MAX485.
CN201320712918.XU 2013-11-13 2013-11-13 Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer Expired - Fee Related CN203617782U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201320712918.XU CN203617782U (en) 2013-11-13 2013-11-13 Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201320712918.XU CN203617782U (en) 2013-11-13 2013-11-13 Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer

Publications (1)

Publication Number Publication Date
CN203617782U true CN203617782U (en) 2014-05-28

Family

ID=50770404

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201320712918.XU Expired - Fee Related CN203617782U (en) 2013-11-13 2013-11-13 Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer

Country Status (1)

Country Link
CN (1) CN203617782U (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068020A (en) * 2015-08-05 2015-11-18 成都君禾天成科技有限公司 Power supply detection control system adopting single-chip microcomputer technology for control
CN105282930A (en) * 2015-10-20 2016-01-27 晨辉光宝科技有限公司 Frequency adaptive LED lamp drive circuit
CN108233525A (en) * 2016-12-13 2018-06-29 通用电气公司 For the standby power system and its assemble method of component

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105068020A (en) * 2015-08-05 2015-11-18 成都君禾天成科技有限公司 Power supply detection control system adopting single-chip microcomputer technology for control
CN105282930A (en) * 2015-10-20 2016-01-27 晨辉光宝科技有限公司 Frequency adaptive LED lamp drive circuit
CN105282930B (en) * 2015-10-20 2018-10-02 晨辉光宝科技有限公司 A kind of LED lamp drive circuit that frequency is adaptive
CN108233525A (en) * 2016-12-13 2018-06-29 通用电气公司 For the standby power system and its assemble method of component
CN108233525B (en) * 2016-12-13 2024-05-03 通用电气技术有限公司 Backup power system for components and method of assembling the same

Similar Documents

Publication Publication Date Title
CN201674273U (en) Automatic transfer switch controller
CN101881790A (en) Intelligent electric power parameter tester
CN107622927B (en) High-voltage circuitbreaker electric operating mechanism control system and control method
CN105356825A (en) Hybrid system energy storage device
CN203617782U (en) Double-power-supply automatic switching controller based on ATmega16 single chip microcomputer
CN105914763A (en) Novel intelligent phase change switch and method for distribution network
CN101694984A (en) Asynchronous motor energy saver
CN204992761U (en) Electric energy quality is synthesized and is observed and controled appearance
CN103699004B (en) Based on automatic transfer switching electric appliance control system and the control method of parallel function
CN203191430U (en) Multifunctional electric power parameter display instrument based on DSP
CN208752434U (en) A kind of power supply device
CN203039336U (en) Breaker electronic type controller
CN204359907U (en) The measurement mechanism of Contacts actuation time and synchronizing characteristics measurement mechanism
CN103023046A (en) Zero passage switching filtering reactive compensation device based on digital signal processor (DSP) chip control
WO2018121074A1 (en) Intelligent hybrid compensation capacitor device
CN208723528U (en) A kind of low-voltage circuit breaker intelligent controller
CN205983670U (en) Electric intelligent valve accuse water gauge is prevented falling in low -power consumption
CN204597492U (en) A kind of reactive compensation system
CN209402146U (en) A kind of low-voltage circuit breaker intelligent controller based on coenocytism
CN203259874U (en) Test device for soft starter turn-off and performance conversion
CN101957401A (en) Power-distribution electric energy comprehensive measuring apparatus and measuring method thereof
CN102455396A (en) Three-phase alternating current open-phase and reverse phase detection method
CN202172050U (en) A shut release
CN201444194U (en) Comprehensive detection device for single-phase electric energy meter
CN206649314U (en) A kind of cable fault monitor system

Legal Events

Date Code Title Description
C14 Grant of patent or utility model
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20140528

Termination date: 20141113

EXPY Termination of patent right or utility model