When doing daily DIY or experimenting, having a handy adjustable power supply is an essential tool. I have made a simple version of an adjustable power supply ( XL4016 solution) using an adjustable precision resistor to adjust the voltage a long time ago. It was OK at the beginning. After using it for less than half a year, the potentiometer often had poor contact, and sometimes a small Vibration or accidental touching of the knob will cause the output to directly jump to the highest voltage. So I came up with the idea of making a digitally controlled power supply. After searching for information, I added a voltage signal to the feedback pin of XL4016 (implemented using a DAC), and paired it with a certain voltage dividing resistor to realize digital control adjustment to a certain extent. This should It is considered version 1.0. The circuit is relatively simple, but it only has a constant voltage output, and there is no way to maintain a constant current, so the idea of 2.0 came up. The following features are planned
1. Output parameters: constant voltage / constant current, 0-28V, 0-4A, 0.01V, 0.001A
2. Adopt digital encoder adjustment to ensure stable adjustment. Three-speed adjustment speed can quickly and accurately reach the desired voltage / current .
3. Output lock to avoid accidental touch.
4. Small size, low power, fanless and silent design, but it must have temperature monitoring to monitor the temperature of the main heating elements in real time.
5. Multi-protocol fast charging interface, can quickly charge mobile phones, etc.
6. The output voltage and current data are calibrated through external devices to reduce hardware dependence.
7. Connect to the computer through the RS485 protocol, and display the voltage and current curve on the computer. You can also import calibration data through the computer, set up quick start, etc.
8. Use LED to display device status, for example, green - constant voltage status, red - constant current status
9.Can charge the battery
The project is published for the first time. It is an original project. It has not participated in other competitions. It is not a graduation project/course design.
GPL3.0 open source agreement
The CNC power supply we made earlier uses XL4016 as the main control and output. However, since there is only one channel inside the XL4016, it can only control one voltage parameter. If we want constant voltage and constant current, we can only add two sets of external operational amplifiers as comparators. Two comparators are used to control the voltage and current respectively, and then the two control results are returned to the feedback pin of the 4016. This method is feasible in actual testing. There are many modules on the market based on this principle, but this method is not an excellent one after all. s solution.
In the process of searching for information, I accidentally discovered the ancient chip TL494. This chip has two built-in comparators, a built-in reference, and adjustable switching frequency. It is a perfect solution, so the buck step-down CNC based on TL494 can Adjusting the power supply will help. The picture below shows the internal frame diagram of TL494
As can be seen from the figure, two independent error comparators realize voltage and current control (i.e. pins 1, 2, 15, 16) and main frequency setting (pins 5 and 6) respectively.
The hardware is divided into two board designs, the driver board on the bottom and the control board on the top. The driver board mainly implements voltage and current output, control, real-time data collection, etc. The control board mainly implements interactions, such as user input, screen display, For status display and computer communication, the control board and driver board communicate directly through the IIC protocol.
The bottom driver board mainly reduces the input DC voltage (for safety, purchase a mature switching power supply module) through BUCK. The main buck circuit is as follows
The basic buck circuit is formed through tip36c, L1, C3, C4, and 20100. R2 and R3 are responsible for output sampling. The relay circuit is used for output start and stop control while avoiding battery reverse charging. R6 avoids non-zero no-load current display. L2 and C6 are used For output filtering, C14 is used to eliminate spark interference from relay contacts.
The TL494 circuit is as shown above, standard connection method, C9 and R7 adjust the switching frequency
The picture above shows AD and DA. AD is used for real-time voltage and current sampling, and DA is used to control the output.
Since the collected current signal is too small to fall within the DAC output range of 0-4V, an operational amplifier is used to convert the current signal into a voltage signal of about 0-4V, and the control is accurately realized through the 494 internal comparator.
The picture above is the auxiliary power supply, which provides 7v power supply for 494 and 5V power supply for other chips.
The picture above is a fast charging circuit, which uses IP6505 chip to achieve multi-protocol fast charging output. Fast charging and CNC are completely independent to avoid mutual interference.
Generally speaking, the TL494 is used for output, and the 494 achieves output control by comparing the output sampling value and the reference value. The reference value is output by the DAC chip (MCP4725), and then realizes numerical control. In order to allow the microcontroller to focus on display and timely response to user instructions, real-time sampling of voltage and current is completed using an ADC chip (MCP3421). As shown below (high-definition details can be viewed in the attachment)
The top-level control panel is controlled by STC8A8K64S4 microcontroller. The display uses a 1.8-inch OLED screen. It is equipped with an EC11 knob encoder and 4 buttons. The encoder is mainly used to increase or decrease data, and confirm operations. The 4 independent buttons mainly implement modes. Functions such as lock/unlock, speed, start and stop can be reused in different scene modes, and the specific reused functions can be displayed on the screen. In addition, an RS485 chip is also installed to convert the TTL level into a 485 signal to achieve long-distance communication with the computer. As shown below (high-definition details can be viewed in the attachment)
In addition, in order to further increase the function of the power supply, a set of fast charging outputs is set up. Using the IP6505 chip solution, it can realize multi-protocol 24W fast charging output.
In order to reduce the size of the power supply, no fan is designed, and the main heat generator transfers heat out through connection with the aluminum alloy shell.
The logical relationship diagram of the entire hardware part is as follows:
Attached picture: PCB
Bottom layer of driver board
Driver board top layer
control panel top
Control panel bottom
panel
tailgate
Since the driver board and control board are connected only by the IIC protocol, the software level is relatively simple, as shown in the following map
First, initialize the hardware and make sure the communication is normal. Then check whether the button is pressed to turn on the machine. If so, enter the setting mode and use three different buttons to enter three different modes: calibration mode and recovery mode. Default mode, and online mode. Below is a brief introduction to these three modes:
1. Calibration mode, which is to calibrate the voltage/current at different levels by externally connecting a voltmeter/ammeter/multimeter (hereinafter collectively referred to as external instruments). After calibration, the ADC values and DAC values at different levels will be automatically saved and output later. When, interpolation operations are performed between different gears, which can improve the linearity of the power output. The entire calibration process is as shown below
2. Restore the default data, delete the user's self-calibration data, and use the default calibration data. This is mainly used for calibration failures caused by improper user operations, or rough usage plans under no calibration conditions.
3. Online mode. In this mode, the power supply does not output and is in standby mode, waiting to be connected to the computer. After the connection is successful, the calibration data and quick start data sent by the computer are received and displayed on the screen. The calibration data can be set independently. You can also set all settings. After data reception is completed, restart the power and the newly received reference data will take effect. The operating mode is as shown below
After confirming that the power supply does not enter the setting mode, it enters the normal working mode. In the working mode, it mainly cycles to detect real-time voltage and current, detect user input, adjust voltage and current, real-time display, temperature detection, PC command detection, security detection and other tasks. , the mind map is shown in Figure 2 for details, and they are now described separately.
PC software
The PC-side software is written in VB. It mainly sends command words to the CNC power supply, then obtains the current voltage and current value of the CNC power supply, and then draws it into a curve. The interface is as shown below
Another important function on the PC side is the one-click import of calibration data and quick start settings. The interface is as follows
By double-clicking the data, the corresponding place turns yellow, and then you can edit the data. After all settings are completed, click the "Inject" button to transfer the data from the computer to the CNC power supply (provided that the CNC power supply is in online mode). The communication protocol between the computer and the CNC power supply is customized by the individual. Please see the attachment for the rules.
Please download the attached PDF or XLS file for the high-definition BOM table
The operational amplifier adopts Hangshun HK358C
Since the video size is required to be within 100M and the resolution is 720P, a single video can only be within 1 minute, so many details can only be briefly introduced. Using 5 times the playback speed, this CNC power supply is designed using standard accessories commonly used in the market. , instead of using a special casing, the entire mechanical structure is relatively complex, with many assembled parts. If you can’t clearly see the steps in the video during the assembly process, you can learn the structural details by pausing multiple times.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet