Motion Control Boards Take Mach3 From Hobby Class to Industrial Grade, Part 2

Dec 24, 2011   //   by Bob Warfield   //   Blog, Products, Software, Techniques  //  10 Comments

Our first article in this series discussed how using Windows to solve all of the CNC Controller problem suffers because Windows is not a real time operating system. Simply put, if the task of sending motion control signals (step + direction pulses) to the motor driver hardware is interrupted, we have problems. Those signals get interrupted by a variety of distractions the machine may have ranging from other software running on the machine besides the CNC controller to energy saving software that kicks in to slow the processor to a variety of other issues.

What’s the impact of such problems?

Tormach has quantified the magnitude of these problems pretty nicely in one of their many excellent engineering articles. They use the Mach3-provided utility DRIVERTEST.EXE (comes with Mach3) to determine how stable a particular PC configuration is for driving a CNC machine.

Using DRIVERTEST.EXE, they measured performance of a 2.2 GHz Dell Optiplex 330. That machine exhibited an interrupt variation (variance from desired timing) of 14 microseconds. After substituting another computer that had a 2 microsecond variance, the machine went from being able to move the heavy Z-axis at 185 IPM to 245 IPM, graphic evidence of the amount of impact this sort of thing can have. Ironically, the machine with the 2 microsecond variance was actually a much slower CPU, it just had been more carefully configured to eliminate potential timing distractions.

Why so much faster?

Think about the delays in the pulse train as introducing large decelerations and accelerations into the motion of the axis. Whenever a step pulse is delayed, you get a big deceleration. When it shows up again, the axis must accelerate. This is tremendously wasteful of the motor’s torque, is far from ideal as a way to drive a cutter through material, and generally gums up the works.

Plan A: Can we eliminate the distractions for Windows through Software configuration?

One school holds that the best way to eliminate the distractions for Windows that leads to these timing variations is to strip down the machine and software to where there’s nothing left by the Mach3 control software and Windows. If we eliminate the possibility of other software introducing distractions, we greatly increase the reliability of the machine.

This approach works to a certain extent, but it is still not optimal when compared to hardware motion control boards and it limits the potential of the controller machine. Users wind up disconnecting their machines from the Internet and crippling them until they become little more than Mach3 appliances. That’s a shame when there are so many useful resources on the Internet, and so much other software you might like to run than just Mach3 on your shop machine.

Another problem, pointed out to me by Henrik Olsson (thanks Henrik!) is “jitter”. Suppose we have a Mach3 kernel frequency of 20 KHz. We are reminded to send pulses every 20 KHz, assuming nothing interferes with our timing (and as we have seen, interference is a real possibility). What if the motion we’re commanding requires 23 KHz instead of 20 KHz? The exact kernel frequency leads to a sort of “rounding off” or approximation of the pulses, because we can only send them to the accuracy of the kernel frequency. This causes subtle effects that for the most part are probably only of industry to industrial quality work, but they’re still an issue. Interestingly, EMC2, which uses a real-time modified Linux kernel to eliminate these “distraction” problems, runs at even lower kernel frequencies than Mach3 for a given machine, so is even more subject to jitter.

Still, if you insist on running through the parallel port, you should stick to a very minimal configuration for best results. You should also keep your axis motion dialed down fairly slow, so not very many pulses are needed to move the axes around.

Plan B: Add a Motion Control Board

The more direct solution is the one we brought up in the first article: add a Motion Control Board to Mach3. This offloads the most finicky timing aspects to dedicated hardware that can do a far better job than the software versions ever will. To get an idea, the pulse capabilities of a PC running Windows fall in the 20 KHz to 100Khz range. In other words, pulses for all axes cannot exceed 100,000 per second, and that’s under the best possible almost theoretical conditions.

The equivalent number for one of the cheaper Motion Control Boards, a Smoothstepper, is 4 MHz, or 4 million pulses per second. That’s 40x faster–no wonder you get so much better results!

Let’s play with the math a little bit and see what this means.

Suppose we want a positioning accuracy per step of one tenth, or 0.0001″. If we want to be able to move at 100 IPM, that means we need 100 / 0.0001 or 1 million pulses a minute. That’s about 16,000 pulses a second, theoretically its within Mach3′s range, but is it within the range of error if Windows gets distracted? 16 KHz yields a 60 microsecond pulse interval. On the aforementioned Dell that Tormach was testing, they saw 14 microsecond variations, or about 23%. That’s really too much for smooth accurate motion–we’d prefer to see more like a 5% variation or less.

It is fortunate indeed that this problem does not becomes additive with the number of axes in motion. To interpolate a hole requires 2 axes moving in concert. To do that at 100 IPM requires 2 x the pulserate. A really fancy 3D profiling job is even worse, because you may need 3 axes moving in concert. Mach3 is able to trigger up to 6 axes at once, so the number of axes doesn’t create additional problems in the pulser.

These problems get steadily worse as we ask for the axes to move faster. Consider a machine like a Haas TM-1. Rapids speeds for this inexpensive VMC are 200 IPM–2 times faster than our example. Now we’ll need a 32 KHz kernel speed instead of 16 KHz, which starts to be pretty hard to do with Mach3.

The Smoothstepper’s 4 MHz rate means it can handle that with 100,000 / 4,000,000 or 2.5% accuracy–that’s about right for an industrial grade application.

You Can See the Difference

I hope you’re getting the idea that these Motion Control boards can provide a noticeable improvement in CNC performance. If you’re the sort of person who wants to run servos instead of steppers on your CNC for the performance, you certainly will want to run a Motion Control Board as well. The difference in performance and surface finish is noticeable. In fact, depending on what you’re doing, you may not even be able to do it without a Motion Control Board. For example, our article on building a low-cost high-accuracy milling machine for micro-milling revealed they were unable to get clean features from Mach3 when running the parallel port. To fix the problem, they switched to Flashcut, which uses hardware motion control coupled with their proprietary (but Windows-based) control software to do the job.

Note that this will also affect the allowable feeds and speeds if you’re pushing the envelope. HSM (high speed machining) constant tool engagement angle toolpaths rely on the idea that the load on the cutter is constant–there are no “shocks” such as we find with conventional toolpaths as they plough into corners. There is software out there that will fit arcs to a series of short line segments in your g-code to provide another form of smoothing. Running a cutter is not unlike running a race car on a track. The better drivers soon learn that any input takes away from the adhesion available from the tires. Slowing down in a turn at the wrong point can spin the car just as surely as accelerating too much or entering the turn with too much speed.

When your cut is unpredictably changing the feedrate by as much as 25% in a truly worst case scenario, it’s very hard to run that cutter close to its limits.

How Do I Install One of These Controllers?

Good news here: it’s pretty easy. I use a Smoothstepper, for example. You plug it into the USB port, tell Mach3 you’re using it, and then it simulates 3 parallel ports which you can connect to motor drivers (Geckos or other) in the usual way. For $165, you’re off and running with dramatically improved performance. I run using an old slow laptop, I run the Internet and all sorts of other software there, and Mach3 cuts great on my machine–no struggle at all. I can even play my MP3′s so there’s a little music to offset the music of chip making.

The key is to find a Motion Control Board that’s already setup for your control software. Check out the directions on these boards, they’re usually pretty simple to get running. They have a range of functions available. The Dynomotion KFLOP is another such board. It has quite a bit more capabilities than a Smoothstepper as it deals with closing the loop for servos, among other things.

Motion Board Links

KFLOP motion control board

Dynomotion: KLFLOP motion control board.

smoothstepper motion control board

Warp9TD: Smoothstepper motion control board.

