Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: ryanosman on April 10, 2007, 06:41:00 PM

Title: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 10, 2007, 06:41:00 PM
This code creates one fluid movement:
G01 x1
G01 x2
G01 x3
G01 x4
Great.

This code creates 4 acceled/decelled movements with no pauses:
G00 x1
G00 x2
G00 x3
G00 x4
Well, one could manifest a reason for why you wouldn't want constant velocity with G00 commands, I would disagree, but I can live with it.

But THIS code creates 4 accelled decelled movements with a PAUSE between each segment:
G00 x1
G01 x2
G00 x3
G01 x4
Don't understand it, and it's majorly slowing down my file, because my cam package sometimes draws an object as many lines, tangent end to end, so it goes to safe Z between each one.

Hopefully I'm just doing something wrong, but I've looked everywhere twice. I would prefer it if each of the above 3 samples created one fluid movement.

Thanks for any help you can offer.

-Ryan.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Chaoticone on April 10, 2007, 06:55:47 PM
The last bit does that because you have a rapid G0 then a feed G1 then rapid G0 then feed G1. It is going to move you z each time it sees a rapid. Things can be done to eliminat this but it is not advised. Also your code should be G0 or G1, not G00 or G01. If you want smmoth motion at full speed just give it some code with a feed in it that is equal to your max speed.
Something like this.
G0 X0Y0Z0
G1 X2Y2 F 100 (insted of 100, out your max speed)
G1 Z2 F 100
G1 X0Y0 F 100

Brett
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 10, 2007, 07:12:00 PM
Hey!... Thanks for the quick reply.
Quote
The last bit does that because you have a rapid G0 then a feed G1 then rapid G0 then feed G1. It is going to move you z each time it sees a rapid.
Yes I know, but why is there a PAUSE between them... Like for a third of a second. I didn't ask for that?  ???
Quote
Also your code should be G0 or G1, not G00 or G01.
Huh? I think popular opinion on the interweb disagrees with you. :-\ Not that it matters I guess.
Quote
If you want smmoth motion at full speed just give it some code with a feed in it that is equal to your max speed.
But it's not me that's generating the thousands of lines of Gcode, it's the CAM program. :o I'm not about to start coding by hand. But the point here is that it's not my mistake. There should be no stops unless I ask for them.
But again, I sincerely appreciate your suggestions.

Anyone else?

Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Chaoticone on April 10, 2007, 08:20:08 PM
How long have you been running CNC equipment? Your post processor could be tweaked I'm sure.

Brett
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 11, 2007, 11:27:32 AM
    Sounds like you're questioning my compotence? But why would someone of a thousand posts do that? I built my first CNC machine around 1990, and wrote the software to control it on a first generation commodore amiga. Since then, I've had many different machines and operating scenarios which we have used every day in our business which is designing and manufacturing custom electronic based equipment.

Back to the subject...

I find Mach3 to be a brilliant piece of work, well worth the money. I've noticed that it adds delays where it seems to me that there shouldn't be any. I thought it would be helpful to point it out in case anyone on the development team wants to look into it.

Thanks!
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Chaoticone on April 11, 2007, 12:37:33 PM
Quote
Sounds like you're questioning my compotence? But why would someone of a thousand posts do that?

Sounds like you're getting rude. But why would someone of 3 posts do that?

Back to the subject.......

The reason I ask is because I have never heard of that being preferred. I use two cam packages and neither one generates code like that. Maybe they should, I don't know. Are you running the code on a machine or just simulating? If you are simulating, did you install the drivers for Mach? Have you tried the code I posted? Did it help? Are the dros pausing as well or does it seem like it is pausing because the accel rates are set very low in your motor tuning?

Just trying to help
Brett

 


Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 11, 2007, 01:24:28 PM
Are you using exact stop mode? Also why does it go to safe Z between a G0 and G1?

Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 11, 2007, 04:12:33 PM
There is a noticeable delay going from g0 to g1 or g1 to g0. It isn't there going from g0 to g0 or g1 to g1. If you like, try it & you'll see what I'm talking about.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 11, 2007, 04:24:57 PM
I am not at my mill, I am at the home computer but I definitely dont get a delay if for example I do the following
G0 x2
G1 Y2F10
G0X4
G1Y0F10


I cant say whether I get a delay if I am going from a G0 to  a G1 on the same axis but I will test out tomorrow.
I still dont understand why going from a G0 to a G1 move your machine goes to safe Z, mine doesnt and I have safe Z enabled.

