CNC multi-channel DC regulated power supply design based on AT89C51

Publisher:幸福梦想Latest update time:2023-07-03 Source: elecfansKeywords:AT89C51 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

In today's society, people greatly enjoy the convenience brought by electronic devices, but any electronic device has a common circuit-the power circuit. DC power supplies tend to be multi-functional and digital. Most of the power supplies of DC stabilized power supplies are AC power supplies. When the voltage of the AC power supply or the load resistance changes, the DC output voltage of the regulator will remain stable. DC Stabilized Power Supply As electronic equipment develops towards high precision, high stability and high reliability, high requirements are placed on the power supply of electronic equipment. This article takes the microcontroller as the core to form a numerically controlled DC regulated power supply that can control 6 positive and negative outputs at the same time, and has functions such as fixed-point display and touring display.


  1 System functions and features

  The system has 6 voltage outputs, 3 of which are positive and 3 are negative. The voltage adjustment range is 0~35 V, the maximum output current (A) is 5, 2 and 1 respectively, and has over-current protection function. The digital display has 5 digits, of which 1 digit displays the road number, 1 digit displays the voltage polarity, and the other 3 digits display the output voltage. The keyboard is equipped with 16 keys. The numeric keys 0 to 9 and the decimal point key are used to set the voltage output channel number and amplitude; the "↑" key is to gradually increase the output voltage or channel number; the "↓" key is to gradually decrease the output voltage or Route number; "CLR" key is used to clear wrong input and restore the original state; "#" key is used to start the voltage setting state and confirm new settings; "@" key is the switching key between tour display and fixed-point display.


  This system has three working states: itinerant display, fixed-point display and voltage setting. When the power is turned on, it is automatically set to the circuit display state, and it will display different road numbers and corresponding voltages on the display every 4 seconds. If you press "#" again, the voltage display value will flash, indicating that it has entered the voltage setting state. If you press "2", "6", "·", "3" in sequence, and then press the "#" key to confirm, the new voltage of 26.3 V is the actual output and the setting is completed. You can also use the "↑" and "↓" keys to set the voltage in 0. 1 V increments in the voltage setting state. The system is equipped with an automatic identification function and will not accept voltage settings outside the operating range. Before pressing the "#" key, you can use the "CLR" key to clear the mistakenly input voltage and then reset it. In the fixed-point display state, you can use the numeric keys, "↑" or "↓" key to select the voltage circuit number to be monitored. Likewise, the system will not accept road number settings outside the actual range. The positive and negative values ​​of the output voltage are automatically given by the system without user input. To switch between tour display and fixed-point display, just press the "@" key.


  2 Hardware circuit analysis

  The system uses AT 89C 51 microcontroller as the control core, which is fully compatible with the instructions and functions of the 8031 ​​microcontroller. At the same time, it also adds a built-in 4 KB flash memory, has 128 B internal RAM, 3 I/O ports, low power consumption, compact size, and can meet system requirements without expanding the memory. Figure 1 is the system hardware schematic diagram.

 

  2.1 Voltage output circuit

  The voltage output circuit principle is shown in Figure 2. The adjustment tube adopts a common emitter connection method. Compared with the common common collector connection method, the power consumption and ripple coefficient are greatly reduced. By adding and adjusting tubes and appropriately increasing the capacity of BG 2, the power output capacity can be expanded. Since the voltage feedback adjustment uses a proportional integral regulator, the output voltage can completely track the control voltage Uin in the normal working area. After derivation, the steady-state output voltage value Uo = WinRw /Rr.Rb and BG 3 can be obtained. current protection circuit. Theory can prove that this loop is approximately a first-order control system and has absolute stability. Therefore, it is very suitable for the system design requirements. Detailed analysis instructions can be found in the literature [2].


  2.2 Control voltage given loop

  The control voltage given loop is composed of a microcontroller, a D/A converter and a sampling and holding device. The control voltage is provided by D/A,

 

  The system adopts open-loop control method. Generally speaking, the anti-interference ability and accuracy of open-loop control are poor [3]. However, because this voltage output circuit adopts a unique structure, it can achieve static error adjustment. In this way, the A/D sampling and comparison circuits in the circuit similar to literature [2] can be omitted, which not only reduces the cost, but also simplifies the structure. Its control algorithm is simple and its reliability is significantly enhanced. D/A output is generally stable but has limited resolution. According to the design requirements of this system, the resolution of the output voltage must be greater than 0.1 V. It is known that the regulated output range is 0~35V. If the range and reference voltage of D/A are calculated in 5V, then the resolution of D/A is B It should satisfy 2B> 35/0.1, B> ​​8.4. Therefore, a 10 or 12-bit D / A converter can be used. In order to ensure a certain margin, the system uses DAC 1210. This system has multiple positive and negative outputs, considering that the price of high-end D / A converters is relatively high. The sample-hold circuit consists of data latch 74L S 273, and six sample-hold LF 398. When the DAC 1210 outputs the control voltage of the Nth channel (1≤N≤6), the sampling/holding device LF 398 of the corresponding channel changes from the holding state to the sampling state through the change of the Nth bit output state of the 74L S 273. Then, it returns to the holding state, thereby realizing the sampling and holding of the control voltage.


  2.3 Display and keyboard interface circuit

  Considering the heavy burden on the monitoring software of this system, the display adopts the static display mode [5]. It is not difficult to find that the polarity of the power supply output is determined by the circuit structure of the output voltage loop, and has a one-to-one correspondence with the circuit number. Therefore, it can be set automatically by the software. Therefore, two digital tubes can completely share a set of 8-bit display data. In this way, only 4 latches (74L S273) are needed for the 5-bit LED. The keyboard circuit is set at the P 1 port and is a typical 4×4 interrupt scanning keyboard.


  3 System software design

  This software design effectively overcomes the difficulties in software design caused by the system's multiple functions and complex state transitions by reasonably arranging interruptions and dividing each functional module, and setting up a unified status word. The system software flow chart is shown in Figure 3.


  3.1 Status word design

  The status word (SB) occupies one byte and has 5 valid bits. After the status word channel is started, it controls the specified device to complete the specified operation. At the same time, during the process of controlling the peripheral device, the channel must record the execution status of the channel and the device. For this purpose, the system arranges another fixed unit in the main memory. Used to store these recorded states, there are

  SB .0 = 1, means it is in tour display state, SB .0 = 0, meaningless;

  SB .1 = 1, means it is in fixed-point display state, SB .0 = 0, meaningless;

  SB .2 = 1, means it is in the voltage setting state, SB .0 = 0, meaningless;

  SB .3 = 1, means the voltage setting value is wrong; SB .3 = 0, means the voltage setting value is correct;

  SB .4 = 1 means that the voltage is not set digitally for the first time; SB .4 = 0 means that the voltage is set digitally for the first time.

  3.2 Each functional processing module

 

  main program. Carry out system initialization settings (initialization of I/O ports, timing, interrupts, status words, various data buffers, etc.) and wait for interrupts. Scheduled interrupt service routine. The stability of the output voltage is the most important indicator of the voltage regulator. Considering that the sample-hold output has a slow falling rate (when the LF 398 holding capacitor is 0.1 μF, the falling rate is about 200 V·min-1), it needs to be maintained and the voltage refreshed regularly. This service program completes the refreshing and display of voltage values ​​of each channel. The interrupt request is made by the timer/counter T 0 and is interrupted every 130 ms. The interrupt service level is the highest level. Keyboard interrupt service routine. According to the key code and current status word, jump to the corresponding function handler, and the interrupt is introduced by IN T 0. Key scan decoding program. Translate 0~9, decimal point, and other keys into hexadecimal codes corresponding to 00H~0F H. Display the decoding program. Translate the contents of the key code buffer into seven-segment codes and store them in the corresponding display buffer. D/A decoder. Translate the contents of the key code buffer into the corresponding 12-bit D/A binary number, and store it in the corresponding D/A data buffer (one output occupies 2 B). Show subroutine. According to the number of channels, the content of the data buffer of the channel is ORed with the mask word, and then sent to the corresponding digital tube. Error program identification program 1. In the voltage setting state, determine the error in the data format of the key code buffer after typing in the digital code, restore the state before typing in, and give the corresponding flag (SB.3). Error program identification program 2. In the voltage setting state, it is determined that after the "↑" key and "↓" key are entered, the key code buffer data format error returns to the state before the key was entered, and the corresponding flag is given (SB.3).

[1] [2]
Keywords:AT89C51 Reference address:CNC multi-channel DC regulated power supply design based on AT89C51

Previous article:Design of serial bus chip testing experimental platform based on AT89C51 microcontroller
Next article:Analysis of the design scheme of electronic therapeutic instrument based on embedded device AT89C51SNDIC

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

Design and simulation of multi-channel temperature monitoring system based on DS18B20
0 Introduction     In real-time temperature monitoring systems, such as greenhouse temperature monitoring, cold storage temperature measurement, intelligent building temperature control and other systems, it is often necessary to collect and detect multiple temperatures. Rapid and reliable acquisition of high-precisi
[Microcontroller]
Design and simulation of multi-channel temperature monitoring system based on DS18B20
Interface Design Based on AT89C5131
Introduction AT89C5131 is a MCU based on 52 core. In terms of memory, it integrates 32 KB of FLASH memory for code storage; 1 KB of E2PROM memory for user data storage; users can use the on-chip Bootloader or FLASH API to perform ISP or IAP programming on the FLASH memory and E2PROM memory through the USB interf
[Microcontroller]
Interface Design Based on AT89C5131
A wireless remote control analysis solution using AT89C51 as the control core
0 Introduction With the continuous development of society and the emergence of smart devices, remote controls are becoming more and more widely used. Wireless remote controls have become more and more common in all aspects of life due to their long control distance and strong anti-interference performance. This
[Microcontroller]
A wireless remote control analysis solution using AT89C51 as the control core
Design of temperature measurement and control system based on AT89C51 single chip microcomputer
0 Introduction Temperature measurement and control are widely used in daily life and industrial fields. With the substantial improvement of people's living standards, there are higher requirements for the accuracy and range of temperature measurement and control. In industrial enterprises, how to improve the operatin
[Microcontroller]
Design of temperature measurement and control system based on AT89C51 single chip microcomputer
Design of remote control alarm system based on single chip microcomputer
1 Introduction Due to the rapid development of the economy, people's living standards have been greatly improved, and the pace of life has become faster and faster. Therefore, home appliance remote control and family safety are also needed and valued by people. The remote control and alarm device of electrical a
[Microcontroller]
Design of remote control alarm system based on single chip microcomputer
Application of AT89C51 single chip microcomputer in cutting force measurement of CNC lathe
AT89C51 is a low voltage, high performance CMOS 8-bit microprocessor with 4K bytes of flash programmable and erasable read only memory (FPEROM), commonly known as a single chip microcomputer. The device is manufactured using ATMEL's high-density non-volatile memory manufacturing technology and is compatible with the
[Microcontroller]
Application of AT89C51 single chip microcomputer in cutting force measurement of CNC lathe
Design of traffic lights at crossroads based on AT89C51 single chip microcomputer
The actual picture is as follows:   This is a traffic light design simulation schematic diagram for a crossroads (the proteus simulation project file can be downloaded in the attachment of this post)   The keil microcontroller source program is as follows: #include include.h sbit NS_GRE = P2^5;       sbit NS_YEL
[Microcontroller]
Design of traffic lights at crossroads based on AT89C51 single chip microcomputer
Audio signal amplitude equalization control amplifier designed using SG270/LM4884 and AT89C51
Introduction Many schools today have adopted computer plus network multimedia systems for on-site teaching. In addition, construction workers making intercom calls at the construction site, and drivers making calls on moving tanks and other self-propelled artillery vehicles, etc., cannot avoid noisy background noise
[Microcontroller]
Audio signal amplitude equalization control amplifier designed using SG270/LM4884 and AT89C51
Latest Microcontroller Articles
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号