*** This article is slightly revised from the original version. I benefited greatly from a generous side conversation with Henrik Olsson, who gave me quite a lot of additional information and even took the trouble to hook his logic analyzer up in order to prove that Mach3 can pulse 6 axes as easily as it pulses 1. Thanks Henrik!

Related posts:

  1. Motion Control Boards Take Mach3 From Hobby Class to Industrial Grade, Part 1
  2. Building a Low-Cost Micro-Milling Machine
  3. Mach3 Users: Make all of your Accelerations the Same on your Axes!
  4. Windows Has Long Filenames But Your CNC Control Has DOS Filenames
  5. Interpolate or Twist Drill, Part Deaux – Making Holes, Not Pockets

10 Comments

  • Maybe walk through the steps you used to set the board up on your machine; the forums are replete with people who seem to not have been able to manage to set up a smoothstepper, for instance.

    • Maybe I was lucky, but I just followed the instructions verbatim and it all worked fine for me.

      If I had a problem at all it was that a lightning storm fried the Smoothstepper, but it also took out 2 Gecko servo drives.

  • Maybe walk through the steps you used to set the board up on your machine; the forums are replete with people who seem to not have been able to manage to set up a smoothstepper, for instance.

    • Maybe I was lucky, but I just followed the instructions verbatim and it all worked fine for me.

      If I had a problem at all it was that a lightning storm fried the Smoothstepper, but it also took out 2 Gecko servo drives.

  • Good. I just ordered one of the Ethernet smoothsteppers; we’ll see if it makes any difference in 3D speeds.

  • Good. I just ordered one of the Ethernet smoothsteppers; we’ll see if it makes any difference in 3D speeds.

  • [...] to read a random CNCCookbook post ← Motion Control Boards Take Mach3 From Hobby Class to Industrial Grade, Part 2 Our Holiday Sale Ends December 25 [...]

  • [...] to read a random CNCCookbook post ← Motion Control Boards Take Mach3 From Hobby Class to Industrial Grade, Part 2 Our Holiday Sale Ends December 25 [...]

  • [...] about accuracy. Several articles in the CNCCookbook blog by Bob Warfield got me to thinking. Read both parts written by [...]

  • I have just put a smooth stepper board into my controller and I have had all sorts of issues, first were the home and limits but after reading some more posts on here and other places I put a resistor into the common and used the “ground” rather than the +5v terminal for the common to the the limit switches.

    My next main issue is jogging! When I jog with the keyboard or the Tab “flyout” the axis will keep on moving when I release the button!!!!! this happens randomly….not every time but when it happens in Z the results are not good. Time to hit the E-Stop is not always possible.

    Has anyone else had this problem….any ideas on how to fix this?

Leave a comment

Home

 

CNC Blog

     Cool

     Projects

     Software

     Techniques

     Business

     Products

Software

     G-Wizard Calculator

          User Guide

     G-Wizard Editor

          User Guide

     Gearotic Gear Software

     Troubleshooting

     User's Club

Cookbooks

     Feeds and Speeds

     G-Code Tutorial

     Beginners: Soon!

     Software: Soon!

     Machining: Soon!

     CNC Tech: Soon!

     Idea Notebooks: Soon!

 

Projects

     Completed

     Simple Wish List

     Model Wish List

     Rash Ideas

CNC Machines

     Lathe: Soon!

     Mill: Soon!

     Router: Soon!

     Plasma Table

     3D Printer: Soon!

     Welding

     Other Machines

Resources

     Machinist's Search

     Videos

     Online Groups

     Individuals

     Reference Data

     Books

     CNC Dictionary

     Suppliers

     Tool Brands

Workshop

     Hall of Fame

     Organization: Soon!

 

About

     Customers

     Partners

     Our History

     Privacy Policy

 
All material © 2010-2012, CNCCookbook, Inc.

Take 15% off G-Wizard CNC Calculator 3-year Subscription for a limited time with "15OFF" coupon code.

No Thanks!