Hello Guest it is February 28, 2020, 06:17:52 AM

Author Topic: Synchronized I/Os over Modbus (?)  (Read 89 times)

0 Members and 1 Guest are viewing this topic.

Synchronized I/Os over Modbus (?)
« on: February 13, 2020, 08:26:47 AM »
Hi all,

I am trying to wrap my head around the following problem:
I have multiple devices controlled over i2c that I want to operate according to the position of the 3 axes of a my cnc setup.

To visualize the problem one could imagine to have the following situation:
- 4 nozzles attached to a CNC setup
- the CNC moves the nozzles around over a plane
- according to the current position, each nozzle is turned either on or off

As I see it, one would need two sets of data:
1) toolpaths, fed to Mach3 as gcode
2) 2D matrix of 0s and 1s representing the raster "image" to be printed, loaded on a PLC
and
3) a way to communicate the position of the axes from Mach3 to the PLC and, consequently, operate the devices nozzles consistently

Given that all the assumptions above make sense, would Modbus be the best channel for transmitting such information?
Or do you know of any better way to reach a similar result?

Thanks,
Pietro
Re: Synchronized I/Os over Modbus (?)
« Reply #1 on: February 13, 2020, 01:19:11 PM »
Hi,
Modbus is not a realtime communication protocol thus there could be a timing error of tens of milliseconds between
your machine (under Mach control) being at a given location and your nozzles responding to being at that location.
Is the timing of the nozzels critical?

Craig
My wife left with my best friend...
     and I miss him!
Re: Synchronized I/Os over Modbus (?)
« Reply #2 on: February 13, 2020, 01:35:17 PM »
Hi,
you might be interested in some of the features of Mach4. In addition to six coordinated axes Mach4 can have up to six Out-of-Band (OB) axes.
The OB axes are jogged from either your Gcode or from a script which monitors machine position. The timing uncertainty diminishes
from tens or even hundreds of milliseconds with Mach3 and Modbus to sub millisecond with Mach4. Note there would be no need for a PLC
but you would require an external motion controller like an ESS or UC300 that had enough outputs to utilise the OB's.

Craig
My wife left with my best friend...
     and I miss him!
Re: Synchronized I/Os over Modbus (?)
« Reply #3 on: February 13, 2020, 06:55:15 PM »
Hi Craig, thanks for the input.
I briefly checked what features Mach4 offers. The OB Axes you mentioned might be interesting but, as far as I understand, the limit is 6 (industrial version) and they will output step/dir signals, which I should then intepret somewhere and translate to device specific instructions (or?).
Is there a faster way than Modbus to communicate the axis position to an external PLC in Mach3/4 (without adding encoders)?

Pietro
Re: Synchronized I/Os over Modbus (?)
« Reply #4 on: February 13, 2020, 11:08:09 PM »
Hi,
firstly Mach4Hobby DOES have all six OB axes and yes they are step/direction. If you require plain on/off outputs for your nozzles then you need not
use OB axes at all. Mach (3 or 4) has plenty of digital outputs.

Quote
Is there a faster way than Modbus to communicate the axis position to an external PLC in Mach3/4 (without adding encoders)?

No. Part of the issue is that Mach (3 or 4), in fact ALL Windows PC CNC solutions, have a motion buffer. Thus Mach may have issued
trajectory data but will not be enacted for some variable time later, thus at any given time mach does not know precisely where the machine
is, it knows where it will be a time slice nnnnn.mm but not right now.

The second part of the issue is that Modbus is a serial communication protocol and a fairly slow one at that. Any sense of simultaneity
between signals is lost.

Using Brains (in Mach3) or equivalently PMC (in Mach4) allows much tighter control, possibly within milliseconds.

Craig
My wife left with my best friend...
     and I miss him!

Offline TPS

*
  •  1,487 1,487
    • View Profile
Re: Synchronized I/Os over Modbus (?)
« Reply #5 on: February 14, 2020, 01:53:55 AM »
just a thought, maybe i am thinking to easy.
why not turning the nozzles on/off by customized M call's

for example:

G1 X10 F100
M200 'turn nozzle 1 ON
G1 X20
M201 'turn nozzle 1 OFF


anything is possible, just try it.
if you find some mistakes, in my bad bavarian english,they are yours.
Re: Synchronized I/Os over Modbus (?)
« Reply #6 on: February 15, 2020, 04:44:13 AM »
Quote
firstly Mach4Hobby DOES have all six OB axes and yes they are step/direction

I didn't check personally, but here https://www.machsupport.com/wp-content/uploads/2014/06/Mach%20Version%20Differences_doc_a9.pdf it says 1 OB for hobby, 6 for industrial.

In any case, thanks for your support. I'll check further the macro approach, but I think the most straightforward way is indeed to plug in a few encoders and start from there.

Pietro
Re: Synchronized I/Os over Modbus (?)
« Reply #7 on: February 15, 2020, 04:49:39 AM »
Hi,
that link is out of date, Mach4Hobby has six OB axes.

Craig
My wife left with my best friend...
     and I miss him!