Every home laboratory or workshop inevitably needs a power supply with adjustable voltage and current for prototyping, testing personal projects, or repairs. Of course, such devices are commonly available for purchase in stores selling electronic components and measuring instruments.
Custom Specification
Practical experience and previous needs defined the parameters of the future power supply. The main requirements were:
• two separate isolated output voltage branches
• independent voltage and current regulation
• protections against current overload, overheating...
• output voltage range 0 - 50V
• output current range 0 - 20A
• low noise level on both sides of the power supply (to the mains and to the powered circuit)
• the largest possible output power
• simple operation and acceptable cost
Design Solution
The given specification resulted in limiting the power supply's input to 3.5kW so it can be powered from a single phase of the electrical grid. I didn't even consider a power supply of the now classic construction: transformer – rectifier – filter – regulation – measurement.
The reason is several prosaic causes: the transformer would be huge and heavy, cooling of the rectifier and regulator would be voluminous, considering the required output current, the capacitor filter banks would also have to be large because we are dealing with filters for a 50Hz transformer and rectifier, ... The decision fell on a switching power supply. Such switching power supply designs have been published repeatedly in Amateur Radio magazines from both theoretical and practical perspectives. My goal was not to build a switching power supply from discrete components, but to assemble a power supply of appropriate parameters from available modules. Similar to computer technology where we are moving away from designing CPU units and instead choose one of the available CPU modules for our designs. This is roughly how I approached solving the assigned task. To reduce the ratio between the input and output voltage range, I chose a two-stage solution.
The first stage, an AC/DC converter, ensures stabilization of a fixed voltage at its output, which must be at least higher by the value of the voltage drop on the second stage providing regulation. The second stage is a DC/DC converter ensuring regulation of the output voltage and current in the required range, digitally controlled via the Modbus bus. For a pair of independent output voltages, I used two independent sets of power supplies. Input and display of desired and actual values is provided by a touch HMI display (Human Machine Interface). The control program was written in Python. An auxiliary circuit, labeled as "LK-20 modbus adapter" in the schematic, provides conversion of TTL Modbus interface signals to the HMI display serial interface and simultaneously ensures galvanic isolation of the output voltages of the individual branches. I supplemented the power supply enclosure with an induction heating circuit.
Hardware Description
Based on the chosen concept, I selected the following key components:
power supply MS-1500-72 , RIDEN RD-1500-68 , or another similar suitable typeXY6020L DIY Laboratory Power Supply 20A 1200W
The overall connection schematic is in the following image:
The foundation of this laboratory power supply is the DC/DC converter module, XY-6020L (PWR4, PWR5). It is a controlled converter with an Artery AT32F421 microprocessor operating at 120MHz. This RISC microprocessor contains a 32-bit ARM Cortex-M4 core with 64kB flash memory and 16kB static RAM. Additionally, it contains 5 16-bit timers, two i2c buses, two UART serial ports, a hardware comparator, and a 10-channel 12-bit analog-to-digital converter with a clock frequency of 28MHz, 25 GPIO input-output lines. The XY6020 is a "step-down" type switching power supply. Basic characteristics include output voltage and current accuracy under 1%, output ripple up to 100mV, and 1200W power. Overvoltage, overcurrent, and overheating protections don't even need to be mentioned. The XY6020L power supply module can be controlled using a connected control module with an LCD display via connectors, or via the Modbus serial bus. I chose control via Modbus. From the above schematic diagram, it is clear that the 230V supply is via connector X1. Behind it is fuse F1, protecting the entire device from current overload in case of a power supply failure. PWR1 and PWR2 provide AC/DC conversion from 230V AC to 64V DC (the output voltage is set by a trimmer in the power supply). I used switching power supplies MS-1500-72 with adjustable output voltage up to 72V and 1500W power. The set output voltage of these power supplies must be less than 65V, otherwise modules PWR4, PWR5 (XY6020L) will go into a blocked state due to overvoltage at their input. Modules PWR4, PWR5 are step-down DC/DC converters providing the required voltage and current values at the output terminals X4-X7. The required voltage and current values are entered via the ER-DIS08050H touch HMI display. Timer relay XT1 serves to delay the connection of PWR1 to the 230V network after turning on the main switch SW1, to prevent inrush current from the transient phenomenon of charging the power supply capacitors when turned on. PWR3 is a +5V power supply for powering the display and auxiliary control circuits. PWR6 is the induction heating module ZVS1000 , which I built into the enclosure of the described laboratory power supply. Switch SW2 connects the power from the second branch of power supply PWR5 to the input of the induction module. The high-frequency output of module PWR6 is brought out to terminals X8 and X9, as well as to the pins of connector X3, which must withstand a current load of at least 20A and serves for convenient connection of induction heating devices. Pushbutton switch SW3 serves to activate the output of the second power supply, which simultaneously powers the induction module when switch SW2 is on, for the duration that SW3 is pressed. Through USB connector X2, it is possible to connect the HMI display to a PC for monitoring and debugging, or uploading new firmware. An important part of the laboratory power supply is the modbus adapter circuit (Obr4.png), which provides galvanic isolation of the serial lines through which the XY6020 power supply modules are controlled and mediates communication with the HMI display for entering and displaying desired values.
The input-output HMI (Human Machine Interface) LCD display module ER-DIS0705H is based on the ESP32 microprocessor. The 5" display has a resolution of 800x480 pixels, capacitive touch sensor, WiFi interface, TTL serial interface, acoustic signaling, SD card slot, ... The limited number and type of IO interfaces required finding a solution for communication with modbus. One could find a solution with a display module that contains multiple serial lines, but here the limiting factor is price. Such a device costs more than a few hundred € and the problem with galvanic isolation of the power supplies would remain. I decided to create my own module, providing the required functions. I used a development module from Waweshare, for a few €. The choice fell on this module because the display board contains the same ESP32-S3 microprocessor, which allowed me to use some common software libraries. The modbus adapter circuit is powered from the 5V power supply PWR5. The serial lines of the modbus interface of the XY6020 power supply modules (PWR4 and PWR5) are brought to connectors X2 and X3 of the modbus adapter.
LK-20 Modbus Interface Circuit
The connection schematic is simple.
Galvanic isolation of the XY6020 power supply communication lines is provided by integrated circuits ¶122M30, so that the output voltages of the power supplies have independent potential and can be combined in series, which will allow achieving a stabilized output voltage up to 120V at a maximum output current of 20A. The block functional diagram of the integrated circuit is here:
Isolation voltage reaches up to 3kV and the maximum transmission speed is 10Mbit. The used circuit is dual-channel and also allows conversion of voltage levels between 3V and 5V, while the consumption of the integrated circuit itself is less than 100 µA.
Power supply of the integrated circuits on the microcontroller U1 side is provided by a 3.3V voltage regulator located on the development kit board U1 and brought out to pin no.1. Power supply of the isolation circuits on the side of the controlled XY6020 power supplies is 3V from the power supplies via pins 1 and 4 of connectors X2 and X3. Microcontroller U1 ESP32-S3-DEV-KIT-N8R8 is powered from the 5V supply via terminals X1 and provides communication via the Modbus protocol with the XY6020 power supplies via ports GPIO4, GPIO5 and GPIO17, GPIO18 and via WiFi, using the TCP protocol, communicates with the HMI display, which is also equipped with an ESP32 microprocessor. The used capacitors C1 to C7 have a filtering function and resistor R1 has a value of 0 Ohm (jumper) and I used it only to simplify the printed circuit board (PCB), so that it could be realized as single-sided. Using the ESP32-S3-DEV-KIT-N8R8 development kit has its advantages. Primarily, I avoided the need to realize the PCB using the SMD method and didn't have to solve auxiliary circuits, for example for connecting the CPU to the USB port. The PCB has dimensions of 100mm x 50mm. The PCB layout and component placement show its simplicity.
The PCB is single-sided and so simple that it needs no further description and its realization is evident from the picture. Commissioning consists of checking the PCB for shorts and possible breaks in traces during drilling or PCB manufacturing and programming the CPU U1 as described in the next part of the post. A minor problem is posed by using the ¶122M30 integrated circuit, which is manufactured only in the SOIC-8 package for SMD mounting. The problem was solved by a small SOIC-8 to DIP8 adapter (Obr30.png) onto which the ¶122M30 chip can be soldered, with a bit of care and using a thinner tip, even with an ordinary transformer soldering iron. As DIP8 package leads, I used 4 pins of a single-row DIP header.
Software Description
Given that the majority of the hardware is assembled from ready-made modules, a large part of the effort had to be devoted to software. The service programs are written in the MicroPython language, which is the Python programming language optimized for use on embedded systems with limited resources. Communication between the display and the board with the modbus interface takes place via WiFi using the TCP protocol. The display board is in client mode and the modbus interface board is in AP mode. All necessary programs can be downloaded in the download section . On the AP side, the main program is main_AP.py. To boot.py, it is necessary to add the line:import main_APThis ensures automatic startup of the main program when powered on, and on the client side (HMI display) similarly, but main_client.py:import main_client
The program provides reading and writing of modbus registers from the regulated XY6020L power supplies. The communication interface is a TTL serial port and uses the MODBUS-RTU protocol. From the factory, the device ID is set to 0x01 (01 hexadecimal). It works with 3.3V and 5V levels. The serial data format is baudrate = 115200, 8 data bits, no parity, one stop bit (115200,8,N,1). Before commissioning the entire power supply, it is necessary to change the ID address of the second XY6020 power supply to the value 0x02 (02 hexadecimal) using a suitable tool. Initially, I used the freely available tool OpenModScan, but for repeating this procedure, I created a short Python program that can be run on the ESP32 module after connecting the XY6020 module's serial line. By modifying the MODBUS_ADDR variable, any slave ID value can be written.
from machine import UART
import time
# Nastavenie UART
uart1 = UART(1, baudrate=115200, tx=4, rx=5, timeout=500)
MODBUS_ADDR = 1 # Adresa Modbus zariadenia
def modbus_crc(data):
crc = 0xFFFF
for byte in data:
crc ^= byte
for _ in range(8):
if crc & 0x0001:
crc >>= 1
crc ^= 0xA001
else:
crc >>= 1
return crc
def write_single_register(reg_address, value):
# Zostavenie správy pre zápis jedného registra (funkčný kód 0x06)
msg = bytearray([
MODBUS_ADDR,
0x06, # Funkčný kód pre zápis jedného registra
(reg_address >> 8) & 0xFF, # High byte adresy
reg_address & 0xFF, # Low byte adresy
(value >> 8) & 0xFF, # High byte hodnoty
value & 0xFF # Low byte hodnoty
])
# Pridanie CRC
crc = modbus_crc(msg)
msg.append(crc & 0xFF)
msg.append((crc >> 8) & 0xFF)
# Odoslanie správy
print(f"Odosielam: {bytes(msg).hex(' ')}")
uart1.write(msg)
# Čakanie na odpoveď
time.sleep_ms(200)
resp = uart1.read()
if not resp:
print("Chyba: Žiadna odpoveď")
return False
print(f"Prijaté: {resp.hex(' ')}")
# Kontrola odpovede
if len(resp) != 8: # Očakávaná dĺžka odpovede pre funkčný kód 0x06
print("Chyba: Neplatná dĺžka odpovede")
return False
# Kontrola CRC
resp_crc = resp[-2] | (resp[-1] << 8)
if modbus_crc(resp[:-2]) != resp_crc:
print("Chyba: Neplatné CRC")
return False
# Kontrola, či sa odpoveď zhoduje s požiadavkou
if resp[0] != MODBUS_ADDR or resp[1] != 0x06:
print("Chyba: Neplatná hlavička odpovede")
return False
return True
# Hlavný program
print("\nModbus komunikácia - zápis do registra")
print("Pokúšam sa zapísať hodnotu 1 do registra 24...")
if write_single_register(0x12, 1):
print("Zápis prebehol úspešne!")
else:
print("Zápis zlyhal!")
The program is available in the download section. If the slave ID value has not been changed and remains at the factory default of 1, it is not necessary to change it, as the LK-20 Modbus adapter module communicates on separate serial channels, allowing both XY6020 power supplies to have the same ID.
The necessary program functions for communication with the XY6020 power supplies are contained in the modbus.py library. As already mentioned, the WiFi of the HMI display is in client mode and the WiFi module of the ESP32 unit on the modbus adapter board is in AP mode. Initialization of the WiFi interfaces is in the wifi_comm.py library, which is common for both the client and AP. All libraries, and thus also my_lib.py, are common for both the modbus interface and display modules. Only main_AP.py and main_client.py for the display module are different. On the AP side, a DHCP server is initialized, which assigns an IP address to the client upon connection, BSSID and password are defined in the wifi_comm.py library and can be changed arbitrarily. On the AP side, a TCP server is created, to which the HMI display TCP client with the LVGL library (Light Versatile Graphics Library) connects, allowing convenient creation of user-friendly graphical interfaces. Communication is controlled by background interrupt. The TCP client and server regularly update each other's data structures xy6020data1 and xy6020data2 containing the read values of the XY6020 registers, as well as the desired register values for writing and status registers, which are used to control communication and writing to registers and thus also the start or stop modes of the power supplies.
Data fields are defined in the modbus.py function library and have 2 x 34 bytes for each power supply. 34 bytes for writing xy6020_data1w[34] and 34 xy6020_data1r[34] bytes for reading registers and status values. They contain a complete image of the registers of the M0 memory set. The definition of some important memory variable data fields, whether bit or byte values xy6020_data1w[] and xy6020_data1r[], looks like this:
TOTAL_REGISTERS = 32 # Počet registrov XY6020 # Dátové polia pre registre - čitanie z XY60020
MAX_RETRIES = 3 # Maximálny počet opakovaní
AP_STATUS_REG_INDEX = 32 # Index apečka pre status, word v datovom poli
STA_STATUS_REG_INDEX = 33 # Index pre status klienta, word v datovom poli
# COMMAND_REG_INDEX = 33 # Index pre príznak požiadavky zápisu v datovom poli
STATUS_ERROR_BIT = 0 # nastala nejaká chyba
STATUS_NEW_DATA_BIT = 1 # bit indikuje prijatie nových dát na zápis do XY registrov
STATUS_MODBUSR_BIT = 2 # chyby UART na modbus
STATUS_SEND_DATA_BIT = 3 # sú nové dáta k odviselaniu na server
STATUS_WIFI_BIT = 4 # chyba spojenia na server, AP, alebo STA
STATUS_APC_BIT = 5 # spracováva sa wifi požiadavka odoslania, či príjmu na strane AP
STATUS_STAC_BIT = 6 # spracováva sa wifi požiadavka odoslania, či príjmu na strane klienta
STATUS_WRITE_BIT = 7 # požiadavka na zápis do registrov XY
STATUS_TCP_BIT = 8 # 1 znamená chybu v TCP komunikácii
# 32-bitové masky pre určenie ktoré registry sa majú zapísať
# Každý bit zodpovedá jednému registru (bit 0 = Reg0, bit 31 = Reg31)
regw_uart1 = 0b00000000000001000000000000000011 # Príklad: zapíše sa len register 0,1,18
regw_uart2 = 0b00000000000001000000000000000011 # Príklad: zapíše sa len register 0,1,18
regr_uart1 = 0b00000000000001000000000000001111 # Príklad: číta len register 0,1,2,..
regr_uart2 = 0b00000000000001000000000000001111 # Príklad: číta len register 0,1,2,
xy6020_data1 = [0] * (TOTAL_REGISTERS+ 2) # 32 registrov + 1 status + ....
xy6020_data2 = [0] * (TOTAL_REGISTERS+ 2) # 32 registrov + 1 status + ....
# Dátové polia pre registre- zápis do XY60020
xy6020_data1w = [0] * (TOTAL_REGISTERS+ 2) # 32 registrov + 1 status + ....
xy6020_data2w = [0] * (TOTAL_REGISTERS+ 2) # 32 registrov + 1 status + ....
So that registers that do not undergo change or whose content is not currently interesting are not always written or read, a bit mask regw_uart1 and xy6020_data1w (for the second power supply regw_uart2 and xy6020_data2w) is introduced, which defines the register bytes intended for the write or read operation. Individual bits determine the register in the XY6020 that will be read or written, as in the example above. The microcontroller on the modbus adapter board continuously periodically communicates via the optically isolated interface with the power supplies and reads the current voltage, current, and status values from their registers using a set of commands. For this device (XY6020), only the following modbus functions are allowed
|
Code
|
Function
|
Description
|
|
0x03
|
Read register data
|
Reading data from one or more registers
|
|
0x06
|
Write single register
|
Writing to a single register
|
|
0x10
|
Write multiple registers
|
Writing to multiple registers
|
and contains the following set of registers (Holding Registers). Each register consists of 16 bits, transmitted as 2 bytes.
|
Name
|
Description
|
Bytes
|
Dec.
|
Unit
|
Read and Write
|
Register Address
|
|
V-SET
|
Voltage setting
|
2
|
2
|
V
|
R/W
|
0000H
|
|
I-SET
|
Current setting
|
2
|
2
|
A
|
R/W
|
0001H
|
|
VOUT
|
Displayed output voltage value
|
2
|
2
|
V
|
R
|
0002H
|
|
IOUT
|
Displayed output current value
|
2
|
2
|
A
|
R
|
0003H
|
|
POWER
|
Displayed output power value
|
2
|
1
|
W
|
R
|
0004H
|
|
UIN
|
Displayed input voltage value
|
2
|
2
|
V
|
R
|
0005H
|
|
AH-LOW
|
Output AH low 16 bits
|
2
|
0
|
mAh
|
R
|
0006H
|
|
AH-HIGH
|
Output AH high 16 bits
|
2
|
0
|
mAh
|
R
|
0007H
|
|
WH-LOW
|
Output WH low 16 bits
|
2
|
0
|
mWh
|
R
|
0008H
|
|
WH-HIGH
|
Output WH high 16 bits
|
2
|
0
|
mWh
|
R
|
0009H
|
|
OUT_H
|
Power-on time - hours
|
2
|
0
|
H
|
R
|
000AH
|
|
OUT_M
|
Power-on time - minutes
|
2
|
0
|
M
|
R
|
000BH
|
|
OUT_S
|
Power-on time - seconds
|
2
|
0
|
S
|
R
|
000CH
|
|
T_IN
|
Internal temperature value
|
2
|
1
|
°F/°C
|
R
|
000DH
|
|
T_EX
|
External temperature value
|
2
|
1
|
°F/°C
|
R
|
000EH
|
|
LOCK
|
Key lock
|
2
|
0
|
-
|
R/W
|
000FH
|
|
PROTECT
|
Protection status
|
2
|
0
|
-
|
R/W
|
0010H
|
|
CVCC
|
Constant voltage/current status
|
2
|
0
|
-
|
R
|
0011H
|
|
ONOFF
|
Output switch
|
2
|
0
|
-
|
R/W
|
0012H
|
|
F-C
|
Temperature symbol
|
2
|
0
|
-
|
R/W
|
0013H
|
|
B-LED
|
Backlight brightness level
|
2
|
0
|
-
|
R/W
|
0014H
|
|
SLEEP
|
Time until screen turns off
|
2
|
0
|
M
|
R/W
|
0015H
|
|
MODEL
|
Product number (was 6100h)
|
2
|
0
|
-
|
R
|
0016H
|
|
VERSION
|
Firmware version number (was 0071h)
|
2
|
0
|
-
|
R
|
0017H
|
|
SLAVE-ADD
|
Slave address (subordinate device)
|
2
|
0
|
-
|
RAW
|
0018H
|
|
BAUDRATE_L
|
Baud rate (6 = 115200)
|
2
|
0
|
-
|
RAW
|
0019H
|
|
T-IN-OFFSET
|
Internal temperature correction
|
2
|
1
|
°F/°C
|
RAW
|
001AH
|
|
T-EX-OFFSET
|
External temperature correction
|
2
|
1
|
°F/°C
|
RAW
|
001BH
|
|
BUZZER
|
Buzzer switch (not implemented?)
|
2
|
0
|
-
|
RAW
|
001CH
|
|
EXTRACT-M
|
Quick recall of data sets
|
2
|
0
|
-
|
RAW
|
001DH
|
|
DEVICE
|
Device status
|
2
|
0
|
-
|
RAW
|
091EH
|
In addition to these registers, the XY6020 has a total of 10 memory data sets M0-M9. Each set contains a total of 14 data registers. The initial address of data set M0 is 0050H for storing settings and their quick recall. Data group M0 is typically recalled when the product is powered on, data groups M1 and M2 are data groups quickly recalled from the product panel, and M3-M9 are ordinary memory data groups. The calculation method for the starting address of a data group is: 0050H + data group number * 0010H, for example the starting address of data group M3 is: 0050H + 3 * 0010H = 0080H. Recalling memory M1-M9 is performed by writing the desired number 1..9 to the EXTRACT-M register at address 001DH. As a result, the recalled memory values are copied to the M0 area at address 0050H and further. M0 is the currently effective operational data set. Updates to this area take immediate effect. (Recalling memory M0 has no effect.) I use this feature by writing to registers to immediately change the desired values and the laboratory power supply does not utilize memory sets M1-M9.
Uploading Programs
To upload the necessary software, it is necessary to load firmware containing the required version of MicroPython and control programs into the modules. Particular attention is required for the HMI display, where I recommend saving yourself trouble and using the display manufacturer's firmware, which contains the necessary drivers for the touch display. For the ESP32 on the modbus module, MicroPython version 1.19 or higher can be used. For uploading MicroPython via the USB interface to the ESP32, whether the display or the ESP32 module on the modbus adapter board, I used the Thonny program environment (https://thonny.org/), which is also suitable for beginners, of course other environments can be used, such as Visual Studio, or Arduino IDE. The general procedure for working with MicroPython and the Thonny IDE interface and ESP32 involves connecting the module to a PC via the USB interface and I assume using the Windows OS. First, it is necessary to check whether Windows has loaded the correct drivers for the USB interface of the connected module (this information is general and applies to any ESP32 modules, not only for use in this project).
You check this in the Windows Device Manager so that a serial port appears after connecting the module to the PC . Now you can run the Thonny program on your PC and upload the MicroPython firmware. The initial screen signals a missing "backend", meaning Thonny does not have active communication with the connected ESP32 module. Click on the "Tools" menu item and then, in the newly opened window, click on the "Interpreter" tab, select the interpreter type "MicroPython (ESP32)" and choose the serial port that Windows has already assigned to your module. Then click on the link "Install or update MicroPython (esptool)" and in the following window in the "Target port" line, select the serial port assigned to your ESP32 module, at the bottom of the screen, expand the menu and select "Select local MicroPython image...", where you will be prompted in the next window to enter the filename of the MicroPython image, browse for it on your computer and select it for uploading. The subsequent window informs where the target port is, select the processor type, in our case ESP32S3, the version line shows the version of the selected MicroPython image intended for uploading.
By clicking the "Install" button, you start writing to the flash memory of the ESP32 module. After successful uploading, the Thonny program screen in the "shell" tab will contain the output of your MicroPython system console and you can enter commands. The status bar at the bottom right informs you that you are connected via the USB serial port (in my case COM4) to the MicroPython system with ESP32. In the left part of the window, you see the "Files" tab, which in the upper part shows the contents of the local folder on your PC and in the lower part the files uploaded on your module. Set the cursor to a local file in the Thonny program window, right-click and from the displayed context menu select "upload …", this will copy the selected file to the ESP32 module. Double-clicking the left mouse button on a file opens it for editing.
To upload the necessary python programs to the ESP32, do this for the display as follows:
• connect the display to the PC via USB and upload the Micropython firmware-5.0-A.bin to the ESP32
• download client.rar from the download section and upload the extracted content to the root directory of the ESP32 display
• at the end of the boot.py file, add the command import main_client
To program the content of the ESP32 processor on the LK-20 modbus board, we proceed similarly:
• connect the ESP32-S3 to the computer's USB and upload Micropython at least version v1.19.1 (2022-06-18)
• download ap.rar from the download section and upload the extracted content to the root directory of the ESP32 display; at the end of boot.py add the command import main_AP. Upload all files from the archive, not only those with the py extension.
Power Supply Control
Control of the pair of power supplies is performed from the touch screen of the HMI display divided into 4 frames.
The first contains a status bar, the second contains the actual voltage and current values for the pair of power supply outputs. The third frame displays the desired (entered) voltage and current values for the output voltage and current of each power supply and the fourth frame contains touch buttons for controlling the power supplies. These are buttons with start and stop symbols for each power supply separately and the middle button serves to bring up an information screen with diagnostic data.
Button activity is signaled by a change in button color. Gray color indicates an inactive state; for the middle diagnostic button, the active state is signaled by the blue color of the button. The active start button is signaled by green color (then the stop button is gray), activating the stop function changes the color of the stop button to red and simultaneously changes the state of the start button to gray. I probably don't need to remind that the start function means activating the voltage at the power supply output to the set values and the stop function turns off the output voltage of the respective power supply branch. Using the hardware button SW3 activates the output voltage of the second power supply, as mentioned above in the text, which is also signaled by a change in the colors of the start and stop buttons for the second power supply.
Placing a finger on the displayed voltage or current value in the second frame of the screen, where the actual voltage and current values are displayed, brings up a virtual keyboard for entering the desired output voltage or current values.
The keyboard contains digits and a confirm "enter" key. Entering input values ends by pressing the "enter" key on the keyboard, or by entering four characters, whichever occurs first. Values are entered from left to right; if less than 4 characters are entered, they are filled with zeros. For example, 0+5+"enter" means 05.00 volts, or amps. The number of decimal places is fixed, set to 2. When displaying the output values of the power supply, the leading zero is suppressed.
The first frame on the screen is reserved for status indication.
In the left part of the frame after the status name, a green symbol is displayed,
if everything is OK, or red X, if some error occurs. Icons in the left part of the status bar signal ongoing activity, or the source of an error. Icons from left to right signal, by changing color and an acoustic signal, an error on the modbus bus of the power supplies, an error on the TCP connection between client and server, a WiFi connection error. The triangle icon with an exclamation mark signals overheating of the XY6020 module with orange color, and the last icon signals by blinking the loading of large fonts during booting. For each icon, the following rule applies: unknown state is signaled by gray color, error-free state by green color, and error state by red color.
Mechanical Construction
I built the laboratory power supply into a computer case MC MF-320B Micro Tower. I partially removed the rear metal panel of the case and replaced it with my own panel made of aluminum sheet, on which I placed an IEC 230V/16A socket and a fuse holder. The dimension and drilling of holes for the rear panel is shown in the picture in the file mechanical parts in the download section. To the bottom of the case, I attached a panel made of aluminum sheet, with ventilation holes cut out and equipped with rivet nuts, which also serve as spacer columns for mounting the AC/DC converters in the first stage of the power supply. The upper aluminum sheet similarly has rivet nuts, for mounting the DC/DC converters XY6020, induction converter, AC/DC +5V power supply, and modbus adapter.
This panel is attached to the rear part of the case with a piano hinge, for good access to the cabling. The type of wires used, their lengths, cable lugs, connectors is evident from Obr31.pdf. The drilling drawing of the upper panel is mechanical parts in the download section. The output terminals, connector, switches, and HMI display are mounted directly on the plastic front panel, into which it is necessary to cut the required holes. I removed the USB ports from the case and covered the holes with a small panel, which I glued to the front of the case.
Commissioning and Setup
After mechanical assembly of the power supply and connection of cabling, connect the power supply to the mains and turn on the main switch. Connect a voltmeter to the output terminals of power supply PWR1 and using the potentiometer on the power supply, set the output voltage to 64V. Repeat the procedure also for PWR2. Turn off the main power supply switch and connect the LK-20 modbus adapter to the PC via USB and upload MicroPython to U1 and copy the programs main_AP.py, modbus.py, my_lib.py, wifi_comm.py, which are contained in the archive ap.rar, to the root directory of the processor on U1. Then connect a USB cable from the PC to the HMI display and upload the display firmware containing micropython and to the root directory of the display's CPU, upload all files from the archive client.rar. Check the cabling and you can turn on the power supply. The boot process, establishing modbus communication and TCP via WiFi will be signaled in the top status bar and should end with the status STATUS: . If so, your power supply is ready for operation; if not, you most likely made an error in the cabling. The final screen after successful boot and program startup looks like this:
.
Technical Parameters
Converter mode: step-down/buck
Input voltage: AC 195 V - 245 V
Output voltage: 0-60 V
Output current: 0-20 A
Output ripple: 100 mv VPP
Output power: 1200 W
Measurement resolution: 0.01 V/A
Fan activation: I > 2A, P > 45W, T > 50 °C
External thermal protection: 0 - 110 °C
Input overvoltage protection for XY6020: 0-71 V
Output overvoltage protection for XY6020: 65 V
Output overcurrent protection: 22 A
Notes
Practical daily use of the power supply has shown that building in the ZVS 1000W induction heating module (PWR6) is not the happiest solution due to its low reliability and I do not recommend its integration to potential builders of a laboratory power supply. The block is sensitive to the character of the inductive load, often fails, does not want to oscillate spontaneously, or the FET transistors are destroyed without being current or voltage overloaded.
Useful Links
https://dedeideas.eu/index.php/sk/laboratorny-zdroj-s-xy6020l
https://cs.wikipedia.org/wiki/Modbus
https://allegro.sk/ponuka/1000w-zvs-nizkonapatovy-modul-varnej-dosky-14096359685?utm_feed=547ce2b2-2e28-4773-9707-58218068540e&utm_source=google&utm_medium=cpc&utm_campaign=SK%3EAll%3E1fulfillment%3EPLA&ev_campaign_id=21150088683&gad_source=1&gad_campaignid=21150088683&gbraid=0AAAAAqKvbIiOsXLs-Aj_MmAenGOU2RU6O&gclid=CjwKCAjwr5_CBhBlEiwAzfwYuHbxLq3eLmLY6McRudArRqOSeiiurC6zhhg2-5imkzsVqrySlFdw_hoCV_cQAvD_BwE
https://en.wikipedia.org/wiki/User_interface
https://www.waveshare.com/wiki/ESP32-S3-DEV-KIT-N8R8
https://micropython.org/
https://dedeideas.eu/index.php/sk/na-stiahnutie/15-laboratorny-zdroj-lk-20?download=44:xy6020l-users-manual-sk1
https://github.com/sanny32/OpenModScan
https://dedeideas.eu/index.php/sk/na-stiahnutie/15-laboratorny-zdroj-lk-20
https://thonny.org/
https://www.aliexpress.com/item/1005007566574866.html?gatewayAdapt=vnm2glo#nav-specification
https://www.laskakit.cz/riden-rd-1500-68-modulovy-napajeci-230v-ac-dc-zdroj-68v-22-1a-1500w/


