Using a KORAD KA3005D with USB interface (like KA3005P) - Page 1
Forum section: electronics / testgear

author: rgo496
author_rank: Newbie
timestamp: November 23, 2014, 09:02:43 pm
content: I have recently bought a KORAD KA3005D. When opening the unit i found that the built quality has much improved (no more flux residues, no bad soldering or SMD bad placements) over the pictures i have seen in Dave's videos.Unfortunately i have bought a KA3005D expecting it to be USB controllable. Later i found out, that i should have bought the KA3005P version. The D-Version has no external USB connector.Looking through various forums dealing with the KORAD KA3005 i found, that there is a connector J9 on the main controller board, that contains 4 signals ( VSS, RX, TX and VDD ). This connector is empty in the D-model( no connector plugged ), while in the P-model there is a 4 pin wire to the USB board on the back of the unit.Looking at the various photos of the USB circuit of the p-model, i found out, that beside the RS232 circuitry and the power circuit fed from the x-former, there are only a few parts ( 2 optocouplers , a microprocessor , the USB connector and some resistors and caps )The optocouplers are really necessary, since VSS of the 4-pin connector is based on the positive output voltage. So, if output voltage is 0 Volts its actually near GND (+/- 50 mV). However, if output voltage is e.g. 10 Volts, VSS shifts to 10 Volts and VDD from 3,3 Volts to 13,3 Volts.So i added an optocouplerboard with FTDI-chip to the 4 pins and connected it to my PC.I tried various commands with various terminal programs : IDN? , STATUS? , VSET1:12.34 no responsethen i used the Vellemann and the KORAD programs for the KA3005P, both programs hang atstatus: wait for connecting.i put a scope on the XMIT line and found the following HEX record to be sent:AA AA (21 times 00) 54 (which is the correct checksum for this data record). 24 bytes in total.AA 20 was published somewhere here in the forum, which is probably not correct (see scope picture).By shortening the RX and TX lines i could get the programs working (connection established) and showing the plots of the voltages in the graphs. So the programs also need to get a feedback of 24 bytes.Since the main board processor does not react to the commands, the processor on the USB-board doesn't simply route the 24 bytes to the processor. It must send some modified commands to the main board.On the other side: why using a second processor to simply pass and receive dataThis can be done with existing chips.Now, we only need to find out , what is transferred between those both processors on their RX and TX lines on a KA3005P.Is there someone in the EEVblog community owning a KA3005P, who can scope or LA (logic analyze) the signal transfer on the RX and TX lines for a simple command ( setting voltage and current and set output on ) and the corresponding response from the mainboard ( actual voltage and current).I, for myself would then publish here a schematic for a circuit (Optocouplers ,resistors, caps, USB-connector and a PIC ) and the code for a Microchip PIC to do the translation.Help needed, getting a KA3005D modified to a KA3005P.May be of interest for many KA3005D owners.RenéPS.: By the way, the KA3005D recognizes, that there was an input on the RX line, because it locks all buttons. You have to remove the USB connector and repower the unit, exactly as described in the operating instructions.

author: hexreader
author_rank: Frequent Contributor
timestamp: November 24, 2014, 02:53:55 am
content: I have programmable Velleman PS3005D, which seems to be similar to the newer Korad PSUs.Signals show consistently as AA 20.... on both the command line to PSU and on the status line returned from PSU.They actually show as 1AA 120, since this seems to be 9 bit data ( 9600, 9 bits, no parity, 1 stop).If you are getting AA AA - then either you are doing something wrong, or the protocol has changed for your Korad, or maybe the Korad returns AA AA to signify a non-programmable supply.Have you considered that maybe the programmable option is deliberately disabled on the non-programmable version? I have no idea if this is the case, and the only thing I can think of is to put an interface card from a programmable supply into a non-programmable and see if it works. ....else keep hammering away at sending commands to the PSU in the hope that it might respond - as you seem to be doing now.Attached is a logic analyser sample of 3.3V pins 2 and 3 of the 4-pin motherboard connector. Rename it to PS3005D.alc. You will need to download Logic analyser software for Zeroplus C16032 to view it.

author: hexreader
author_rank: Frequent Contributor
timestamp: November 24, 2014, 03:02:28 am
content: You may be interested in my project for messing around with the RS232 signals of the PSU.Be warned that there is a lot if wrong information here - and the code is buggy.http://www.libstock.com/projects/view/1016/easypic7-control-velleman-ps3005d-power-supplySelect "older versions" to find the simple control program. It just sends the 24-byte control sequence and repeats one per second - seems to work without any complicated initialisation. I assume that sending on RS232 port would have the same effect as sending straight to motherboard, but maybe that is a bad assumption.

author: hexreader
author_rank: Frequent Contributor
timestamp: November 24, 2014, 03:43:27 am
content: Hold fire!AA AA...... does seem to be a valid sequence - at start-up.PSU replies with AA AA..... too.Not seen any info on this sequenceAttached is a second Logic Analyser file, this time with more messages decoded and starting right from initialisation.

author: rgo496
author_rank: Newbie
timestamp: November 24, 2014, 01:18:14 pm
content: Quote from: hexreader on November 24, 2014, 03:43:27 amhello hexreader,thank you very much for your help.as far as i can interprete your LA output:the first 2 communication records actually start with AAAAPC : AAAA 21 times 00 54 correct ChecksumPSU: AAAA 00 C8 , 20 times 00 that's 2 volts,probably your M1 voltage or the last one you've set, no valid checksumthen it switches over to AA20PC : AA20 ,21 times 00, CA Velleman SW starts with zero volts and zero ampsPSU: AA20 23 times 00 ok, PSU doesn't respond a correct checksum--------------- skipped some records to get to the interesting ones---------------SW : AA20 0064 0064...............010101.....95 setting voltage to 1 Volt, current to 100mA and OUTPUT onPSU: AA20 0064 11 times 00 01 8 times 00 PSU confirms voltage but not the current setthis repeats until the end of the LA protocol.If you put no load on the PSU, the PSU response seems to be OK.my Conclusion: The mainboard actually doesn't respond to a correct serial input. TX pin always stays high. However, if they really put a different code into the microprocessor for the D model, why didn't the save the extra connector.so they need to manage two different boards for the D and P models.Maybe they only put an extra open or short bridge on the board to enable/disable the serial input ? But for that i need a P-model board to inspect for this.By the way, the extra windings for the USB board have been eliminated on the X-former for the D version on latest models.On the other hand: the USB board is really overdimensioned: 4 x 3Amp. diodes plus 2 big electrolytic caps, a microprocessor to simply feed the serial signal to the mainboard without modifying it. Even with the MAX232 it doesn't need that much power.I could build an USB only version on a 2 sq. inch board by using 2 optocouplers , one FTDI chip, a few resistors and an USB-Connector. the whole thing can be powered by the USB ports 5V.regards, RenéPS.: yes i have downloaded and read the article you mentioned in your previous posts.

author: kikkoman
author_rank: Newbie
timestamp: April 03, 2015, 05:29:21 am
content: Quote from: rgo496 on November 24, 2014, 01:18:14 pmhello rgo496,while I was probing around a little with a USB-TTL converter recently, i kinda-sorta managed to get data out of it.Since there were no obvious external pullups connected to the TX pin, I figured there's an internal pull-up active.So I hooked up a trimpot to GND and at roughly 10k (IIRC) it seemed to cancel out the pullup and it started talking.I had to put it back together soon after so I did not really check if the data made any sense. The PC program didn't like it but it all was cobbled together pretty hastily, so maybe I missed something (depending on the TTL-USB converter the RX line might need a pulldown too). It might be inverted or something.(Those Nuvoton TQFP48 8051 MCUs all seem to have similar pinouts, the PSU uses I/O ports for the serial data.... it might have a dedicated UART on pin 5 (RX) and 7 (TX), or maybe not. I'll check!)From what I can tell from the pictures of the 3005P USB/RS232 boards on the forum, I'm pretty sure there's a pulldown on the TX line right before the optocoupler. Maybe someone can check...?So, I think there's no difference in firmware between the two models. Populating that one header is apparently cheaper that having to set up a 2nd production branch?My unit is currently at work but I'm going to take it home over the weekend and dig a little deeper. I'll see if I can get the cheapo logic analyzer to work with it.(The fact that the USB board uses another 8051 (from Nuvoton again) for USB connectivity could mean that there's more trickery going on than plain TTL UART and that this is a dead end..... but then again, if it's the same MCU as the main one it could be cheaper in bulk for KORAD than a dedicated USB/UART IC and they use it as just that.)