The only reason I could see that you would have a delay in between a G0 and G1 would be that maybe in exact stop mode it would pause slightly.
 Not sure how the read ahead would affect things, ie if you had the read ahead set to 0 then possibly that would cause a delay?

What feeds are your G1 moves at and what is the rapid of your machine?

Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 11, 2007, 06:29:34 PM
Try my example. cv or exact stop doesn't matter. Maybe it will be different on yours, but I've tried 2 PCs here, both about 1.7Ghz. This example is all the same axis so that the delay is more noticeable.

F100
(accel decelled moves:)
g0 x1
x2
x3
x4
x5
(one fluid movement:)
g1 x4
x3
x2
x1
x0
(now with pauses:)
g0 x1
g1 x2
g0 x3
g1 x4
g0 x5

When I use the term safe z, I may be using it in an inappropriate way. To be honest, I haven't looked into the safez options in mach3... I am using it to mean any movements on my mill that are made at a high level to clear the work area Here's an example to explain what I mean (typed in off the top of my head so I hope I get it right heh heh):

(engrave a square on lamacoid.)
f100
g0x0y0z0 ;initialize to known state
x1y1 ; go to first corner at rapid, 'safe z height'
z-1 ; drop engraving bit
g01 x2 ; draw bottom of square. There was a delay before this command.
g00 z0 ; this is the 'safe z' command that the cam program puts in. There was a slight delay before this command.
g00 z-1 ; it would take me a long time to remove these, plus sometimes they're needed, sometimes they're not. Mach should process these without delay anyway.
g01 y2 ; draw right side of square. There was a slight delay before this command.
g00 z0 ; go to safe z to move to beginning of next line. There was a slight delay before this command.
g00 z-1; (coincidentally, we are already here - no 'safe z' xy moves needed at this time)
g01 x1 ; draw top of square. There was a slight delay before this command.
g00 z0 ; go to safe z before moving to beginning of next line. There was a slight delay before this command.
g00 z-1
g01 y1 ; left side of square. There was a slight delay before this command.
g00 z0 ; There was a slight delay before this command.
x0y0 ; back home for something to do.

I suppose I should be clear about this too... I'll mention again I am talking about around 1/4 to 1/2 of a second of delay (haven't measured it). Doesn't sound like much, but in a gcode program with thousands of little segments, this can add up to a lot of extra time. Imagine a cnc machine emulating an artist with a sketch pencil & you'll get the idea.

*sigh* I was really hoping this would be a small, easy deal.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Graham Waterworth on April 11, 2007, 06:49:38 PM
Hi Ryan,

It looks to me that your cam system is wasting more time than the delays by putting all the unwanted Z moves in, get a better post or a better cam system and you will save time and money.

Graham.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 11, 2007, 07:08:46 PM
OK so its your code thats mopving to the "safe Z" so thats not a problem. Will test out in the morning on my mill and see if I get delays but I am almost certain I dont. Its late here so I am going to grab some sleep.
Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 12, 2007, 11:01:42 AM
Yes graham that's absolutely true. Maybe it's time I looked into that. Especially if this 'delay' thing doesn't get sorted out.

BTW hood, I really like your touch screen layout. Just discovering the whole customizable screen area of mach3... it's really, really satisfying!

-Ryan.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Brian Barker on April 12, 2007, 12:04:32 PM
Ryan,
We must stop after we do a rapid. and I don't think that the pause is as great as 1/3 of a sec... if it was that long I would be bitching about it! There are many problems that will happen if we start doing CV with the rapid moves :(

I think the pause is not as long with the G100... (I could be wrong)
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 12, 2007, 12:10:29 PM
Tested it out on my mill today and I dont even notice a pause, maybe my brain is just that slow that I dont pick it up ;)
Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 12, 2007, 03:10:17 PM
Okay I did some time tests. I have my machine set to 80 inches per minute, accell/decelling at 20 inches/sec/sec. When doing consecutive 1 inch G1 moves, my machine takes .73secs each 1inch move. That's the fastest condition. When I do consecutive G0 moves (with the stop between, but no pause). the machine takes .77 seconds each, so like I said, no cv on rapids is not a big deal. When I alternate G0 & G1, the machine takes 1.00 seconds per move. That means the delay is about 1/4 second.

