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.
Previous article:Implementation of a Differential Delay Line ADC in a DC/DC Converter
Next article:Application of M57962L chip in IGBT drive
- MathWorks and NXP Collaborate to Launch Model-Based Design Toolbox for Battery Management Systems
- STMicroelectronics' advanced galvanically isolated gate driver STGAP3S provides flexible protection for IGBTs and SiC MOSFETs
- New diaphragm-free solid-state lithium battery technology is launched: the distance between the positive and negative electrodes is less than 0.000001 meters
- [“Source” Observe the Autumn Series] Application and testing of the next generation of semiconductor gallium oxide device photodetectors
- 采用自主设计封装,绝缘电阻显著提高!ROHM开发出更高电压xEV系统的SiC肖特基势垒二极管
- Will GaN replace SiC? PI's disruptive 1700V InnoMux2 is here to demonstrate
- From Isolation to the Third and a Half Generation: Understanding Naxinwei's Gate Driver IC in One Article
- The appeal of 48 V technology: importance, benefits and key factors in system-level applications
- Important breakthrough in recycling of used lithium-ion batteries
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- 【RT-Thread Reading Notes】3. RT-Thread Study Chapter 4-5 Reading Notes
- TI DSP 6000 Series Optimization Experience
- HTTP protocol request and data capture
- March
- Use of hardware multiplier in MSP430 library
- UPD78F0888A Renesas MCU peripheral settings
- Review summary: Kanzhi K510 CRB-KIT development kit
- Dear masters, does anyone have the interface dimensions of the LC RF coaxial connector? I need it urgently. Thank you!
- ST Motor_by Changjianze1
- 【ST NUCLEO-H743ZI Review】 + LIS25BA Data Collection