Hello Guest it is March 28, 2024, 12:34:54 PM

Author Topic: How to resume after G code is stopped safely - problem  (Read 10767 times)

0 Members and 1 Guest are viewing this topic.

Re: How to resume after G code is stopped safely - problem
« Reply #40 on: January 23, 2018, 01:22:28 PM »
I would not go lower than 20, I think mine is on 100 IIRC, a setting of 3 could upset the trajectory planner i reckon.

Well I do not know nothing about that how it works, hope somebody will explain .

AS I understand it....

Inside Mach (and probably all CNC controllers) there is a thing called the trajectory planner - its responsible for calculating the deceleration and acceleration for constant velocity (CV) moves as the code runs, amongst other things, probably works out radii from different input as well and so on - it plans the trajectory of the tool path on the machine.

The planner does its calculations and feeds the results into the code buffer, this is like a safety net so the machine can keep running smoothly - if the buffer empties on the job, you get a "Buffer Underrun" and the motion will stop or stall for an amount of time until there is sufficient code to make more moves - this is ALWAYS a bad thing and will make a mess.

Now, to stop an underrun Mach has to work in front of where the machine currently is - it takes time to do its calculations - measurable time, so to stop a risk of under run as well as correctly plan the trajectory, Mach has to "Look Ahead" a set amount of code lines - the look ahead setting. Its really not that vital now as PC's are pretty damn fast these days and 20 lines ahead seems ok, mine is 100 but i cant recall why now.

You can force an underrun if you like, just use the PC for something like a screen-saver or anything that will divert processor cycles away from Mach3's intensive use and your machine will stall and stutter like hell - this is why we use bare-bones setups for running Mach3. There is a very fine line between OK and underrun and it takes little to upset it, setting the look ahead too short will make it worse. If using the parallel port things get even tighter as the PC has to generate millions of stepper pulses and control the LPT port as well as updating the user interface - DRO's and the path indicator etc

Mach3 is a brilliant bit of software and i'm glad i have access to it really.


An analogy (of sorts) - the trajectory planner in a racing car - the drivers brain.

You are driving along and see a corner, you have no trajectory planner, so you drive to the corner and either take it at full speed (CV) or stop then take the corner (exact stop) - chances are you will crash with taking it at full speed and exact stop will annoy other racers as you stop and then turn.

Now, with the trajectory planner installed in your head, your eyes give it "look-ahead" - you can see the corner approaching a way off, your brain assesses a safe speed in which to take the corner, you slow in time (decelerate), take the corner and then accelerate away at feed-rate again.

The buffer kind of lets you see the next corner and the one after it.

thx for posting