Author Topic: Serial to usb on Kunkin KP184 electronic load  (Read 46772 times)

0 Members and 1 Guest are viewing this topic.

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #50 on: January 25, 2021, 11:43:42 pm »
If the previous test (loopback test) is successful and you are in the mood to throw some more jabs at this subject. You can collect additional debug information of why the communication is not starting:

1. Please make sure you have Kunkin KP184 configured for communication address 1 on the operating panel and record the configured baudrate to match with CoolTerm software configuration.

2. Connect Kunkin and your serial adapter with a straight through cable 2-2 3-3 5-5 no shunts required on either side.

3. Start CoolTerm and configure it for the Kunkin baudrate 8-N-1 and use your serial adapter COM port. Check Windows Control Panel \System \ Hardware Manager \ COM Ports for the COM Port names.

4. Select Connection \ Connect option to connect to the COM Port.

5. Select Connection \ Send String option to send an Hex ModBus command to Kunkin.

6. Select the Hex option. You will provide each byte in Hex format. Enter the ModBus command: 01 03 00 01 00 04 C9 15 and press the Send button. You can use a space between each pair of digit for easier byte identification. This ModBus command asks for 4 bytes from the Kunkin register memory address 0x001 that holds the device ID



7. Kunkin should answer promptly with 01 03 04 00 00 07 30 17 F8 as you can see on the underlying CoolTerm Window.

0x0730 is 1840 in decimal and identifies a Kunkin KP184


This is generic debug. In your case Kunkin should remain silent judjing by the probing you already performed.
« Last Edit: May 27, 2023, 11:30:34 am by interflexo »
 

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #51 on: January 25, 2021, 11:58:00 pm »
New KP184 Software Version 1.0.10.0:

Changes:

1. .ini configuration file now is placed on folder "KP184 Modbus" inside "User\AppData\Roaming" folder. During setup installation upgrades this file is not overwritten to preserve your configuration.

