兰博

# Sixth Lichuang Electric Competition#DC CNC power supply

 
Overview

 

* 1. Introduction to project functions


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

 

 

 

*2. Project attributes


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.

 

 

* 3. Open source agreement


GPL3.0 open source agreement

 

 

 

 

 

*4. Hardware part


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

 

 

*5. Software part


   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.

  1. Real-time voltage and current detection: Read back the voltage and current ADC values, obtain the average value through the filtering algorithm, and then interpolate the reference data to obtain the actual voltage and current value.
  2. Detect user input: Scan in real time whether the user has input operations, and use the interrupt method to start and stop to achieve the highest priority. If the user has input operations, they need to respond in time.
  3. Adjust the pressure and flow value, perform interpolation operations in the reference data according to the user's input data to obtain the set DAC value, and then write the DAC value to the hardware.
  4. Real-time display: It displays the current settings, current output value, and other information on the OLED screen.
  5. Temperature detection: Real-time detection of the temperature of hot households
  6. PC command detection: Obtain the serial port signal. If an instruction from the computer is received at this time, the corresponding status data will be sent back according to the instruction, so that the PC can draw the curve in real time.
  7. Safety detection: mainly detects whether the voltage and current are consistent with the settings, whether they are out of tolerance, and whether the current temperature value needs to alarm or shut down the output.

 

 

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.

 

 

*6. BOM list


    Please download the attached PDF or XLS file for the high-definition BOM table

The operational amplifier adopts Hangshun HK358C

 

*7. Contest LOGO verification


 

Attached: Complete machine renderings
Note: This picture is a photo of the actual object taken when it was just completed. Later, on this basis, the constant current and constant voltage status lights were changed, and the color of the buttons was changed.

 

* 8. Demonstrate your project and record it as a video for uploading


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.

 

 

 

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-06-22 02:54:34

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号