mesa_modbus vs Omron Q2A VFD struggling
24 May 2024 21:12 - 24 May 2024 21:13 #301358
by pingtomi
mesa_modbus vs Omron Q2A VFD struggling was created by pingtomi
Dear All,
I've set up Mea 7i95 + mesa_modbus with Omron Q2A VFD. Wiring is OK, communication works at physical layer, but I'm in stuck, because:
Omron Q2A VFD expects the following Modbus commands:
CW run: Func code: 0x10, address 0x0001, value 1 (last bit)
CCW run: Func code: 0x10, addres 0x0001, value 2 (last two bit)
STOP: Func code: 0x10, addres 0x0001, value 0
Freq: Func code 0x10, address 0x0044
But spindle.0.forward and spindle.0.reverse are binary outputs, how can I link them to Modbus?
I mean modbus would write "1" when spindle.forwad=true, and "2" when spindle.reverse=true at address 0x0001
This was easy with vfd_modbus, but how to do with mesa_modbus? I couldn't figure it out.
+ cw and ccw and stop register address is the same. It seems it is not supported if I link two hal_pins to the same address in mesa_modbus conf file.
+ func code 0x10 is not supported ... ? btw it seems it works with 0x06, however based on the official manual 0x10 is expected.
Would be great to get rid of vfd_modbus due to lack of rs485 ports in my new industrial PC.
Thank you for your ideas!
Tamas
I've set up Mea 7i95 + mesa_modbus with Omron Q2A VFD. Wiring is OK, communication works at physical layer, but I'm in stuck, because:
Omron Q2A VFD expects the following Modbus commands:
CW run: Func code: 0x10, address 0x0001, value 1 (last bit)
CCW run: Func code: 0x10, addres 0x0001, value 2 (last two bit)
STOP: Func code: 0x10, addres 0x0001, value 0
Freq: Func code 0x10, address 0x0044
But spindle.0.forward and spindle.0.reverse are binary outputs, how can I link them to Modbus?
I mean modbus would write "1" when spindle.forwad=true, and "2" when spindle.reverse=true at address 0x0001
This was easy with vfd_modbus, but how to do with mesa_modbus? I couldn't figure it out.
+ cw and ccw and stop register address is the same. It seems it is not supported if I link two hal_pins to the same address in mesa_modbus conf file.
+ func code 0x10 is not supported ... ? btw it seems it works with 0x06, however based on the official manual 0x10 is expected.
Would be great to get rid of vfd_modbus due to lack of rs485 ports in my new industrial PC.
Thank you for your ideas!
Tamas
Last edit: 24 May 2024 21:13 by pingtomi.
Please Log in or Create an account to join the conversation.
25 May 2024 00:51 #301364
by PCW
Replied by PCW on topic mesa_modbus vs Omron Q2A VFD struggling
You can use the weighted_sum component
to combine individual bits to create an integer
command
to combine individual bits to create an integer
command
Please Log in or Create an account to join the conversation.
25 May 2024 10:33 #301399
by andypugh
Replied by andypugh on topic mesa_modbus vs Omron Q2A VFD struggling
I wrote the enum component for this specific application.
linuxcnc.org/docs/stable/html/man/man9/enum.9.html
linuxcnc.org/docs/stable/html/man/man9/enum.9.html
Please Log in or Create an account to join the conversation.
25 May 2024 10:39 #301400
by andypugh
Replied by andypugh on topic mesa_modbus vs Omron Q2A VFD struggling
Reading through my own docs, I think you probably want
D;;forward;reverse
To create forward and reverse pins that output a 1 or a 2.
D;;forward;reverse
To create forward and reverse pins that output a 1 or a 2.
Please Log in or Create an account to join the conversation.
26 May 2024 15:53 #301491
by pingtomi
Replied by pingtomi on topic mesa_modbus vs Omron Q2A VFD struggling
Thank you, but it seems Q2A does not accept Modbus function code 0x06, I always get modbus error 134.
Is there possible somehow to send 0x10 function code?
Thank you.
Is there possible somehow to send 0x10 function code?
Thank you.
Please Log in or Create an account to join the conversation.
26 May 2024 16:30 #301496
by andypugh
Replied by andypugh on topic mesa_modbus vs Omron Q2A VFD struggling
Yes, it should just be a case of changing the line in the config file. Probably to
(HAL_U32, 16, 0x001, 1, "OnOffDirection")
Please Log in or Create an account to join the conversation.
26 May 2024 16:53 - 26 May 2024 17:00 #301502
by pingtomi
Replied by pingtomi on topic mesa_modbus vs Omron Q2A VFD struggling
So I tried vfd_mod (github.com/aekhv/vfdmod) and Q2A works with func code 0x06, debug output:
vfdmod: setting command speed value to 500 (0x01F4)...
[01][06][00][02][01][F4][28][1D]
Waiting for a confirmation...
<01><06><00><02><01><F4><28><1D>
My mesa_modbus setup as follows:
7i95 with pktUart support:
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 192.168.1.121: INFO: Hardware address (MAC): 00:60:1b:15:01:17
hm2_eth: discovered 7I95
hm2/hm2_7i95.0: Low Level init 0.15
hm2/hm2_7i95.0: created PktUART Interface function hm2_7i95.0.pktuart.0.
hm2/hm2_7i95.0: Smart Serial Firmware Version 43
....
hm2/hm2_7i95.0: IO Pin 015 (TB4-20/TB4-21): PktUART Receive Channel #0, pin RX Data (Input)
hm2/hm2_7i95.0: IO Pin 016 (TB4-22/TB4-23): PktUART Transmit Channel #0, pin TX Data (Output)
hm2/hm2_7i95.0: IO Pin 017 (TB4-22/TB4-23): PktUART Transmit Channel #0, pin Drv Enable (Output)
.....
wired Rx+(tb4/20) to Tx+(tb4/22), 560R to GND
wired Rx-(tb4/21) to Tx-(tb4/23), 560R to +5V
connected to Q2A
Q2A detects the Modbus connection when Linuxcnc starts, "CALL serial connection error" disappears
vfd.mod:
#define MAX_MSG_LEN 32 // may be increased if necessary to max 251
//#define DEBUG
static const hm2_modbus_chan_descriptor_t channels = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
{HAL_FLOAT, 6, 0x0001, 1, "spindle_control"},
{HAL_FLOAT, 6, 0x0044, 1, "spindle_freq"},
};
HAL:
loadrt vfd ports=hm2_7i95.0.pktuart.0
addf vfd.00 servo-thread
setp vfd.00.address 0x01
setp vfd.00.baudrate 9600
setp vfd.00.txdelay 20
setp vfd.00.parity 2
setp vfd.00.update-hz 2
I see spindle_control and spindle_freq pins in halshow, but I can't "do anything" by sending some values manually.
If I change HAL_FLOAT type to HAL_S32 or HAL_U32 I always get "DnE drive disabled comm error" message on Q2A, return code 128 and have to reset the drive.
Otherwise I always get error 134.
Any clue please?
Thx a lot!
Tamas
vfdmod: setting command speed value to 500 (0x01F4)...
[01][06][00][02][01][F4][28][1D]
Waiting for a confirmation...
<01><06><00><02><01><F4><28><1D>
My mesa_modbus setup as follows:
7i95 with pktUart support:
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 192.168.1.121: INFO: Hardware address (MAC): 00:60:1b:15:01:17
hm2_eth: discovered 7I95
hm2/hm2_7i95.0: Low Level init 0.15
hm2/hm2_7i95.0: created PktUART Interface function hm2_7i95.0.pktuart.0.
hm2/hm2_7i95.0: Smart Serial Firmware Version 43
....
hm2/hm2_7i95.0: IO Pin 015 (TB4-20/TB4-21): PktUART Receive Channel #0, pin RX Data (Input)
hm2/hm2_7i95.0: IO Pin 016 (TB4-22/TB4-23): PktUART Transmit Channel #0, pin TX Data (Output)
hm2/hm2_7i95.0: IO Pin 017 (TB4-22/TB4-23): PktUART Transmit Channel #0, pin Drv Enable (Output)
.....
wired Rx+(tb4/20) to Tx+(tb4/22), 560R to GND
wired Rx-(tb4/21) to Tx-(tb4/23), 560R to +5V
connected to Q2A
Q2A detects the Modbus connection when Linuxcnc starts, "CALL serial connection error" disappears
vfd.mod:
#define MAX_MSG_LEN 32 // may be increased if necessary to max 251
//#define DEBUG
static const hm2_modbus_chan_descriptor_t channels = {
/* {TYPE, FUNC, ADDR, COUNT, pin_name} */
{HAL_FLOAT, 6, 0x0001, 1, "spindle_control"},
{HAL_FLOAT, 6, 0x0044, 1, "spindle_freq"},
};
HAL:
loadrt vfd ports=hm2_7i95.0.pktuart.0
addf vfd.00 servo-thread
setp vfd.00.address 0x01
setp vfd.00.baudrate 9600
setp vfd.00.txdelay 20
setp vfd.00.parity 2
setp vfd.00.update-hz 2
I see spindle_control and spindle_freq pins in halshow, but I can't "do anything" by sending some values manually.
If I change HAL_FLOAT type to HAL_S32 or HAL_U32 I always get "DnE drive disabled comm error" message on Q2A, return code 128 and have to reset the drive.
Otherwise I always get error 134.
Any clue please?
Thx a lot!
Tamas
Last edit: 26 May 2024 17:00 by pingtomi.
Please Log in or Create an account to join the conversation.
26 May 2024 19:41 #301513
by pingtomi
Replied by pingtomi on topic mesa_modbus vs Omron Q2A VFD struggling
Is there a way somehow to debug/display modbus messages which are sent out?
Please Log in or Create an account to join the conversation.
Time to create page: 0.072 seconds