A New Solution for Regulating Voltage Value in Digital Control DC Stabilized Power Supply

Publisher:Ziyu2022Latest update time:2012-12-27 Source: 电源网 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

Digitally controlled DC regulated power supply is one of the commonly used devices in electronic technology. Most of the devices currently used are used to adjust the voltage value through a knob switch. The adjustment accuracy is not high, and jumps often occur, which is extremely inconvenient to use. This digitally controlled DC regulated power supply sets the digital quantity input to the DAC through the host computer and outputs a step-adjustable voltage. The host computer and the slave computer communicate through the USB simulated by the software. Traditional single-chip microcomputers and computers communicate via USB, and special interface chips are required for USB protocol conversion, such as CP2101, FT232, CH342, PDIUSBD12, SL811, etc. Chips such as CP2101 and FT232 are simple to use, but their functions are relatively simple; while PDIUSBD12 and SL811 are more powerful, but complex to use. In addition, the prices of these special chips are relatively high, which increases the cost of the system. VUSB is simple to use and low-cost. It only requires an ordinary low-cost AVR microcontroller and a few external components to form a USB system.

1 System Hardware Design

The system composition framework is shown in Figure 1. It is mainly composed of 8-channel serial input DACMAX522, voltage-regulated output circuit, VUSB interface circuit, signal conditioning circuit, microcontroller Atmega8 and other peripheral components. It can output a voltage of 0~12V with a step accuracy of 0.1V and a current of up to 2A. At the same time, the output voltage value can be set by the host computer.

Figure 1 Composition of CNC DC voltage regulator

1.1 Analog-to-digital conversion

D/A conversion is mainly achieved using the MAX522 chip.

The MAX522 chip has two 8-bit voltage buffer output D/A converters (DAC A and DAC B), 8-pin saving package and DIP package, DAC A end buffer working current can reach 5mA, DAC B end buffer working current can reach 500μA, MAX522 works in a unidirectional voltage of +2.7V~+5.5V.

MAX522 has a 3-wire serial interface that is directly compatible with SPITM, QSPITM, and MicrowireTM. It has a 16-bit input shift register that contains 8-bit DAC input data and 8-bit DAC selection and shutdown control. Data can be stored in the DAC register on the positive edge of /CS.

The analog-to-digital conversion module circuit is shown in Figure 2. The PB0 port of the microcontroller is connected to the serial data input port DIN, the PB1 port is connected to the chip select signal, and the PB2 port is connected to the clock signal SCLK. Select DAC A as the output, and connect a 0.1μF capacitor to the output and reference voltage input terminals to improve the output stability of the circuit. The VDD and reference voltage terminals of the chip are both provided by a 5.12V voltage regulator circuit.

Figure 2 Analog-to-digital conversion and voltage stabilization circuit

The LM336 integrated circuit is a precision 5V voltage regulator, which works as a 5V Zener diode with a low temperature coefficient and a dynamic resistance of 0.2Ω. The fine-tuning terminal (G) can fine-tune the reference voltage and temperature coefficient. The output voltage of the LM336 is adjusted to 5.12V by adjusting the adjustable resistor. Therefore, the resolution of the MAX522 output voltage is 5.12/256=0.02V, which means that the voltage increases by 0.02V for every increase of 1 in the MAX522 digital input. Since the power supply output voltage range is 0~12V and the step accuracy is 0.1V, the maximum input data is 120 (the binary value is 11110000), and the MAX522 output value is 2.4V. That is, the output voltage of the MAX522 changes from 0 to 2.4V.

1.2 Voltage and current amplification

Since the voltage range of MAX522 output is 0~2.4V, and the required voltage output range is 0~12V, the output of MAX522 needs to be amplified by 5 times. At the same time, in order to improve the driving ability of the power supply, an emitter follower is added after the amplifier circuit.

The voltage and current amplifier circuit is shown in Figure 3. It mainly includes the amplifier part composed of two μA741 high-gain operational amplifiers and the emitter output part composed of triode ZTX453. The first stage μA741AN is a negative feedback buffer circuit, which is used to reduce the output resistance and increase the amplification frequency bandwidth. The second stage μA741ANA constitutes a voltage forward proportional amplifier circuit. The amplified voltage signal is connected to the emitter follower ZTX453 to amplify the current of the output signal. Note that this part of the circuit generates a lot of heat, and a heat sink needs to be expanded for heat dissipation.

Figure 3 Voltage and current amplifier circuit.

1.3 VUSB Interface

VUSB uses a common general-purpose AVR microcontroller, equipped with a high-frequency crystal oscillator (12MHz or 16MHz), to simulate the signals required by USB, thereby simulating a standard USB HID device (mouse, keyboard, simple communication) solution, forming a low-cost USB device. USB has a total of 4 wires, 2 5V power supplies, and two differential signal lines D+ and D-. Because it is a low-speed device, D- must have a 1.5kΩ pull-up resistor.

