585,722 active members*
4,211 visitors online*
Register for free
Login
IndustryArena Forum > Mechanical Engineering > Linear and Rotary Motion > How does a typical CNC machine control X-Y-Z position accurately?
Results 1 to 12 of 12
  1. #1
    Join Date
    Nov 2016
    Posts
    7

    How does a typical CNC machine control X-Y-Z position accurately?

    Hi all! I'm new to CNC machines, and have been searching the internet for details about how common (typical) CNC machines based on stepper motors control the x, y and z axis positions accurately. So far, I haven't yet found details that explain positional control.

    I realise that stepper motor shafts rotate, and the cutter moves along a straight (eg. ball-screw) shaft. However, sensors on general CNC machines only keep track of incremental steps of a stepper motor, but those incremental steps are not a one-to-one mapping in a linear direction along a shaft (such as a ball-screw shaft) right?

    So, in order for the CNC machine to have accurate linear position control along an axis, will it be necessary to know things like shaft diameter? And would the shaft need to be manufactured very accurately in order to have very constant diameter along the entire length of the shaft?

    What I don't understand at the moment is - how the incremental rotations of the stepper motor translate to a known (and accurate) linear increment along the shaft?

    Thanks for helping me out in advance!

  2. #2
    Join Date
    Mar 2003
    Posts
    35538

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    You tell the control software how many steps it takes to move one unit, and the software sends the appropriate amount of steps to the stepper drives.
    Gerry

    UCCNC 2017 Screenset
    http://www.thecncwoodworker.com/2017.html

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

    JointCAM - CNC Dovetails & Box Joints
    http://www.g-forcecnc.com/jointcam.html

    (Note: The opinions expressed in this post are my own and are not necessarily those of CNCzone and its management)

  3. #3
    Join Date
    Dec 2003
    Posts
    24220

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Quote Originally Posted by SouthPark View Post
    However, sensors on general CNC machines only keep track of incremental steps of a stepper motor, but those incremental steps are not a one-to-one mapping in a linear direction along a shaft (such as a ball-screw shaft) right?
    Yes it is. Albeit a ratio.
    With a servo, an encoder is used and a preset parameter in the controller records the amount of encoder pulses that equate to a certain degree of movement, it is known as the least input increment.
    In the case of a stepper motor that generally does not have any kind of feedback device such as an encoder, the degree of movement per step of the motor equates to a recorded degree of movement, for a CNC machine to provide accurate positioning, a ball screw etc has to be machined with precision in order to maintain and preserve accurate positioning resolution based on the least input increment parameter..
    Al.
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  4. #4
    Join Date
    May 2015
    Posts
    1422

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Stepper based systems are generally "open loop", ie there's no feedback at all.

    You tell the controller how many steps per mm or inch on that axis (call it A), and when you tell it to move X mm it moves A x X steps. Usually the assumption is that the leadscrew (be it ball or acme or rack and pinion or belt on toothed pulley) is linear and that A is constant throughout the travel, although some software eg Mach3 lets you tweak A at various spans along the axis.

    You find a starting point for A by dividing number of steps (microsteps if you use them) per revolution by the pitch of the screw. Eg a 5mm/turn screw with a 300 step/rev stepper will be 60 steps per mm. Obviously, if there's any reduction between stepper output and the leadscrew, you factor that in.

    But once that's done, normally you'd fine tune it by running "100mm", measuring how far it actually moved, and adjusting the step count accordingly. Or by touching off the ends of a known reference and adjusting by the measured amount. To account for nonlinearity you would do this at various points along the run of travel.

    And yeah: miss a step and all bets are off. You need to go to a known reference point - usually where the home switch is activated - and reset the internal counter to get back to the right spot. This, plus the fact that torque drops sharply with RPM on them, are the main reasons servos kick steppers' butts if you can afford them. Steppers with encoders can allow for skips but they still lack the torque at speed.

  5. #5
    Join Date
    Sep 2006
    Posts
    6463

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Hi....it all depends on the depth of your pocket as to what drive mechanism you employ.......rest assured that if you move an axis with an accurate pitch spaced mechanism and apply a number of incremental steps to the mover, whatever is attached to the mover will move an exact, or as near to dammit exact, distance along the mover be it a screw thread or rack and pinion etc..

    It's when you start to nit pick on assumed accuracy and want to get humungeously accurate travel that the cost factor and complexity comes in.......you won't ever achieve travel accuracy of hundredths of a MM along any threaded, screwed rod or other mover mechanisms over extended distances in the environment that most if not all CNC routers, mills and lathes exist in.

    So you can choose to move the axis with a definite incremental input or move the axis freely and stop it when a number of lines on an encoder tell you the position has been achieved, hoping that the encoder read head hasn't missed a line or two as it passes the lines on the encoder disc..

    Either way, the accuracy of the machine components will decide if the travel distance is what you want it to be.

    The only real way to get high accuracy is with glass scales etc that tell you where you are from the zero starting point to any position on the axis, not by how many steps you walk in the dark, and even then you are dependent on a temperature controlled environment to maintain the accuracy of the scale.
    Ian.

  6. #6
    Join Date
    Nov 2016
    Posts
    7

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Quote Originally Posted by ger21 View Post
    You tell the control software how many steps it takes to move one unit, and the software sends the appropriate amount of steps to the stepper drives.
    Thanks ger21! Thanks to you, Al, dharmic, and HW for helping me out. Today, I realised that I didn't have any idea how an open-loop CNC machine accurately controls position. After trying to think about it, I realised that I actually didn't know how the rotary incremental steps translated to a linear incremental step. Actually,.... not just an incremental step, but didn't understand how we work out the distance of each incremental linear step.

    From this thread, I now understand that the incremental step is determined by the "pitch". I still got to learn more about 'pitch'. But looks like if the 'pitch' is say 4 millimetre for a ball-screw shaft, then one full turn of a stepper translates to linear movement of 4 millimetre. And small portions of the 4 millimetre section are based on the number of steps that the stepper can handle. Eg.... if there's a 200 step stepper, then there's a resolution of 4 millimetre divided by 200.

    And error (uncertainty) for relatively long traveling distances will depend on the uncertainty in the stated "4 millimetre" value. If the 4 millimetre value is relatively accurate, and provided the motor doesn't skip a beat (or step), then the system should be able to control x, y and z position quite accurately over the usual area of coverage for small CNC machines. I'm talking about small house-hold CNC machines. Not industrial/elite/state-of-the-art ones.

    Thanks for explaining again ger21, Al, dharmic and HW! Thanks for sharing your knowledge. Greatly appreciated!

  7. #7
    Join Date
    Feb 2008
    Posts
    521

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Electronically, whether stepper or servo, the commanded movement is just a series of pulses and a machine will carry these out relentlessly, and in an ideal world, 1 turn of the motor will turn the screw 1 turn giving a 1:1 resolution but unless you spend money, that resolution is eaten away by mechanical tolerances present in ANY device. Practicality demands that the motor can be separated from the machine = 1st joint, motor needs coupling to screw = joints 2,3 and 4, then there is screw pitch error. Each of the joints adds an error to a single directional movement operation that can result in measurable errors - its called backlash. Hobbyists strive for minimal backlash usually with minimal resources whereas industry will eliminate or reduce it to minisule degrees by using the best mounts, couplings and precision screws/nuts to give repeatable sub micron error (or whatever tolerance they find acceptable) for the operation required.
    Nothing in life is free and certainly PRECISION COSTS!

  8. #8
    Join Date
    Aug 2004
    Posts
    780

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Typical accuracies are 2.5 microns, overall.
    Quoted by all modern machine tool builders.
    Haas specs are online.
    Standard ground ballscrews deliver this.

    It is quite unusual, about 1% of machines have secondary glass scales, for adjusting the position.
    Its typically a 18.000€ or more option on a VMC milling machine.

    The best screws can have accuracied in the 1 micron range, without glass scales.
    Even older manuals machines did this (SIP jig borers, Morse machine tools) to about 1 micron via better screws.

    Today, the glass scales are easier and cheaper than hyper-accurate screws.

  9. #9
    Join Date
    Feb 2008
    Posts
    521

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Glass scales are all well and good if utilised in full feedback mode but surely they are too slow for fast / accurate work? I just imagine a so equipped machine being commanded to move 100mm and the scale says it moved 99.999mm so it has to start and stop again for 0.001. What a faff! I think i'd prefer a tool / part to go exactly where I tell it too rather than have an after check and adjustment.

  10. #10
    Join Date
    Dec 2003
    Posts
    24220

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    With a servo system, the glass scale is incorporated into the PID feedback loop, to avoid any oscillation or dither if left out of this loop where a small backlash is present in the motor encoder.
    Both motor encoder and glass scale are part of the PID loop.
    There is an educational video on the subject and how the tuning is performed on the Galil Motion site by Dr Jacob Tal.
    Al.
    .
    CNC, Mechatronics Integration and Custom Machine Design

    “Logic will get you from A to B. Imagination will take you everywhere.”
    Albert E.

  11. #11
    Join Date
    Sep 2006
    Posts
    6463

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Hi...I think the quest for total and infinite accuracy of movement is one like looking for the Holy Grail.

    When you consider that the best ball screws are working in ambient temperatures that can range from sub zero to well over 30 deg C.....all idea of infinite accuracy over a distance is just pie in the sky......it's nice to read the blurb by the ball screw manufacturer for ground screw tolerances and resolutions, but outside of the manufacturers workshop anything goes.

    I think the question has been answered in that the accuracy of axis movement is in the pitch of the screw, rack or toothed belt pitch no matter what the encoder says.......the cost of each item indicates the lengths that the manufacturer's have gone to make them accurate........no one outside of the manufacturers work place has the ability or knowledge to test a ball screw etc for any accuracy at all.
    Ian.

  12. #12
    Join Date
    Feb 2009
    Posts
    6028

    Re: How does a typical CNC machine control X-Y-Z position accurately?

    Once you get in to high accuracy, no more ball screws. All the players in nano have gone linear motor with laser scales. Been that way for a decade now. All this means absolutely nothing if the machines not square.

    Sent from my A3-A20FHD using Tapatalk

Similar Threads

  1. position control & feedrate
    By ferdi_mcrohl in forum LinuxCNC (formerly EMC2)
    Replies: 2
    Last Post: 05-29-2010, 06:07 PM
  2. Typical feedrate old machine (router to plasma converting)
    By bobobo in forum Commercial CNC Wood Routers
    Replies: 0
    Last Post: 08-04-2009, 10:16 PM
  3. Typical text file to download for Bandit I Control
    By mrmikeman55 in forum DNC Problems and Solutions
    Replies: 11
    Last Post: 01-01-2008, 02:32 AM
  4. position module on 10T control
    By guhl in forum Fanuc
    Replies: 0
    Last Post: 11-30-2007, 09:38 AM
  5. Return to 12 oclock position accurately
    By djdesai_98 in forum Servo Drives
    Replies: 15
    Last Post: 09-13-2006, 11:24 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •