Hello Guest it is March 29, 2024, 01:29:04 AM

Author Topic: Using a modbus input in ports & pins  (Read 6783 times)

0 Members and 1 Guest are viewing this topic.

Using a modbus input in ports & pins
« on: February 29, 2008, 12:32:31 PM »
I am trying to use an X home limit from the PLC.  I would like to use it as part of the normal X home function, but I can't configure it appropriately in ports and pins.  Is it possible to add a modbus IO in ports and pins?
Re: Using a modbus input in ports & pins
« Reply #1 on: February 29, 2008, 08:13:23 PM »
I think the only way to do that is with a brain or maybe a VB script also.  But the brain is simpler here is a picture of what you need to do:
http://img516.imageshack.us/img516/5224/machbrainuh6.jpg

Add a ModBus input then a No-Operation lobe and terminate to a Mach3 X limit input.

If you have not used brains before watch the videos on the help page if you need more help just ask.
Re: Using a modbus input in ports & pins
« Reply #2 on: March 02, 2008, 11:00:49 PM »
I am trying to use an X home limit from the PLC.  I would like to use it as part of the normal X home function, but I can't configure it appropriately in ports and pins.  Is it possible to add a modbus IO in ports and pins?

Hi,

Home inputs from a PLC or other Modbus devices are not really suitable for use as home inputs for Mach3. The problem is that the fastest rate that Mach3 polls is about 25Hhz. That 40mS between reads not including delays in the PLC or Mach3. As this delay is variable, then your home position will also be variable. Not a good thing.

As for limit switches, it may be OK depending on the configuration of your machine and the type of switches used. If they allow overtravel it may be OK as they will handle the delay.

THe above comments apple to a serial bus controlled PLC. If you are using a TCP/IP controlled PLChe response may be better assuming Mach3 can poll it faster.

Cheers,

Peter.

----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com
Re: Using a modbus input in ports & pins
« Reply #3 on: March 04, 2008, 12:11:40 PM »
OK, the clock speed delay makes sense.  My dilema is that I need to perform a sequence of operations before I can home.  In this machine, the part to be cut is an 8' x 24' panel, and the panel moves.  What I want to do is drive the panel past the home sensor (left to right), clamp onto it, then use the stepper axis to back it up and find the home position.   Can I use a brain to drive the panel in, trip the home sensor, clamp it up, then trigger the "home axis" function?  That would be the easiest, then I can just rewire the one sensor directly into my breakout board.

Offline poppabear

*
  • *
  •  2,235 2,235
  • Briceville, TN, USA
    • View Profile
Re: Using a modbus input in ports & pins
« Reply #4 on: May 15, 2008, 10:56:14 AM »
From what you are saying, it would be better to make a custom VB macro to sequence you system.
as one option, Another is to do some hand shaking with the PLC, have it do part of the sequence, then notify mach,
then mach can home the system. Then your ready to go. If you PLC has a native "counter" function (like it can count One or Two channels off of your encouder A and/or B channel).
You could then have the PLC clamp and bring in your piece to a desired point. Then it would turn on a bit through the modbus/brain.
At that point the Brain seeing the bit active could terminate in a homing command. (or you could have Macro pump poll it eighter way).

scott
fun times
Re: Using a modbus input in ports & pins
« Reply #5 on: May 19, 2008, 10:42:09 PM »
I am trying to use an X home limit from the PLC.  I would like to use it as part of the normal X home function, but I can't configure it appropriately in ports and pins.  Is it possible to add a modbus IO in ports and pins?

Are you sure you want to use Modbus for a home input?

Lets say that you are using 25Hz update for you Modbus Comms. That's 40ms worse case between updates. How far can your axis move in that time?

You also need to know how often the PLC is checking the switch. I don't know what PLC you are using, but lets say that it checks the switch 100 times per second. If so thats a 10ms delay between checking. Worst case is thatthe PLC checks the switch just before the switch is activated. It has to wait another 10ms for the hit is detected. Now your maximum delay is up to 50ms

Worse still, the delay is not deterministic. Sometimes it will be 50ms, sometimes when all the planets are aligned it will be only a couple of ms. This means your home position will change and not be consistent.

PLC can be used for limit switches as a slight overrun and inaccuracy and be tolerated with the correct sort of switches (non contact), but you need to do your sums carefully for home switches.

Lets say that you approach the home switch at 20 ipm. That's;

 20/60= 333 thou per second

or 333/1000 = .333 thou per milli-second

So with a delay of 50ms your worst case error in your home position will be .333 *50 = 16.667 thou.


You need to decide whether this is an acceptable error for your machine and the type of work you are doing.

You could slow the speed that the axis approaches the home switch to 10 ipm. That will reduce your error to 8 thou.

Note this doesn't take into account any other errors in your system or delays in Mach.

If you are using the Macropump then that's another delay to take into account.

Cheers,

Peter.
----------------------------------------------------
Homann Designs
http://www.homanndesigns.com
email: peter at homanndesigns.com