Hello Guest it is May 19, 2019, 03:17:40 AM

Author Topic: mach's rounding of measurements?  (Read 8452 times)

0 Members and 1 Guest are viewing this topic.

Re: mach's rounding of measurements?
« Reply #20 on: April 24, 2010, 11:44:17 PM »
As I said, there are no fractional steps, so a move won't call for 352.7 steps.
Gerry, I worded my question badly.  I meant "if the distance called for scaled to 352.7 steps".  I realize that steps are a quantum measurement. :)

A move will call for a given distance. Mach3 will send as many steps are needed to reach that distance, without exceeding it, to the nearest full step.
OK, I won't dispute that since you say it is fact and fact is fact.  But I wonder why.  In my professional life I have worked with stepper-driven systems for almost 30 years now (many with relatively coarse timing belt drive) and the controlling firmware's criterion has always been "what step is the closest to the destination?" and not "what step is <= the destination?".  It is just a surprise to me that Mach adopts the latter criterion... [insert shrug emoticon here]

Randy


Why on earth do you care?  In the real world, it makes absolultely no difference whatsoever whether it rounds up, rounds down, truncates or anything else.  In any real machine, the inaccuracies of the machine itself vastly exceed any positioning error due to rounding.  The stepper motors are nowhere near that accurate, especially when micro-stepping, and especially when the machine is actually moving under any load whatsoever.  The flex in the machine, inaccuracies in the screws, runout in the pulleys/gear/whatever, and backlash (which is NEVER zero) will completely swamp any error due to rounding up or down by a single fractional step.  Worrying about this is truly picking the fly poop out of the pepper...

Regards,
Ray L.
Regards,
Ray L.
Re: mach's rounding of measurements?
« Reply #21 on: April 25, 2010, 12:17:12 AM »
Why on earth do you care?
The answer is contained in my question, Ray.  ;)

Randy

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: mach's rounding of measurements?
« Reply #22 on: April 27, 2010, 04:01:45 AM »
with the OP steps per, compare commanded moves to DRO readings.

g0 x1.0 -> 0.9994
g0 x2.0 -> 1.9987
g0 x3.0 -> 3.0006

conclusion: Mach moves as near as it can to the commanded position - under or over. Simples. :)

Cheers

Ian
Re: mach's rounding of measurements?
« Reply #23 on: April 27, 2010, 08:49:20 PM »
Mach moves as near as it can to the commanded position - under or over.
Ah, but there is so much more to it, Ian...  It is actually outside the realm of the original question, but multi-axis moves is where it gets interesting.  On linear moves, do you scale each axis independently, or deal with the dominant axis and have tests for the dependant axes on when to take a step?  And how do you deal with circular moves?  On the last system I was involved with, acceleration was handled with a lookup table.  Modern stepper motors all have a "knee" in their torque/velocity curves, and with an acceleration lookup table you can take advantage of the increased torque at lower speeds without overtaxing the motors above the knee.  It is those aspects in which I'm interested (I'm a mechanical engineer but very interested in all aspects of motion control so I know intelligently how to maximize system performance).  My familiarity with DIY CNC led to the adoption of the Allegro 3977 driver chip for several products at my last employer in preference to less integrated solutions...

Randy

Offline ger21

*
  • *
  •  6,231 6,231
    • View Profile
    • The CNC Woodworker
Re: mach's rounding of measurements?
« Reply #24 on: April 27, 2010, 09:11:35 PM »
Quote
On linear moves, do you scale each axis independently, or deal with the dominant axis and have tests for the dependant axes on when to take a step?  And how do you deal with circular moves

Each axis has a final destination position, so wouldn't Mach3 have each axis get as close to this position as possible, for each axis?
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: mach's rounding of measurements?
« Reply #25 on: April 27, 2010, 09:36:27 PM »
Each axis has a final destination position, so wouldn't Mach3 have each axis get as close to this position as possible, for each axis?
Possibly, Gerry.  I'm kind of a technology magpie.  I try to learn as much as possible on many different subjects.  I have read about displaying vector lines on a monitor (quantizing a theoretical vector line in two dimensions--not very different than running stepper motors).  The algorithm I read about stepped along the major axis of the line, and looked at the root-mean-squared distance of the two adjacent pixels on the minor axis to determine which to light up.  That is one reason I wonder if Mach is blindly stepping each axis, or calculating at each quantum of the major axis whether or not to step the minor axes...

Randy
« Last Edit: April 27, 2010, 09:53:19 PM by zephyr9900 »

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: mach's rounding of measurements?
« Reply #26 on: April 28, 2010, 04:39:52 AM »
Ah, but there is so much more to it, Ian...
LOL - hang on a cotton pickin' minute! I offered my answer to the question that was asked. I'm well aware there are all sorts of complexities with interpolated motion but that wasn't the question here.