2. Data files (.csv, .png, .pdf, pdf reports, etc. are now created on a folder "KP184 Modbus" inside "My Documents" folder. You can select other folders, the configured folder for .csv files is used.

This should get rid of the need to run the application in Administrator mode. No files are modified inside the installation folder during runtime.

Setup KP184 Software V1.0.64.0
« Last Edit: February 14, 2024, 08:30:36 pm by interflexo »
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #52 on: January 26, 2021, 07:52:34 am »
I tried what you posted and sent the message with Coolterm, no answer from the load. I‘m sure baudrate, address and other settings are correct.

I thought maybe the isolator chip U23 is faulty, so I desoldered it and connected a USB to TTL adapter directly to the MC (soldered GND, RX and TX onto the MC-side of U23). U23 is directly connected to the MC.

Still no reply from KP184 😞
 

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #53 on: January 26, 2021, 11:10:18 am »
The Kunkin MCU pins original solder reflow looks ok?
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #54 on: January 26, 2021, 12:28:03 pm »
Looks good to me. I can scope the RX message right on the top of the MC pin, but no TX message on TX pin. No measured shorts between the pins on MC.
The MC just doesn’t react to the sent message. I think its firmware related.
The unit itself runs fine, but no serial communication.

If I use your SW and try to connect the LED on the backside of the load flashes green for a moment. This means write-to-KP184, right?
« Last Edit: January 26, 2021, 12:38:32 pm by Penguin36 »
 
The following users thanked this post: wolzlu

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #55 on: January 26, 2021, 03:40:22 pm »
Probably yes. KP184 manual does not mention the LED function.

KP184 software writes the connect command only once and then waits until 5 seconds for the right answer while flashing the icon.

Probably RS-232 and rs-485 share the same TX MCU pin. If not true you can also take a basic look at the RS485 interface.

Put a dummy 120 Ohm resistor through the 485-A and 485-B pins at the back Kunkin connector.

Set the scope and probes on the 2 RS-485 pins as suggested on page 3 here:

Oscilloscope RS-485

Configure Kunkin as Host on:

    SYS \ Online Mode \ Set it to Host (It should be OFF in Normal operation)

Right now when you configure Kunkin on the operation panel or turn Load ON/OFF ModBus commands are automatically sent through RS-485 interface to be replicated on several Online Mode \ Slave devices. You can catch the com signals with your scope on the Math CH2-CH1 channels.
« Last Edit: January 26, 2021, 03:49:00 pm by interflexo »
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #56 on: January 26, 2021, 03:58:23 pm »
I will try that, thank you for your help so far 👍
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #57 on: January 26, 2021, 06:29:15 pm »
What I don’t understand, even if TX line is broken the load should react when sending ‚switch on/off‘ the load. But it does nothing via serial connection.
« Last Edit: January 26, 2021, 08:57:57 pm by Penguin36 »
 

Offline Noy

  • Frequent Contributor
  • **
  • Posts: 361
  • Country: de
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #58 on: January 26, 2021, 09:42:58 pm »
In my unit the optocoupler was not soldered correctly. Did you checked it?
 

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #59 on: January 26, 2021, 10:40:02 pm »
What I don’t understand, even if TX line is broken the load should react when sending ‚switch on/off‘ the load. But it does nothing via serial connection.

If the serial connection is not established by receiving the correct answer to the first register request there are no further communications. The software is always querying the unit for updated values and status. Modbus RTU is a 2 way protocol. When you send a command most of the times you will receive an answer from the unit.
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #60 on: January 27, 2021, 05:22:38 am »
In the case of your SW, yes. You are polling values so the load must answer, and it does (well, not mine)

But if I send the ‚switch on/off‘ command via terminal program the load should receive the command on RX and switch on or off. I don’t need the confirmation like ,glad to hear from you, I will switch the load now on/off‘ 😉

So, when I send the command on/off via terminal and nothing happens (load stays in its last stage), then the load didn’t get the command to switch on/off at all.

It must be a FW bug in my unit, because I can scope the modbus command to switch on/off right at the MC pin, so the MC gets the message. Why the MC doesn’t react (and switch the load on/off), I don’t know.



« Last Edit: January 27, 2021, 05:29:04 am by Penguin36 »
 

Offline F64098

  • Regular Contributor
  • *
  • Posts: 53
  • Country: de
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #61 on: January 27, 2021, 06:11:36 am »
Same problem for me.
Software ist starting and running now (thank you Manuel!), but the KP184 plays deaf bug  >:(

Best regards

Frank
 

Offline F64098

  • Regular Contributor
  • *
  • Posts: 53
  • Country: de
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #62 on: January 27, 2021, 07:31:59 am »
 :palm:
 :palm:
Okay guys, please press Shift then Mode then Arrow down and then Arrow right and check your baudrate...
 :palm:

I got instable operation with baudrates > 19200.

Best regards

Frank
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #63 on: January 27, 2021, 07:39:31 am »
@Frank,
I tried every possible baud rate on the device. Its simply not responding to any commands.
 

Offline F64098

  • Regular Contributor
  • *
  • Posts: 53
  • Country: de
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #64 on: January 27, 2021, 08:04:49 am »
If I use your SW and try to connect the LED on the backside of the load flashes green for a moment. This means write-to-KP184, right?

Yes, that's right. And it has to flash red for sending data to the PC.
 

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #65 on: January 27, 2021, 10:04:48 am »
In the case of your SW, yes. You are polling values so the load must answer, and it does (well, not mine)

But if I send the ‚switch on/off‘ command via terminal program the load should receive the command on RX and switch on or off. I don’t need the confirmation like ,glad to hear from you, I will switch the load now on/off‘ 😉

So, when I send the command on/off via terminal and nothing happens (load stays in its last stage), then the load didn’t get the command to switch on/off at all.

It must be a FW bug in my unit, because I can scope the modbus command to switch on/off right at the MC pin, so the MC gets the message. Why the MC doesn’t react (and switch the load on/off), I don’t know.

You' re right. It should execute the received command, if the message CRC checks out of course.

When the unit is in good health it communicates well at the maximum configurable speed of 115200.
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #66 on: January 27, 2021, 10:20:06 am »
The CRC check is documented in the manual and there is the xls file with all commands here in this thread.
Maybe they changed something in the FW for KP184 and use other commands/crc.
My unit shows 2020 at bootup for short time. Don’t know if thats the FW version.
Main PCB is Rev. 04
 

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #67 on: January 27, 2021, 11:38:38 am »
The CRC check they use is the industry standard CRC-16/Modbus one, I don't believe they would change that.
Also the command set is based on the standard Modbus RTU protocol, changing that would render inoperative their own Chinglish software.

That's why the RS-485 test is important. The Kunkin as host would take the initiative at communications with a simple load on/off or change settings.
 

Offline wolzlu

  • Newbie
  • Posts: 3
  • Country: de
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #68 on: January 27, 2021, 01:00:33 pm »
Hi,
my unit has the same problem. It's a KP184 VER:04 202007. Not all Rev. 04 PCBs have the same layout, hence the date code. On boot it also shows KP184; 2020 (probably the firmware version) and the address.
First I thought it's a noise problem (see https://www.eevblog.com/forum/testgear/an-investigation-about-ripple-current-of-kunkin-kp184/).
Independent of Penguin36 I removed the isolator (U23) and connected a TTL converter directly.
Of course I tied the usual suspects first: different PC, adapter, baudrate, device settings, software, ...
U23 is causing noise too, so I added a capacitor on both sides afterwards.

To prove the connections and the MCU are OK, I put the device into bootloader mode.
Pull Pin 9 on the RS-232 connector to high or short the output of the corresponding optocoupler, then power cycle the load.
With software for STM32s I could connect to the bootlader via RS-232 (connection is working  ???)!
But I couldn't extract the firmware, because read protection is active (maybe there is help: https://www.eevblog.com/forum/microcontrollers/stm32-readout-protection-is-broken/).

Just to clarify you need a straight through cable (like the one that comes with the unit).
 
The following users thanked this post: interflexo

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #69 on: January 27, 2021, 01:16:33 pm »
So, your KP184 doesn’t respond to serial commands like mine?

A friend of mine has an older model of KP184,  I think its Rev 02, panel shows 1801 on boot.
I tested it with my Digitus RS232 adapter and the sw from this thread with my Asus Win10 notebook. Its all fine and working with the older model. Mine still doesn’t respond to serial commands.
I will try the RS-485 test later on.
 

Offline interflexo

  • Regular Contributor
  • *
  • Posts: 131
  • Country: pt
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #70 on: January 27, 2021, 05:22:43 pm »
New KP184 Software Version 1.0.12.0:

Changes:

1. .csv data files; .png plot graph files; .pdf plot graph files and .pdf test report files now all have independent configurable file names and folders and reset to folder "KP184 Modbus" inside "My Documents" in case of error.

2. There is a new button specific for the battery capacity discharge test report creation.

3. PDF User Manual now is installed on the folder named "KP184 Modbus" inside "My Documents".

Setup KP184 Software V1.0.64.0
« Last Edit: February 14, 2024, 08:31:10 pm by interflexo »
 
The following users thanked this post: CyberWalker

Offline rdsi

  • Contributor
  • Posts: 29
  • Country: us
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #71 on: January 28, 2021, 12:09:53 pm »
I had a similar situation with my BK 8500 load however its RS-232 port was using inverted 5V TTL levels. I decided to use a “PI Zero W” and a program called “ser2net” so that I could access the load via my network.  On my Windows machine I use a product from perle called TruePort to assign a COM port to load.  This product is FREE for this purpose and is available for both Windows and Linux.

So with a couple interface components I was able to connect the PI to the load.  Using the PI GPIO3 shutdown feature it will power-up & shutdown in sync with the load power state.

Solved my problem without using any wires between the load & PC.
If I can find the time this setup will allow me to write a WEB server for the load.
« Last Edit: January 28, 2021, 12:12:05 pm by rdsi »
 
The following users thanked this post: Dwaine

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #72 on: January 28, 2021, 04:52:36 pm »
Today I tried the RS-485 test with an 120 Ohm resistor and a scope. Put the KP184 in Host mode, pressed some buttons (on/off and so on) aaaannnnnndddddd?


Nothing!!!  😡

My unit simply doesn’t send anything to RS-232 and/or RS-485.
 

Offline wolzlu

  • Newbie
  • Posts: 3
  • Country: de
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #73 on: January 28, 2021, 04:59:11 pm »
@Penguin36: Yes, we have most likely the same problem.
@rdsi: I will use an ESP or similar. But first we need a working firmware for the load.
RS-232 and RS-485 use the same pins for TX / RX on the MCU. RS-485 needs an additional pin for setting the direction.
A key press transmits a data pattern (fefd000000xxxxxx hex) in host mode:
fefd000000007811 Encoder (both directions)
fefd0000003ef9c1 ON
fefd0000001f39d9 Mode
fefd0000003db9c0 Up
fefd0000002f39cd Down
fefd0000003b39c2 Left
fefd0000003739c7 Right
fefd0000001ef819 Shift
fefd00000027380b SET
I didn't get anything on the RS-485 side, probably because signal for switching direction is missing.
Receiving data via RS-485 works as expected. The slave mode has yet an other quirk  :palm:. I only could get it react to something, when switching from host to slave.
With the commands from above it only changes mode (CC to CV and so on) regardless of the button. If the load is on, it only beeps. Since you have to turn off the load, before changing the mode. For other patterns it did nothing. After reboot it is still in slave mode, but doesn't react anymore to serial commands.
Obviously the back LED is controlled by RX/TX and not directly by the MCU.
Hopefully someone cloud provide a working firmware. Would be interesting to know if all loads showing 2020 on boot have the same problem?
 

Offline Penguin36

  • Contributor
  • Posts: 46
  • Country: 00
Re: Serial to usb on Kunkin KP184 electronic load
« Reply #74 on: January 29, 2021, 02:02:07 pm »
I gave up and got another KP184 from ebay.
This one is PCB Rev.03 with FW 1801 (shown on bootup). RS-232 is working out of the box up to 115200 bps, no issues so far.
« Last Edit: January 29, 2021, 04:02:47 pm by Penguin36 »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf