Modbus

More
20 Mar 2021 18:44 #203007 by robertspark
Modbus was created by robertspark
I am as confused as well hell about modbus..... well its implementation in linuxcnc

Ive got a 7i76E which I am hoping to share between a milling machine with a VFD and a router with a Super-PID

I've dabbled with VFDMOD, but that seems to use fixed fields for the modbus communication (and my VFD does not use the same "parameters" as the VFDMOD...... I commented out and change some fields and it got upset :)

I'm presently working my way through MB2HAL.

What is everyone using and what is your experiance?

__________________________________________________________________
{this will also probably act as an aide memoir for me too}

My VFD is a IMO Jaguar VXR

I've plonked the manuals here:
drive.google.com/drive/folders/1wsIB9acX...vgUAgAyk?usp=sharing

It appears to use STD modbus RTU (19200, 8, N, 1) {not some odd ball HY vfd protocol}

It uses 8 RTU message categories
0x03 read holding registers
0x06 single register
0x10 multiple registers
0x08 diagnotics
0x01 read coil
0x05 force single coil
0x0F force multiple coils
error response

I must admit at this point I'm fairly confused (given some of the fixed fields within VFDMOD)

eg: say my drive address is 0x03, and I want the drive to run FWD
the message will then be:
ADD // FC // Coil Add // Write
0x03 // 0x05 // 0x0001 // 0xFF00 //CRC

if I want the drive to run in REV, the message would then be
ADD // FC // Coil Add // Write
0x03 // 0x05 // 0x0003 // 0xFF00 //CRC

if I want to STOP the drive it would be:
ADD // FC // Coil Add // No Coils // Byte // Write
0x03 // 0x0F // 0x0008 // 0x0008 // 0x01 // 0x00 // CRC

if I want to RESET the drive, the message would then be
ADD // FC // Coil Add // Write
0x03 // 0x05 // 0x0010 // 0xFF00 //CRC

Setting the VFD Speed (in RPM) Fn: S19 [1000 rpm = 0x03E8)
ADD // FC // // No. // Write
0x03 // 0x06 // 0x07 // 0x13// 0x03E8 //CRC

Setting the VFD Speed (in Hz) Fn: S05
1000rpm x 4 / (2 x 60) = 33.33r Hz
33.33 Hz x 100 => 0x0D05
ADD // FC // // No. // Write
0x03 // 0x06 // 0x07 // 0x05 // 0x0D05 //CRC

Reading the VFD Speed (in Hz) [Fn: M09, Output Frequency 0.00d - 655.35d in 0.01Hz)
ADD // FC // // No. // Write
0x03 // 0x03 // 0x08 // 0x09 // 0x0001 // CRC

RESPONSE:
ADD // FC // // No. // Write
0x03 // 0x03 // 0x02 // 0x0D05 //CRC
0x0D05 => 3333d
3333 x 60 x 2 / (4 x 100) = 999.9 rpm
Multiplier = 120
Denominator = 400

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

More
21 Mar 2021 10:36 - 21 Mar 2021 10:45 #203098 by aekhv
Replied by aekhv on topic Modbus
Hi,

I didn't test read/write coils functions in real life, I thought they should work fine (why not, ha-ha :) ), but according to this these functions may work incorrect. So it's better to use read/write holding registers functions, instead of read/write coils.

Just looked at the manual you attached above and didn't see any reason why vfdmod will not work with your VFD. Could you show your ini file?
Last edit: 21 Mar 2021 10:45 by aekhv.
The following user(s) said Thank You: robertspark

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

More
21 Mar 2021 11:54 - 21 Mar 2021 15:43 #203111 by robertspark
Replied by robertspark on topic Modbus
I'll post my ini file later when at pc.

thanks for taking a look at my post / thread. I didn't want to taint your thread with someone moaning it did not work for them,

the problem I have is my vfd seems not to like to use holding registers to control FWD / REV

it only seems to like the use of coils for these two.

also it does not seem to use "run" and "dir" just FWD / REV (and STOP)

funny enough I can use a holding register for STOP

maybe I missed something in the manual (very possible!)

also RESET requires two holding registers to be written to (sequence)
holding register Drive Power OFF (set)
holding register Reset ON (set)

by writing to the same holding resister, your component (which I like very much) only seems to allow 1 sequence to be written.
Last edit: 21 Mar 2021 15:43 by robertspark.

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

More
22 Mar 2021 02:08 #203191 by aekhv
Replied by aekhv on topic Modbus
Ok, take a look on page 3-7, table 3.3 of "Jaguar RS485 Man.pdf", to run your VFD forward or reverse you have to preset coils number 0 (FWD) or 1 (REV). I guess to stop VFD both coils should be reseted to 0, but it's not important now. According to remark in that table command operations also supported by S06 command, and this is important :)



Page 5-2, table 5.2 describes S06 command, it provides access to 16-bit control word, where bit 0 is similar coil number 0, and bit 1 is similar to coil number 1.



To convert S06 command code to register's address see page 3-4, table 3.2, the address should be hi(0x07) & lo(0x06) = 0x0706.



So, according data above, your control word address is 0x0706, and the control values are:
0x0000 - stop (bit 0 and bit 1 are cleared)
0x0001 - run forward (bit 0 is set)
0x0002 - run reverse (bit 1 is set)

To send a command word to VFD you can use MODBUS function 0x06 (write single register) or 0x10 (write multiple registers).
Attachments:

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

More
22 Mar 2021 02:18 #203192 by aekhv
Replied by aekhv on topic Modbus

also RESET requires two holding registers to be written to (sequence)
holding register Drive Power OFF (set)
holding register Reset ON (set)

by writing to the same holding resister, your component (which I like very much) only seems to allow 1 sequence to be written.

Yes, only one register can be written, writing a sequences (writing a multiple registers one-by-one to complete an action, like reset action in your case) is not supported by vfdmod.

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

Time to create page: 0.126 seconds
Powered by Kunena Forum