It is actually outside the realm of the original question, but...
Too right...

...multi-axis moves is where it gets interesting.  On linear moves, do you scale each axis independently, or deal with the dominant axis and have tests for the dependant axes on when to take a step?
The latter

And how do you deal with circular moves?
The same way, but with the added complexity that the dominant axis changes (depending on the length of the arc) as the path progresses.

On the last system I was involved with, acceleration was handled with a lookup table.  Modern stepper motors all have a "knee" in their torque/velocity curves, and with an acceleration lookup table you can take advantage of the increased torque at lower speeds without overtaxing the motors above the knee.  It is those aspects in which I'm interested (I'm a mechanical engineer but very interested in all aspects of motion control so I know intelligently how to maximize system performance).  My familiarity with DIY CNC led to the adoption of the Allegro 3977 driver chip for several products at my last employer in preference to less integrated solutions...

Great - but this has nothing to do with the question that was asked - I'm all for a discussion on the nitty gritty of motion controller design for the fun and interest but if that's what we're going to do let's have a new thread - then at least we can all be clear on what the question is before we attempt to answer it. :)

Cheers

Ian
« Last Edit: April 28, 2010, 04:46:33 AM by stirling »
Re: mach's rounding of measurements?
« Reply #27 on: April 28, 2010, 11:53:00 AM »
Ian, too right.   :)

My thinking about the multi-axis moves came from the thought that in general, CNC moves are not Etch-A-Sketch-like X-Y-X-Y-X-Y and that

G1X5.
G1Y1.

G1X5.Y1.

G2X5.Y1.R15.

will all go to the same point, but the Y move will be generated differently in each case.

And then I admit really diverging (though that did come from discussions with our firmware guy about short moves taking place entirely in accel-decel rather than hitting full speed as long moves do, but that of course will only affect the steps' timing and not thier number...)

But I will heed your good judgement and shut up now.  ;D

Randy

Offline stirling

*
  • *
  •  2,188 2,188
  • UK
    • View Profile
    • www.razordance.co.uk
Re: mach's rounding of measurements?
« Reply #28 on: April 28, 2010, 01:32:50 PM »
Hi Randy

You obviously want to get deep into this (and good for you) so why not take a look at Dr. Jack Bresenham's work. He was really the father, guru and all round smart egg when it came to this stuff (amongst other things he developed the first algorythms for the rasterized display of vector graphics for IBM). Take a look at his algorythms for interpolation of lines, circular arcs, elipses and gawd knows what else. Then if you really want to blow your mind - take a look at Driving Stepper Motors with Quadratic Equations (all about acceleration) which is based on more of his work. Have fun  ;D

Cheers

Ian

Offline BR549

*
  •  6,865 6,865
    • View Profile
Re: mach's rounding of measurements?
« Reply #29 on: April 29, 2010, 10:03:43 AM »
> Its remembered and done when it can do it..
>
> Think of it this way. A position counter of distance, where the
final output is a stepvalue, if the number of steps increases, a step
goes out, if it decreases, a reverse step is poutout..
>
> double movement = .000001;
> double totaldistance = totaldistance + movement
> totalsteps = (int) (totaldistance / stepsPermm);
>
> With this method, no step can ever be lost due to rounding..
>
> Thanks,
> Art
> www.artofcnc.ca
>
******************************************************************>
> Hi ART, I know we have had this converstion before but I am not
clear
> of the results( old age). WHat happens if Mach cannot make the
> commanded move with 1 step. Say the commanded move is .0001" and
the
> machine resolution is .001" per step. How is the differential
handled?
>
********************************************************************
>
> --- In mach1mach2cnc@yahoogroups.com, Art Fenerty <fenerty@>
wrote:
> >
> > Hi:
> >
> > No, mach wont skip anything. IT uses max number of decimals
> internally, but the DRO';s are set to display only 4. ( They can
be
> told to display 16).
> >
> > The DRO's though, are separate code. They dictate if the right
> number of pulses went out. If, at the end of a program, the axis
is
> wrong, but the DRO is right, then the machine lost pulses that
were
> sent. There can be no questions about it. In this case, where the
Z
> lost position ( it is usually the Z that does this on long 3d
> programs ) the Z aacel shoudl be turned down. Also, you migth
want to
> set a dir prechange of 5 or so in the motor tuning to make sure
its
> not a direction signal issue.
> > As a last report, try sherline mode in the ports & pins, this
> will limit you to 1/2 of the max velocity for any kernal speed,
but
> stretches the pulses out to a minimum of 40us. IF it doesnt lose
> then, the wiring shodul be checked for good coneection, or the
> optocouplers checked to see if they are too slow.
> >
> >
> > Thanks,
> > Art
> > www.artofcnc.ca