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).
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
- Popular Resources
- Popular amplifiers
- 西门子S7-12001500 PLC SCL语言编程从入门到精通 (北岛李工)
- Siemens Motion Control Technology and Engineering Applications (Tongxue, edited by Wu Xiaojun)
- MCU C language programming and Proteus simulation technology (Xu Aijun)
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Naxin Micro and Xinxian jointly launched the NS800RT series of real-time control MCUs
- How to learn embedded systems based on ARM platform
- Summary of jffs2_scan_eraseblock issues
- Application of SPCOMM Control in Serial Communication of Delphi7.0
- Using TComm component to realize serial communication in Delphi environment
- Bar chart code for embedded development practices
- Embedded Development Learning (10)
- Embedded Development Learning (8)
- Embedded Development Learning (6)
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Intel promotes AI with multi-dimensional efforts in technology, application, and ecology
- ChinaJoy Qualcomm Snapdragon Theme Pavilion takes you to experience the new changes in digital entertainment in the 5G era
- Infineon's latest generation IGBT technology platform enables precise control of speed and position
- Two test methods for LED lighting life
- Don't Let Lightning Induced Surges Scare You
- Application of brushless motor controller ML4425/4426
- Easy identification of LED power supply quality
- World's first integrated photovoltaic solar system completed in Israel
- Sliding window mean filter for avr microcontroller AD conversion
- What does call mean in the detailed explanation of ABB robot programming instructions?
- STMicroelectronics discloses its 2027-2028 financial model and path to achieve its 2030 goals
- 2024 China Automotive Charging and Battery Swapping Ecosystem Conference held in Taiyuan
- State-owned enterprises team up to invest in solid-state battery giant
- The evolution of electronic and electrical architecture is accelerating
- The first! National Automotive Chip Quality Inspection Center established
- BYD releases self-developed automotive chip using 4nm process, with a running score of up to 1.15 million
- GEODNET launches GEO-PULSE, a car GPS navigation device
- Should Chinese car companies develop their own high-computing chips?
- Infineon and Siemens combine embedded automotive software platform with microcontrollers to provide the necessary functions for next-generation SDVs
- Continental launches invisible biometric sensor display to monitor passengers' vital signs
- 【FAQ】Trust&GO for any cloud service |Microchip Security Solutions Seminar Series 3
- ARM and Intel, which one can replace DSP?
- CC4019------Four 2 to 1 data selector
- 51 MCU controls the USB host bottom-level driver of SL811HS
- Digital Circuit History, Moore's Law and Future Trends
- [Multi-function open source custom macro keyboard] Material unboxing - ESP32-S2-KALUGA-1 and ESP32-S3-DEVKITC-1-N8
- 【Project source code】Calculator based on FPGA
- Will 65V GaN technology change the radar market?
- Simulation Design of Ultra-Wideband Helical Antenna
- Why does DLL not found error appear when running VB with Ginkgo?