20 seconds by cncdivi
Here is the third installment of our Ultimate Benchtop CNC Mini Mill design series. The first part focused on the choice of the Donor Mill, while the second part dealt with the selection of your CNC mechanical components, specifically leadscrews, ballnuts, motor mounts, and the drive system. In this third part, we’ll delve into the hotly debated topic of Closed Loop vs Open Loop (steppers vs servos).
Introduction: Lots of Choices
The first thing to note about this segment of our DIY CNC Mill Design Series is that there are a LOT of choices around how to drive the ball screws for your machine’s axes. In the interest of brevity, we’re not going to dive into every single nook and cranny of this complex world. I want to touch on the most important questions over the course of this article and the next one:
– Open Loop vs Closed Loop
– Motor Type
– Motor Sizing
– High-End Options aka What Would the Pros Do?
– What’s Best for Beginners?
That’ll give you a lot of data with which to start doing the research around your own project so you can decide on a price performance basis what will work best for you. In this article, we’ll focus on Open Loop vs Closed Loop. For the next article, we will focus on Motor Sizing and Choices.
Servos vs Steppers (Closed vs Open Loop?)
Let’s jump right into an area that has been controversial among hobbyists forever, but that is not controversial at all for pros. I’m talking about the choice between using servos or stepper motors to drive your axes. This might more properly be referred to as a choice between open loop (steppers) and closed loop (servos, or steppers with encoder feedback). Each piece governs a bit different aspect of the question–open versus closed loop and motor type are the two pieces. It’s important to keep the two pieces separate lest things become confusing. For example, we often say “servos vs steppers”, but then how do we refer to a stepper motor with encoder feedback? That’s why I prefer to keep the issue of close loop vs open loop and motor type separate.
Open Loop vs Closed Loop
Let’s start with the question of whether there is a feedback loop. The vast majority of hobby-class CNC has no feedback loop, hence it is an “Open Loop”. The vast majority of pro-class CNC is Closed Loop, and has that feedback loop. A feedback loop implies there is a sensor of some kind that tells the drive and/or the controller software how much the motor moves. Typically, that sensor is a rotary encoder based on an optical disk that goes on the motor shaft and often appears integral to the motor. The photo at the top right shows the Y-Axis drive motor for my IH Mill. The box at the closest end of the black motor houses the encoder.
If you pop the cover off an optical encoder it looks something like this inside:
Inside an Optical Shaft Encoder…
You can clearly see the little glass disk that spins with the motor and allows the encoder to measure how much the motor has moved via the optical sensor in the brown housing. BTW, it’s important to note that while there are absolute position encoders, that can tell exactly what position a motor’s shaft is in, the encoders commonly used with CNC servos only care about relative motion.
How does it help to know the motor’s relative motion?
Understanding how it helps to know the motor’s relative motion is really the heart of the Open Loop vs Closed Loop discussion. For starter’s the motor controller can use the information to do a better job controlling the motor. It can create an extremely broad and very flat torque curve, much broader and flatter than an open loop system, for example. What’s more important is what this knowledge can do at a higher level.
As your g-code commands your CNC to cause the cutter to trace a path over the workpiece, a lot is going on. The cutter is accelerating and decelerating constantly. It’s doing that in the face of wildly varying resistance to its motion, and the motor has to generate enough force to overcome that resistance. The encoder helps generate more torque at very slow speeds, which is a good thing, but it also helps discover when the motor has fallen behind where it should have been. It will come as a surprise to many, but the motor may not, and in fact often does not exactly track the motion that is commanded of it. Any time the force required to stay on track is more than the motor can produce, it falls behind.
With a closed loop system, the amount by which the motor has fallen behind is called the following error. The closed loop system will attempt to catch up to the desired location the next time it has more force available than is required. If the following error becomes too large, the system will fault. That typically means an alarm and the system stops. Most of the time, the machine will catch up and there will be no fault. This means you can expect the cut that was made to have been accurate within the limits of the following error, which is a good thing. What’s particularly good is that the limit was verified because the closed loop system monitored the encoder feedback to make sure the job got done.
Now there are big tables of pros and cons available on the stepper versus servo controversy that talk about things like rpm ranges and torque limits and so on. They’re interesting, but for me, I think they miss the point relative to what’s happening with Following Error. Yeah sure, there is a certain size of machine that really should always run with servos. There may be a certain (small) size of machine that is maybe always better off with steppers. This all based on rpm and torque. But all machines are affected by Following Errors and it’s important to think about what that might mean for your machine too.
What causes following errors?
As mentioned, following errors happen when the motor can’t provide enough force to perform the commanded motion. There are a variety of pretty common cases where this can happen:
– Required feedrate is not available given the acceleration limits of the machine. It’s not the best practice, but it’s not uncommon for low-end CAM software to produce a corner that requires the tool to be going one direction and then immediately change direction, perhaps at a right angle. Better CAM packages will put a small radius instead of an abrupt change. Whether you include the radius in the g-code or not, your machine is very likely going to turn that corner with a radius beacause it has to stop the cutter from moving in one direction and make it move at the required feedrate in another direction. Without a radius, it is called upon to do that instantaneously, which just isn’t possible. To make matters worse, going into a corner means the cutting forces shoot up very suddenly, typically going to 2X what they were before the cutter entered the corner. Avoiding such sudden increases is one reason why HSM toolpaths can go so much faster.
– Stick Slip: My mill has dovetail ways. One characteristic of these ways versus ball bearing linear guides is something called “Stick-Slip.” If you remember your High School or College physics, you’ll know that the coefficient of friction is higher for two stationary surfaces and that it drops once the surfaces are moving relative to one another. That initial stickiness is what happens when we try to start a machine axis moving from a dead stop. On my IH mill, I used to notice a fair number of servo faults when I was trying to do a touch-off by jogging an axis 0.001″ at a time. That’s because those little short moves were suffering the worst kind of stick-slip (sometimes referred to as “sticktion”). What made a big difference for this problem was when I added a way oiler to the machine. I still see the problem if I walk up to the machine and try to use without pumping the way oiler a few times first, but if the ways are kept properly oiled, it happens a lot less.
– Way Adjustment: They say you should adjust the gibs on a CNC machine such as we’re talking about quarterly. They need adjustment due to wear and due to the temperature changes of the different seasons and how the expansion and contraction of the metal in the ways affects their ability to slide. I can tell you from experience there is enough difference here that when the ways are fairly far out of adjustment, I get servo faults and know it’s time to do some adjusting.
– Too much acceleration or too fast rapids: This is related to the first one, but I mention it again because of a different cause. With a DIY CNC, you’ll be specifying how much acceleration the control can expect to use in its trajectory planner. This turns out to be a little bit like overclocking your PC. If you’ve done either one, you’ll discover that there are acceleration settings (or overclocking settings) where things seem to work pretty well. Yet under some circumstances that are not altogether obvious, you get servo faults (or with overclocking usually the famous blue screen of death as the PC crashes). The only solution is to back off the acceleration and try again until things are more reliable. Accleration is the most sensitive thing to adjust, but you get the same effect from setting the maximum rapids. You can be a little too fast and things work great most of the time, but every now and again you get a fault. I had to drop my initial speeds from 165 IPM to about 120 IPM before the machine was dead reliable.
– Crashes: Imagining you’re trucking along with your facemill and all of a sudden you hit something that amounts to a crash. Things get a lot slower. The forces required to keep that facemill moving go way up. If you’re lucky, you get a fault and the machine stops before you have cause too much damage. You can’t count on a fault to save you from light crashes, but they help to reduce the mayhem caused by really bad crashes.
– Noise: Electrical noise on the encoder lines back to the drive can signal a false following error. I bring this up because noise is something the would-be user of a Closed Loop system needs to be aware of and needs to have a plan to deal with.
There are probably other kinds of circumstances that will trigger faults, but you get the idea of the sort of thing that’s going on.
Lost Steps: Open Loop’s Achilles Heel
If your machine is Open Loop, and the vast majority of hobby systems are, you will experience Lost Steps. I’ve heard a lot of explanations why you shouldn’t care about lost steps. Let’s talk about the two most common ones:
Steppers make a distinctive noise when they’re losing steps so you know whenever it’s happening.
They do make a distinctive noise, the question is whether you will hear it. Consider my example of the stick slip. You’re jogging the axis along 0.001″ at a time for a touch off. Any noise being made is extremely short at best. Was that a lost step? Am I hearing things? There’s no way. It might not matter. If you’re touching off, you’re presumably going to zero your DRO’s when you get the touch off done. If steps were missed in jogging, that doesn’t matter. But let’s ask a different question. Lots of CADCAM simulates curves with lots of tiny steps. Can we inadvertently trigger a stick-slip lost step that way? Depends. For something very intricate, when you first start the axis moving, or if the axis is moving particularly slow, yes, you can.
The question about hearing it will have to do with what else is going on in your shop. Is it a noisy environment? Are you off doing something else while you machine works and you’re mind isn’t really focused on the sound of the steppers? Is there more than one machine with steppers? You begin to see why the professionals favor servos rather than manually monitoring their stepper-based machines for lost steps.
A properly designed stepper system doesn’t lose steps.
My goodness I hear this a lot from the stepper lovers. Personally, I think it is horse hockey. Go back over my list of servo fault causes and you’d have to do a lot to head all of them off at the pass. Just a few to get started:
– Use a CAM program that only generates very high quality toolpaths and never push those paths anywhere close to the limit. BTW, you do know where that limit is, don’t you? It will differ with every design and DIY’ers don’t generally have data available like the acceleration capabilities of their machines.
– Use an automatic way oiler. I think this is important even with servos, so by all means, put this one fairly high up on your list.
– Guarantee your machine’s ways are finely hand scraped or ball bearing linear slides that have nearly the same friction at every point on their travel.
– Adjust your ways frequently and after every climate change in your area. Or, make sure your machine is in a temperature controlled shop or use ball bearing linear guides.
– Spend a lot of time adjusting your machine for very conservative accleration and rapids. What’s needed is probably a lot slower than you’d think. Also, since you don’t have encoders to detect faults, you’ll have to think about putting together some tests to know whether you’re missing a step every now and then or not.
That list could probably go on for quite a ways. To the proposition that a properly designed machine doesn’t lose steps I will usually respond that there are no properly designed machines coming out of DIY CNC efforts. There are probably precious few coming out of manufacturers as well if the criteria is machines that never ever lose steps. The only real way to “properly design” an open loop system so that it doesn’t lose steps is to be incredibly conservative in that design. Consider using a torque reserve of at least 50% more than what you might otherwise require with a closed loop system, for example.
I’m not trying to be overly hard on steppers, I am just pointing out their limitations and some ways of getting around those limitations. As we will shortly see, I recommend steppers for beginners who’ve never done a conversion before as the only way to go.
Just keep in mind that particularly if you want to use your machine to produce a lot of parts, you’re going to find steppers can be problematic for reliability unless they’re used extremely conservatively. The most common thing one hears from shops with both kinds of machines is that if they want to run the stepper machine all day long they have to check the parts frequently throughout the day to see if steps have been lost and tolerances are drifting.
One thing to consider for a stepper-based machine: if you have an accurate set of home switches, rehoming the machine after each part can recapture the lost steps positionally and ensure the next part is good. Losing a step or two here or there is usually okay. It’s the build up of lost steps all day long making lots of parts that creates problems. If you can’t rely on homing to clean it up, you’ll need to inspect your parts frequently. How frequently? This can be learned from experience. If it was me, I’d probably try monitoring hourly for a few hours then increase to every 2 hours, and so on until I was getting all the parts off within tolerance. Incidentally, for really tight work, you have to do the same with a closed loop servo system. As in so many things, it isn’t black and white, we’re talking about matters of degree.
Taking the Loop Back to the Controller or Just the Driver
Sometimes I hear the argument that there’s no point in using a closed loop system with control software like Mach3 because the feedback loop isn’t taken all the way back to the control. Let’s drill down on what that means and see if the proposition that closed loop doesn’t matter for Mach3 and similar software holds water.
When the loop isn’t closed back to the controller, it means the controller is not aware of what the encoder is reporting. The drive, however, is still getting that information. What that means is that the drive can still fault if the following error becomes too great and report that fault back to the controller. The drive can also attempt to catch up to the desired position if it finds itself with excess force available before the following error becomes too great. In other words, a great deal of the closed loop advantage is still available even though the loop doesn’t go all the way back to the controller. In fact, all of the problems we have discussed so far that closed loop solves are still solved.
So what is missing when the Feedback Loop is taken all the way back to the controller?
It turns out there are a number of clever tricks tricks the controller can perform when the loop is closed back to the controller:
– It can use the information to synchronize axes. When the feedback loop goes to the servo drive, that is sufficient to deal with following error, but unless the information reaches the other drives somehow, they’re still in the dark. The role of the controller is to synchronize this information across axes. The most common reason to synchronize the information is to perform an operation such as rigid tapping. When you can carry the loop back to the controller, you can perform rigid tapping. When the loop stops with the servo drive, rigid tapping is not possible.
– It can use the information in conjunction with home/limit switches for more accuracy. Think of the encoder as providing more digits of accuracy. All the home switch has to do is get within one encoder revolution. Final home involves getting the encoder itself to a home position, and the encoder measures to a tiny fraction of a single rotation. This is how nearly all commercial VMC’s and CNC Turning Centers establish their home positions in a way that is far more accurate than switches alone.
– After a servo fault, the machine’s position is known and recovery from the fault can be simpler. Without closing the loop to the controller, the exact amount of the following error is not know to the controller, so the machine has to be re-homed or the part re-zeroed to establish position again. This is a time savings not possible unless the loop is closed all the way back to the controller.
– Glass Scale functions: High end machines will often add glass scales, the same kind that are found on manual machine DRO’s, to the rotary encoders. Such scales tell the machine exactly what the actual axis position is. This is often an expensive option, but it can greatly increase the accuracy of a machine. Because the glass scale is measuring the actual position of the axis, and not just the ballscrew shaft, it can compensate for thermal expansion, errors in the leadscrew thread, errors in the timing belt system driving the ballscrew, backlash, and so on. There are complications associated with doing this. For example, these scales typically cannot be read fast enough that they can substitute for the rotary encoders, so the control system needs both kinds of sensors and the glass scales are only used at various test points during a commanded move. Since there are two sensors, sophisticated software is needed to be sure the two don’t “fight” with each other over the motor control causing oscillations and other undesirable behavior. The vast majority of commercial CNC machines do not have glass scales due to the extra cost and complexity, so we’ll rule them out of a hobby class system, even an “ultimate” hobby class system up front. That’s not to say it is impossible, just that it’s starting to get into some very rarified air and there are likely other problems to be solved before the weak link in a machine is any lack of glass scales. As an aside, you can install a set of glass scales and use them to map your leadscrews and then provide a compensation map back to your control software. This will improve your accuracy and can be helpful, if a lot of work to deal with on a one-time basis.
By now you’re getting an idea of what kinds of limitations not closing the loop all the way back to the controller brings. The most important advantages of Closed Loop are preserved even just closing the loop back to the drive. What’s left is certainly nice to have, but not necessarily make-or-break, especially on a hobby class machine.
Closed Loop Steppers: Hybrid Choice
Before I move on from the subject of Closed Loop versus Open Loop systems, I want to touch on the hybrid choice that uses both Steppers and Encoders to create a closed-loop stepper-based system. Closed loop steppers are a relatively recent development for the DIY market, although they’ve been talked about since the mid-2000’s. They offer the prospect of delivering the advantages of the servo world using lower cost steppers. I had one manufacturer of stepper-based CNC machines tell me their tests had shown the best bang for the buck was the hybrid closed loop stepper with respect to the cost of delivering a given amount of torque with a closed loop system. That sounds very promising indeed for DIY CNC machines. Compared to traditional servos, closed loop steppers offer higher torque at low rpms and lower costs. Above about 500 rpm, the traditional servo can produce more torque. Being able to generate more torque at higher rpms may be important to your application. Refer back to Part 2 of our series for more discussion on matching the motor’s torque peak to the drive ratios and intended travel speeds of your CNC.
Conclusion: Beginner and Pro Choices
So which method should we choose for our hypothetical DIY CNC project?
1. Open Loop Stepper
2. Closed Loop Stepper
3. Closed Loop Servo
The choice should be based on your experience level and the desired performance characteristics of the system as well as your budget.
For beginners, I recommend starting with an Open Loop Stepper based system. The reason is simplicity. With Closed Loop systems, there is a fair amount of additional complexity involved. You’ll need to deal with the encoder and it’s attendant wiring. You may also need additional electronics to deal with handling the servo fault condition with control software like Mach3. The signal levels involved with the encoders are low compared to the potential for noise from the motor control wiring and other sources. This can lead to problems you’ll have to troubleshoot. In my own servo-driven IH Mill project, I made sure to use shielded cables for the encoders, and I ran the cables to they weren’t near the servo power cables, but I still had noise problems. The problems were ultimately fixed by adding a bypass capacitor to the US Digital encoders on my servos (search “HEDS” in this link for more info), but I would never have guessed that if Mariss Friemaniss hadn’t run a post on CNCZone at about the same time talking about how susceptible to noise these particular servos were. Lastly, you will have to deal with servo tuning, which is another new thing to learn about that can be complex, require special tools like an oscilloscope, and generally be frustrating to a beginner (I lived through it and tell how in this link). If you’ve never done a CNC conversion, Closed Loop can add a lot of additional complexity. Most hobby class machines use Open Loop Steppers, and with the caveats and limitations I have mentioned, they work well.
On the other hand, if you have some experience with CNC and you’re determined to get as much performance and capability as possible, you should consider a Closed Loop system. It’s going to be more costly, but it will also perform better, and once you’ve worked the bugs out, it will be more reliable (no lost steps). You will need to decide whether to use a Closed Loop Stepper or Servo-based system. I would base that decision on a few factors. One will be your research and how comfortable you are with the sources for such drives and motors. Two will be the rpm requirements of your application. Some applications require fairly high rpms and are better done using servos than steppers. Three, and this is an important one I always recommend, will be the ecosystem available to support your efforts. By “ecosystem”, I mean whether you can find an active online community of others using the components you’ve chosen who can help you with your troubleshooting. There’s a lot of folks over on CNCZone using Geckodrives, for example. Should you be well-heeled enough to be choosing Fanuc components (just by a VMC if you are for crying out loud, LOL!), there is a large community there too. Look for the presence of such a community and ask questions before you make your purchases. You won’t be sorry!
One last thing. This article series is about DIY CNC mills. Other kinds of CNC machines have different requirements. I wouldn’t bother with Closed Loop on a plasma table, for example. The accuracy requirements are so much less that you can afford to lose a tremendous number of steps before there are problems with a plasma table. A woodworking-only CNC Router needs more accuracy, but can probably still get by in most cases without Closed Loop.
Our next article will talk about different motor types and how to size the motors for your project.
Like what you read on CNCCookbook?
Join 100,000+ CNC'ers! Get our latest blog posts delivered straight to your email inbox once a week for free. Plus, we’ll give you access to some great CNC reference materials including:
- Our Big List of over 200 CNC Tips and Techniques
- Our Free GCode Programming Basics Course
- And more!
Just enter your name and email address below:
100% Privacy: We will never Spam you!
Bob is responsible for the development and implementation of the popular G-Wizard CNC Software. Bob is also the founder of CNCCookbook, the largest CNC-related blog on the Internet.