The VUSB interface circuit is shown in Figure 4. The PD1 and PD2 of the microcontroller are connected to the D- and D+ of the standard USB interface respectively through a 68Ω current limiting resistor.

It should be noted that D+ must be connected to the external interrupt 0 pin of the microcontroller. In order to simplify the connection, PD2 (INT0) is directly connected as one of the signal lines. Since the maximum voltage of the USB signal line is 3.6V, a 3.6V voltage regulator diode is connected to D- and D+ respectively.

Figure 4 VUSB interface circuit.

2 System Software Design

The software design includes two parts: the lower computer and the upper computer. The lower computer is mainly responsible for receiving the set voltage value of the upper computer, and inputting it into MAX522 after conversion, so as to output the set voltage. The upper computer is connected to the lower computer through VUSB and writes data to the lower computer through the simulated USB protocol.

2.1 Lower computer software

The software flow chart of the lower computer is shown in Figure 5. The device initialization includes the initialization of the MCU port, the DAC initialization and the VUSB port initialization. After initialization, the program enters the main loop, in which the USB polling function usbPoll() is added to detect USB events. Once the upper computer detects a USB communication request, usbdrv will call the usbFunctionSetup() function to process the request. In this request function, the data from the upper computer is received and converted and written to the MAX522 data port to start the DAC output voltage.

Figure 5: Lower computer software flow.

The following points should be noted in the design:

1) The VUSB underlying driver function of the microcontroller uses AVRUSB. The latest version of AVR-USB is written in C language and has detailed comments. The development platform is WinAVR. The GCC project folder must contain the driver file (usbdrv folder), and some macro definitions in usbconfig.h must be modified.

#define USB_CFG_IOPORTNAME D //This port is connected to the USB bus. When configured as "D", registers PORTD, PIND and DDRD will be valid.

#define USB_CFG_DMINUS_BIT 1 // Bit configuration, which is the line connected to USB D- in USB_CFG_IOPORT. Can be configured to any bit of the interface.

#define USB_CFG_DPLUS_BIT 2//bit configuration, connect the USB D+ line in USB_CFG_IOPORT. You can also connect it to any port, but note that D+ must be connected to the interrupt port INT0

2) When the MCU receives the read data command, it will automatically call usbFunctionSetup(uchar data[8]), point the global pointer *usbMsgPtr to the first address of the data to be sent, and then return (function return value) the length of the data to be sent. Since the command packet method is used to transmit data, only 4 bytes of valid data can be received each time, which are stored in data[2]~data[4].

3) During initialization, the output of MAX522 needs to be turned off.

When writing to the MAX522, the 8-bit control word is written first, followed by the 8-bit DAC data.

2.2 Host computer software

The host computer is written in C# language, and the driver uses an open source USB host computer driver library file called LibUsbDotNet. This driver library file also provides USB interface functions for .NET platform to call. When using it, the corresponding dynamic link library file must be included.

The host computer software mainly includes functions such as displaying the device connection status, writing the voltage value, and reading the current voltage value. The host computer software flow chart is shown in Figure 6.

Figure 6 Upper computer software flow.

The MCU will call the function usbFunctionSetup(uchar data[8]) only when the bus request is of user-defined type (Vendor), so data transmission is achieved by sending a user-defined type Setup data packet. When reading data, set this data packet to IN and write the number of bytes to be read. When writing data, set the data packet to OUT, and the 4 bytes of valid data are included in data[2]~data[4] of the established 8-byte Setup data packet.

3 Experimental verification and analysis

This digital controlled DC regulated power supply needs to be zeroed before use. In the initial state, adjust the external zeroing resistor of the integrated operational amplifier μA741 to make the integrated operational amplifier output 0, and adjust the emitter follower bias resistor R13 to make the output voltage 0.

When the output is at its maximum, adjust the proportional amplifier resistor R14 of the output integrated operational amplifier to make the output voltage 12V.

After zero calibration, the voltage value set by the host computer is compared with the actual output voltage. The experimental data is shown in Table 1.

Table 1 Voltage output comparison experimental results

The actual output value of the designed voltage source has a small deviation from the set value, which can meet the use requirements of 0~12V continuously adjustable output with a step value of 0.1V.

4 Conclusion

A digitally controlled DC regulated power supply based on single chip microcomputer and VUSB technology for data transmission control is designed. The output voltage value is controlled by single chip microcomputer, the step adjustment is convenient and the output is stable. It can be used as a separate power supply or embedded in other test systems that require step voltage modules.

Reference address:A New Solution for Regulating Voltage Value in Digital Control DC Stabilized Power Supply

Previous article:Implementation of a Differential Delay Line ADC in a DC/DC Converter
Next article:Application of M57962L chip in IGBT drive

Latest Power Management 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号