[ Vfdmod ] An easy VFD control over MODBUS RTU

More
4 years 9 months ago #231343 by s_volenszki
Replied by s_volenszki on topic [ Vfdmod ] An easy VFD control over MODBUS RTU
No eBay APP ID and/or Cert ID defined in Kunena configurationToday I received an industrial USB to RS485 converter () and I tried. The slave problem gone, but all response has CRC error. If I use Windows 10 Commix 1.4, everything is ok. Tried the delays (LoopDelay 50-10000, ProtocolDelay 5-100), no effect.

What else can I check?

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #231381 by aekhv
Try to test communication on different speed (9600, 19200, 38400 etc).

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #231444 by Todd Zuercher
Replied by Todd Zuercher on topic [ Vfdmod ] An easy VFD control over MODBUS RTU
Double check that all com settings are the same for your device and in Linuxcnc. Make sure your device is configured for RTU and not ASCII.

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #231800 by s_volenszki
Replied by s_volenszki on topic [ Vfdmod ] An easy VFD control over MODBUS RTU
Hi, thank you for your answer!

I had no time on the week just tonight and I fired up the logic analyser. The result was surprising, actually all response CRC are invalid checksum. I used Saleae Logic analyzer software with Modbus RTU analyzer. After I started to read the VFD documentation again and I found something:

"At the time of transmission, the low bytes are in CRC CHK high bit front and the high bytes are in the back. When CRC is added to the message, low bytes are added first, and then high bytes."

This is a command to read the VFD current frequency:
01 03 10 00 00 01 80 CA

This is the answer from the VFD:
01 03 00 02 09 C4 E3 C9

And if I calculate the 01 03 00 02 09 C4 CRC value:
CRC-16/MODBUS => 0xC9E3

So this is absolutely clear the VFD answering the CRC in reverse. Now only one question left, how can I reverse the CRC before the Vfdmod start to compare with the pre calculated CRC?

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago #231808 by Todd Zuercher
Replied by Todd Zuercher on topic [ Vfdmod ] An easy VFD control over MODBUS RTU
I would suggest checking your VFD's documentation for a setting that corrects it.

Please Log in or Create an account to join the conversation.

More
4 years 9 months ago - 4 years 9 months ago #231863 by aekhv
According file attached upper (seeĀ  forum.linuxcnc.org/24-hal-components/387...-rtu?start=70#230567 ), write function works well, including CRC checking.

vfdmod: setting command speed value to 2500 (0x09C4)...
[01][06][10][00][09][C4][8A][C9]
Waiting for a confirmation...
<01><06><10><00><09><C4><8A><C9> <<< OK! Response is valid!

vfdmod: setting control word value to 6 (0x0006)...
[01][06][20][00][00][06][02][08]
Waiting for a confirmation...
<01><06><20><00><00><06><02><08> <<< OK! Response is valid!

vfdmod: reading 'spindle.rpm-out' from address 4096 (0x1000)...
[01][03][10][00][00][01][80][CA]
Waiting for a confirmation...
<01><03><00><02><09>
ERROR CRC received 0x209 != CRC calculated 0x20F0

I can't believe CRC works normally in writing mode, but needs to swap a pair of bytes in reading mode. It's insane! :)
Last edit: 4 years 9 months ago by aekhv.

Please Log in or Create an account to join the conversation.

Time to create page: 0.140 seconds
Powered by Kunena Forum