But if it remains a mystery, I can just look for a smarter dxf->gcode converter. Lazycam doesn't seem too bad...?
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Brian Barker on April 12, 2007, 03:59:28 PM
Are you running a printer port?
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 12, 2007, 04:30:13 PM
yep. printer port -> 3 custom programmed micros -> 12 high current transistors (... and a whole bunch more junk...) -> 3 stepper motors.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Brian Barker on April 12, 2007, 04:58:59 PM
Could you please post an example file and we will have Hood test it on his setup

Thanks
Brian
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 12, 2007, 06:15:01 PM
This should do a quick & easy demonstration of what I'm seeing.

F100
g00 x0y0z0
(accel decelled moves:)
g0 x1
x2
x3
x4
x5
(one fluid movement:)
g1 x4
x3
x2
x1
x0
(now with pauses:)
g0 x1
g1 x2
g0 x3
g1 x4
g0 x5
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 12, 2007, 06:21:16 PM
You have a feed of 100 in your example yet you say your motors tuning is 80, am I reading this right?
Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 12, 2007, 06:59:07 PM
The F100 sets the feedrate to 100% of the maximum which is 80 inches per minute. Speed of G01 at F100 = speed of G0.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 12, 2007, 07:02:21 PM
Well no expert on code but F100 to me means go at 100IPM or in my case 100mm/min. As your motors are tuned at 80 they will only go at 80 but I am just wondering if that could cause a prob.
Will test out tomorrow in anycase.
Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Brian Barker on April 12, 2007, 07:13:56 PM
Could you please post you XML so I can have a look at your settings
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Graham Waterworth on April 13, 2007, 03:08:59 AM
A feed rate of F100 is 100inches /minute or 100mm/minute, if it worked as you say you could never work out thread pitches for tapping or any other type of pitch controlled work.

Graham.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 13, 2007, 05:22:43 PM
I've always had the F command implemented as a percentage of the maximum speed (guess that's what happens when you roll your own), and hadn't noticed the difference between 80 and 100 yet (I've had mach3 running for... oh... 3 days now). So actual velocity eh...so that's how the real world does it. OK.  :D
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 13, 2007, 07:05:30 PM
Just had a quick look at your xml. You sure you have your motor tuning correct  1875IPM for X and Y and 4687 for Z seems a little on the fast side ;)
Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: ryanosman on April 13, 2007, 07:11:05 PM
heh heh... sorry, that's the numbers from my desk PC where I have the speed cranked.. crap, sorry to waste your time. Here's the real xml.
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 13, 2007, 07:37:48 PM
No problem, was just thinking it must be a high speed machine ;)
 I notice you dont have limits set up. If your Home switches can be activated at either end of the travel you can use them as limits as well. When doing a homing move Mach will use them as Home switches, all other times it will see them as limits.
Dont see anything else wrong so far, well your use of Z home as pin 10, usually pin 10 is for the E-Stop button but that will depend on your breakout board and also how you choose to set things up so not really a concern.
 You might want to mess a bit with the velocity and acceleration as my mill has  accel of 40 so yours is half that and maybe that is where you are seeing the pauses from.
Hood
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Brian Barker on April 14, 2007, 09:43:42 PM
Part of your problem may be that you are at 800 steps per inch... this is very low and can make the system seem odd...

Other then that all is good and I see a very small pause but nothing that is very long at all.. You were saying 1/3 of  a sec. I am seeing about 1/10...
Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 15, 2007, 03:44:41 AM
This is weird, I was sure I had a post in here with the results of the test I did but its gone, I must be  100% crazy now, was only 99.9% before ;)
 I am going to search to make sure I didnt post it in another thread but basically the results I got was there was no difference in time from running a G1,G0 sequence and a G0,G0 sequence.
Hood

Title: Re: Unsolicited Pauses Between G00 and G01 Commands?
Post by: Hood on April 15, 2007, 03:51:16 AM
OK found it, I had posted in the wrong thread, guy must have been wondering WTF I was on about when I posted it in his thread  LOL. Well that settles it I am now 100% crazy :D
So here are the results I got a few days ago.

"OK test results
I ran similar code but did it metric as thats what my mill is set up at and what my head understands so it was easier for me to punch in.

First did
G0 X0 Y0 Z0
X25
X50
X75
X100
X125
and I get accell/decell as expected and  no pauses

Then
G0 X0 Y0 Z0
G1 X25 F2500
G0 X50
G1 X75 F2500
G0 X100
G1 X125 F2500
Same as first time, acell/decell and no pauses, also took exactly the same time as the first.

Lastly did
G0 X0 Y0 Z0
G1 X25 F2500
X50
X75
X100
X125

It ran continuous as expected as I am in CV."

Hood