- Posts: 4739
- Thank you received: 2
[ Vfdmod ] An easy VFD control over MODBUS RTU
- Todd Zuercher
- Offline
- Platinum Member
-
Please Log in to join the conversation.
- s_volenszki
- Offline
- New Member
-
- Posts: 6
- Thank you received: 0
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 to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Please Log in to join the conversation.
I can't believe CRC works normally in writing mode, but needs to swap a pair of bytes in reading mode. It's insane!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
Please Log in to join the conversation.
- s_volenszki
- Offline
- New Member
-
- Posts: 6
- Thank you received: 0
I do not know what's next. I try to change Modbus data format and Modbus protocol type, if it will fail too, I think I either start to learn the 0-10V analog solution or the PWM solution (if the VFD supports), or ask may local supplier to give me quotation for a supported VFD (like Omron or Siemens).
Thank you all for your help so far.
Please Log in to join the conversation.
- s_volenszki
- Offline
- New Member
-
- Posts: 6
- Thank you received: 0
What I did with Sako SKI-780:
- Set the PP-01 to 01 manual on the VFD control panel (01 = reset factory settings except motor parameters)
- I used the default 9600 baudrate.
- Set the command source to RS485 with serial console app (01 06 F0 02 00 02 9A CB).
- Set the main frequency source to RS485 with serial console app (01 06 F0 03 00 09 8A CC).
- Changed the Modbus protocol to 31, standard Modbus communication, through RS485 with serial console app (01 06 FD 05 00 1F).
- Changed the Modbus data format to 8,N,1 (value 3) through RS485 with serial console app (01 06 FD 01 00 03).
Read baudrate
Request: 01 03 FD 00 00 01 B5 A6
Response: 01 03 02 17 75 76 53
Calculated response CRC: 0x5376
Write baudrate
Request: 01 06 FD 00 17 75 76 71
Response: 01 06 FD 00 17 75 76 71
Calculated response CRC: 0x7176
Set spindle speed to 100Hz
Request: 01 06 10 00 09 C4 8A C9
Response: 01 06 10 00 09 C4 8A C9
Calculated response CRC: 0xC98A
So I don't know what was the key parameter for the solution, but now it works, and I hope, next time if someone walks the same way, will end up in less dead ends like me did (I think because of my inattention)
Please Log in to join the conversation.
- hitchhiker
- Offline
- Elite Member
-
- Posts: 246
- Thank you received: 0
I want to work with your component but i think i am to stupid to do the correct changes to the ini......
i add the ini to this reply and a picture from the registers.
please please please help.... thanks...
Please Log in to join the conversation.
- hitchhiker
- Offline
- Elite Member
-
- Posts: 246
- Thank you received: 0
thanks
Please Log in to join the conversation.
Thanks @aekhv for this lovely bit of code!
Hope this information comes in handy for anyone using a Folinn VFD!

Here's the ini file I've used on Debian Bullseye with LinuxCNC 2.9 (default release packages work perfectly fine):
And here's the files added to the custom.hal to make it work with the interface:
Please Log in to join the conversation.
I got a feeling my RS485 interface is bad but you have inspired me to keep trying!
It would be helpful if you could outline the changes you made in the VFD settings to enable RS485 control
Please Log in to join the conversation.
