Note: * is required.
[Please fill in during the registration stage↓]
* 1. Self/team introduction
This team is currently composed of myself. I participated in many electronic competitions when I was in college and won many awards. I have a strong interest in DIY and electronic production. I also enjoy the process of hands-on production. I currently work in a Work as a hardware engineer in an automation company.
* 2. Briefly introduce the project
The problem started when the 3-way DC power supply IT6322 that I had been using on my desktop broke down, so I was always short of power supply. I originally wanted to replace it with another one, but I happened to see that Lichuang’s electronic design competition had a DC power supply category. So the idea of DIYing a multi-step control power supply naturally came up, and I just took this opportunity to test my ability level.
The initial plan is to design it according to IT6322. IT6322 has three outputs, two 30V, 3A, one 5V, 3A. The voltage output accuracy is 0.01V and the current output accuracy is 0.001A. The operation interface is planned to be controlled by a 3.5-inch LCD screen and a touch screen. Of course, silicone buttons must also be brought. Sometimes it is better to use buttons (design them first to avoid finding that the touch is not easy to use later). There is no need for a physical numeric keyboard. It is more comfortable to use the direction keys to adjust the digits and the rotary encoder knob to adjust the digits. The GUI uses EMWIN. The communication interface uses USB. Ignore other interfaces for now and meet your own needs first. The communication protocol uses SCPI, which can be compatible with other instruments and save the workload when building a test platform.
Because it needs to support remote SCPI control, a host computer is needed. First, use C# to write a simple application. First, you can remotely control voltage, current, switch, overcurrent, overvoltage and other functions. Other functions will be added later.
[Please fill in during the competition stage↓]
* 1. Describe project details
1. Channel one and channel two output 0-36V, 0-4A; channel three outputs 0-8V, 0-4A. The voltage resolution of the three channels is 0.01V, and the current resolution is 0.001A. The three channels must be completely isolated and support series and parallel use between channels. The power supply must support constant voltage mode and constant current mode, and switch automatically.
2. The protection functions must be perfect, such as overvoltage protection, overcurrent protection, overheating protection, etc.
3. The GUI interface should be user-friendly and the power supply should be easy to operate. The screen brightness can be adjusted. The buzzer can be controlled on and off. The fan automatically adjusts based on temperature.
4. The setting parameters have a power-off saving function.
5. It has the function of quickly outputting parameter groups. It has delay output and output timing functions.
6. Can support waveform output, such as sine wave, square wave, etc.
7. It has a USB communication interface, supports SCPI protocol, and can remotely control the power supply. Power supply firmware can be upgraded remotely.
The first is to determine the general circuit scheme. Because it is necessary to realize the series and parallel output of multiple channels, the three channels must be completely isolated. Each channel uses independent ADC and DAC to control the output voltage and current and measure the output voltage and current respectively, and then the ADC and DAC are isolated through The chip communicates with the microcontroller.
There are two options for controlling the output voltage and current. One is to collect the voltage and current in real time and then adjust it through software PID; the other is to directly use hardware to compare the set voltage and output voltage, and then the hardware circuit adjusts it by itself. The first method will be a lot more troublesome to debug. Because I am afraid that it will take too much time, I directly adopt the second method.
There are also two power supply solutions. One is to use a power frequency transformer, that is, DC power supply. One is to use switching power supply for power supply. The power supply efficiency of the switching power supply is relatively high and the heat dissipation pressure is small, but the ripple is large and the circuit is more complex. The power supply ripple of the power frequency transformer is small, but the efficiency is low and the weight is relatively large. Because I was making a laboratory power supply, I didn't care much about the efficiency and weight of the power supply. Instead, I had higher requirements on ripple, so I chose the first option.
The next step is to select the chip and draw the schematic. Because the output voltage range is 0-36V, the accuracy is 0.01V, 36/4096=0.0087V, so it is enough to use 12-bit ADC and DAC. Each channel needs to control the voltage and current separately, so two channels are required. It is best to directly choose a dual-channel ADC and DAC. After selection, it was finally determined that the DAC would be DAC7612 and the ADC would be MCP3202.
Because we need to drive TFT, touch screen, control 3 DACs and ADCs, relays, buttons, knobs, fans, etc., 64 IOs are not enough, so we have to choose a 100-pin microcontroller. Then the Flash needs to be larger, and the GUI can be saved directly. For the font libraries and pictures used, there is no need to add plug-in Flash. At the same time, the RAM of the microcontroller must be larger for display cache, so that there is no need to plug in an external SDRAM. Finally, I chose GD32F103VGT6 with 1M Flash and 96KB RAM.
The three output channels are each isolated and form a system of their own, so the power supply is also three isolated systems. The analog circuit of each channel requires a power supply of plus and minus 12V, plus 5V, and plus 4.1V. The power supply of the microcontroller is also an isolated system that requires plus 12V, plus 5V, and plus 3.3V. The USB communication interface also requires an isolated plus 5V power supply. Therefore, there are a total of 5 mutually isolated power systems.
The voltage is obtained through the transformer, the AC voltage is input, and the DC power is obtained after filtering by the rectifier bridge and large capacitor. Then use the DC voltage regulator chip LM7812 to get positive 12V, use LM7912 to get negative 12V, use LM7805 to get positive 5V, use LM317 to get positive 4.1V, and use AMS1117 to get positive 3.3V. The circuit diagram is as follows:
The top optocoupler circuit in the above schematic diagram is a zero-crossing detection circuit, which is used to detect the zero-crossing point of the input AC. The detected zero-crossing point can be used to save data during power-down and control the relay to act at the zero-crossing point, because at the zero-crossing point, the AC voltage is minimum and the current is also minimum at this time to protect the contacts of the relay and extend the life of the relay.
There is actually nothing much to say about the circuit part of the microcontroller. It is the smallest circuit of GD32F103VGT6, but you must pay attention to the pin assignment. For example, the A and B lines of the encoding knob must be connected to channels 1 and 2 of the timer. The power-off detection signal line must also be connected to the timer.
Surrounding the microcontroller are EEPROM for saving parameters, ULN2003 for driving cooling fans and relays, and LM35 for detecting radiator temperature:
The communication signal lines of the channel 1 system and the microcontroller system are isolated through the digital isolation chip SI8660 and the high-speed optocoupler 6N137.
The voltage control loop and the current control loop are connected in parallel to realize automatic switching between constant voltage and constant current. The specific principles are as follows:
1) First, select the input AC voltage through the relay. There are 4 levels of input AC voltage: 9V, 18V, 27V, and 36V. The relay is controlled according to the set output voltage, thereby controlling the input voltage value.
The input voltage is filtered into DC through the rectifier bridge and large capacitor.
2), power part. The input DC current through the power tube is adjusted to the DC current of the set voltage value, and then output.
3), voltage feedback part. How does the power tube adjust the voltage? This requires the use of a voltage feedback circuit. First, the output voltage value passes through the same proportional amplification circuit composed of U2B, reducing the range of 0-36V by 12.4 times:
The reduced voltage is then compared with the output voltage of the DAC, and the error is accumulated and output through the integrating circuit. The output signal then passes through the transistor to increase the driving capability and then directly leads to the gate of the power tube.
4), current feedback part. The first is the sampling resistor:
The sampling current signal is amplified by the U2C circuit:
Then compare it with the output of the DAC, accumulate the driving signal through the integrating circuit, amplify it through the transistor, and drive the power tube:
5), channel output switch. Use an optocoupler to control the output of the channel. When the optocoupler is turned on, the driving signal is valid and the power tube can be driven to turn on.
The display board is much simpler. It mainly includes liquid crystal circuit, touch screen drive circuit, button circuit composed of HC165, IO drive circuit composed of HC595, coding knob circuit, and USB communication isolation circuit.
After the schematic is designed, the components and accessories need to be determined, and then the internal structure of the power supply and the size of the whole machine need to be determined.
Next consider the internal structure of the power supply, and then design the PCB according to the internal structure. First, the design drawings of the transformer are given to the manufacturer. The manufacturer estimates that the size of the transformer is 70mm in height and 130mm in diameter. Then calculate the maximum heat dissipation requirement of the radiator. First, the maximum voltage drop on the power tube is 8*1.414=11.312V, and the maximum current of each channel is 4A. Therefore, the maximum power dissipated by the three channels on the radiator is 8*1.414 *4*3=135.744W, so the radiator must be large enough and the fan must have high air volume. Finally, learn from the method of IT6322, use a 60mm square radiator, and then fix the fan directly to one end of the radiator to achieve the best heat dissipation effect. The heat sink is directly fixed to the PCB and placed aside, leaving the remaining space for components. If one PCB cannot fit, you can consider two layers. The bottom panel is the power board, and the top panel is the control panel. This way the structure is clearer and can save a lot of space. The temporary layout diagram is:
The structure of the power board is basically determined. Now let’s look at the operation panel. There are 6 binding posts, 9 silicone buttons, 3.5-inch screen, power switch and USB communication interface on the operation panel. After a rough estimate, the width cannot be less than 200 , if it is so wide, there will be 200-60=140mm width free on the power board. One board can completely accommodate everything, so the power board decided to use one PCB. This way, compared with the upper and lower layers of the board, , more convenient for debugging and installation, and saving costs. After roughly determining the layout of the power board and the operation panel, the dimensions of the chassis are: the width should be greater than 200mm, the length should be greater than 260mm, and the height should be greater than 70mm.
Next, let’s design the appearance and layout of the operation panel. First, select the binding posts:
Then select the knob, knob cap and power switch:
Next, choose the buttons. The selection of buttons takes a lot of thought. If you use hard buttons + keycaps, you can have them readily available, or you can buy and design them. for example:
However, the operating experience is not as good as the commonly used silicone buttons on instruments. Generally, silicone buttons are custom-made from molds, and it is difficult to find universal ones. I finally found a few that meet my requirements on Taobao, but the height of the buttons is not uniform. Moreover, one button is used with a tact switch, and the other one has its own conductive black particles, which makes it difficult to unify the drawing board:
So I continued to search, and then I suddenly thought that the silicone buttons on the remote control could be used, so I bought two remote controls:
I took apart the remote control, took off the silicone buttons and tried it, but it still didn't work. I searched around again and had no choice but to use the original direction buttons. Because the heights of the direction keys and translucent keys are different, and considering their fixation issues, we first drew three small fixing plates:
With a fixed plate and a separate touchpad, the problem of inconsistent key heights can be solved.
But the direction keys are used with the tact switch, so they are specially equipped with conductive black particles:
Glue the conductive black particles to the direction buttons. After assembling them all, I tried it and the effect was good. In this way, everything about the power board and operation panel has been determined, that is, the overall structure and materials have been determined. Next you can draw the PCB.
On July 17, 2020, two PCBs were drawn and the 3D package was also added:
On July 20, I got two PCBs and started soldering components.
On July 22, the PCB was roughly soldered, and only one channel of the power board was soldered to verify the circuit design. If I only found out there was a problem with the design after welding all the tests, I would be dumbfounded.
On July 24, the test procedures and circuit debugging of ADC and DAC were completed, and it was initially determined that there were no major problems with the circuit design. There are only a few minor problems: First, the 12V output and 5V output of the microcontroller power supply circuit use LM7812 and LM7805. Because the current of these two power supplies is too large, the two chips heat up seriously, so they were changed to LM2596 and LM2315. Second, the capacitance on the power supply of the microcontroller is too small. As a result, after power failure, there is not enough capacitance to power the microcontroller and enable the microcontroller to save the power-off parameters. Third, the PCB layout of the display board is not very reasonable, which makes it look unsightly after the chassis is installed.
These problems were solved using flying boards and flying lines. Next start testing other modules.
On July 30, the underlying drivers for LCD, touch screen, knob and other modules were completed.
On August 15th, the general design of the GUI was completed, and we could start joint debugging of the power board and display board.
On August 25, the power supply function was generally completed. Start optimizing, organizing data and shooting videos.
1), Power main page
2), Power settings page
3), Power calibration function page
4), Power supply quick output function page
5), Power waveform output function page
6), voltage and current output and readback accuracy report
7) Load regulation test report
8), SCPI program control function
The open source protocol stack on Github ported by the SCPI protocol stack.
9), waveform output function
* 2. Describe the challenges faced by the project and the problems solved
Challenge 1: The initial design of this power supply was to make a highly complete three-channel programmable DC power supply to replace the broken IT6322, rather than to make it for fun. Therefore, a lot of effort was spent on the appearance and structural design of the power supply. In this process, I bought a lot of samples to test the effect of the finished product and the matching effect of the whole machine. A lot of experiments have been done on the design, including the color and material of the front and rear panels. This is a challenge for product design capabilities.
Challenge 2: The design of the GUI was just a dull design in the early stage. For example, the initial design of the main page was to divide the screen into three equal parts horizontally and use them for three channels respectively. This resulted in the final effect that the displayed characters of each channel were very small. Small, and finally had to learn from the DP832 method and divide the screen into three triangles to maximize the display character size of the three channels.
Challenge 3: The debugging of the analog circuit part requires adjusting the capacitance and resistance around the op amp circuit based on the feedback situation and phase margin of the circuit. This is also a relatively labor-intensive area. At the same time, in order to reduce the heat dissipation pressure of the radiator, the input voltage is divided into four equal parts, and the relay is controlled to adjust the input voltage according to the output voltage. The relay also switches at the zero-crossing point to protect its contacts, which is also a challenge. .
Challenge 4: Data processing. Because the output of the DAC and the input of the ADC are not linearly reflected in the voltage and current, the microcontroller is required to collect the original values of the DAC and ADC and the corresponding voltage and current values, and then perform curve fitting processing to create the data. Correction, so that the voltage and current values will be accurate.
* 3. Describe the key points involved in the hardware and software parts of the project
The key points in hardware design are mainly:
1. Selection of circuit scheme, which control method to choose, and which power supply method to choose.
2. Material selection: choose appropriate materials according to your design requirements. Such as DAC, ADC, MCU, isolation chip, driver chip, etc.
3. Design and debugging of analog circuits. Patience and theoretical knowledge are required to slowly debug the circuit.
4. PCB layout and wiring, because there are still many components involved, and there are analog parts, digital parts, and high-power parts in the circuit. Therefore, the design of PCB is still very demanding.
The key points in software design are mainly:
1. Compilation of overall multi-task control program.
2. Design of GUI software.
3. Transplantation of SCPI protocol stack.
* 4. Project material list display
Power board BOM:
Display board BOM:
* 5. Upload project pictures
5.1. If the contest logo is not printed on the PCB, it will be deemed as giving up the participation.
Power board PCB front and back
Display board PCB front and back
Silicone button fixing plate PCB front and back
5.2. Other pictures of the project
* 6. Demonstrate your project and record it as a video for uploading
6.1. Video upload contest official website
6.2. Video title and link at Station B
Notes: ①: Video requirements: Please shoot horizontally, the resolution is no less than 1280×720, the format is Mp4/Mov, the size of a single video is limited to 100M; ②: Video upload: please upload to the official website of the competition and Station B simultaneously ( www .bilibili.com ), the top 10 most popular projects at Station B will receive 1,000-5,000 yuan in cash rewards, and other uploaded projects will receive 100 yuan Lichuang Mall no-threshold coupons; ③: Video title: The 5th Lichuang Electronic Design Competition: {Project Name }-{Video module name}; such as the 5th Lichuang Electronic Design Competition: "Autonomous Driving" project - team introduction.
* 7. Whether it is released to the public for the first time
7.1. Please indicate whether the project has been published or won awards before.
This is the first time this project has been published and has not been published or won any awards.
7.2. If the project is optimized on the original basis, please explain the optimization part
This project is produced for the first time and is currently still in its first version.
* 8. Open source documents
see attached.
* 9. References
none.
Click the link for more details: https://www.szlcsc.com/go/dsxq
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