Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: simonk on March 07, 2011, 04:40:27 AM

Title: How to do something during G1 move
Post by: simonk on March 07, 2011, 04:40:27 AM
Hello!

I am wondering how to make CNC machine to do something during G1 move - like turning Spindle ON/OFF (M3/M5) or Coolant ON/OFF (M7/M9). I'm using these M codes (M3,M5,M7,M9) as general I/O pins (M3/M5 for adding/removing glue and M7/M9 for filling cylinder with glue).

I would like to move machine from coordinate Y800 to Y1000 with G1 move. But because of the reduced speed at the end and a slight delay in my system, i am getting too much glue on the surface on every change in direction. I cannot reduce or change the speed of adding glue digitally. So my idea is to switch off adding glue just before the end of the move - like at Y950. But is it possible without stopping in this coordinate?

The solution like this:

G1 Y800
G1 Y950
M5
G1 Y1000

is not working good, because CNC machine almost stops at Y950 and again i'm getting too much glue.

Thank for any advice!
best regards,
Simon


Title: Re: How to do something during G1 move
Post by: ostie01 on March 07, 2011, 07:36:31 AM
You probably use your own M code to dispense the glue and use a dwell time, that can be adjusted in Milli second.

Like G4 P100 to 100 Milli second.

Jeff
Title: Re: How to do something during G1 move
Post by: simonk on March 07, 2011, 11:45:41 AM
Thanks for reply!

No, I'm using these M-codes directly like this and is working as it should be:

M3 (to dispense glue)
G1 X100 Y200
M5 (to end)

Our motor controller controls CNC machine's three stepper motors and has a built-in two additional sockets for external devices (relay output). These two relays can be controlled directly with standard M codes (first as a Spindle and second as a Coolant). So instead of connecting spindle I have connected device for dispensing glue and it works just fine.
The problem is just, that we cannot stop dispensing glue during machine's movement. I can stop it when machine get to desired coordinates, but not let's say 1 second before the end of the move.
Title: Re: How to do something during G1 move
Post by: Graham Waterworth on March 07, 2011, 12:00:10 PM
why not try upping the feed rate on the last 50mm,  the only other way is to watch the distance to go dro with some VB code in the macropump and when the dro hits a set amount cut the glue feed.

Graham
Title: Re: How to do something during G1 move
Post by: simonk on March 08, 2011, 12:43:26 AM
Maybe I will try both ways as you suggested and than decide which is the best for our job.

Regards,
Simon
Title: Re: How to do something during G1 move
Post by: Tweakie.CNC on March 08, 2011, 03:00:36 AM
Simon,

Please report back on your findings and trials as I and no doubt others are interested in the outcome.

Thanks,

Tweakie.
Title: Re: How to do something during G1 move
Post by: simonk on March 10, 2011, 08:11:28 AM
I've find out that accelerations for all axis were set pretty low - 60 mm/s/s and the machine is capable of a lot more that that. I think this is the easiest and simplest solution for our problem.

Thanks again for all ideas,
Simon