BalBots.com Logo
BalBots.com - Balancing Robots Made Easy
Quick Find
My Account  |  Cart Contents  |  Checkout   
Products
Robot Kits
Accessories/Parts->
Anatomy of a BalBot
Downloads
Videos
Articles
FAQs
Information
About Us
Ordering Info.
Contact Us
CNC Milling machine Part II

 

Overview

After successfully converting the HF 47158 machine to CNC control and making quite a few parts on it, the next steps were 1.) To convert to a DC servo motor setup instead of the stepper with encoder setup and 2.) to find a way to run the stock spindle at a higher speed. Both of these objectives have been achieved, and this article gives an overview of the process I followed.  Note that the term "high speed" is relative, and when I say it, I mean significanty higher speed than the stock spindle configuration.  The stock is about 2000 RPM, and this conversion achieved about 8000 RPM. 

Note that if you are using extremely small cutting bits, such as those used for PCB routing or via hole drilling, then 8000 RPM may still be considered slow.  If you want even faster than 8000 RPM, you may consider using a Harbor Freight air-powered cutting tool.  I have seen some that are cheap, come with 1/8" and 1/4" collets, run at 30,000 RPM, and look like they could fit in place of the current spindle.  Of course you need a good air supply and I don't know how severe the runout on these bearings & collets are.  Also, this will preclude you from being able to use standard size endmills that work well in the stock spindle.  I have not heard of anyone trying a setup like this, so try at your own risk.

Hopefully this article will benefit some of you out there who are trying to learn CNC or build your own system. This article is essentially a continuation of the
previous article, which covered the initial conversion of the 47158 Micro-Mill.


Servo Motors

DC Servo motors are a really neat electro-mechanical device. Essentially, you have a DC motor with an encoder (optical in my case) to detect shaft position (and velocity, indirectly by the controller performing a time-derivative), and a controller which reads from the encoder and then applies power to the motor accordingly to make the motor move in a precision manner according to how the controller is commanded. It's really amazing the performance such a system can achieve.

Often the controller uses a PID (Proportional Integral Derivative) control loop running several thousand times per second to achieve a high-performance, robust control. For this setup, I used some nice motors which I calculated had the torque and RPM to give my machine a feed rate of 120IPM when direct-coupled to the stock leadscrews. This is a quite respectable speed for bench size mills (actually, unheard of speed for mills like this which have with Acme lead screws instead of ballscrews!), but they also require quite a bit of power by benchtop machine standards. So I built a custom controller to handle this. Which leads me to the next topic...


Three of these servo motors were used (one for each axis).


Servo Controller

So I needed to control these relatively large motors. Although it would have been interesting to build my own controller completely from scratch down to the transistor level, I quickly decided that a more integrated approach be a much quicker implementation, be very robust, and still quite cost effective. So I purchased the following components and built a custom system:

  • A nice heavy-duty case with fan(s)
  • 3x Gecko G320 Drives. This provides the PID control as well as power chopper circuitry to power the motors. In retrospect, the G340 would have been a better fit because it turns out that my PC controller doesn't have a high enough frequency output to match my beefy motors (more on this later).
  • Heatsinks for the Gecko drives.
  • All the components needed to build my own custom power supply from scratch. This allowed me to build a very beefy supply for relatively low cost AND have it integrated into the same case as the rest of the electronics. Components for this included a BFT (Big Fat Toroid), and BFCs (You guessed it... Big Fat Capacitors), a bridge rectifier, safety bleed resistor, connectors, cables, etc etc.
  • Connectors, Cables, and cable covers.
  • Low-power power supplies for powering electronics. (Used a 12V wall-wart hard wired to the AC line in, and a LM7805 circuit for 5V since I had all this on hand)
To control my Servo Motor controller, I used a PC running EMC. EMC is an open-source Linux-based CNC machine controller. It uses industry-standard G-code, and has a lot of flexibility in how it can be configured. At first I used a 400MHz AMD machine. It worked okay, but booted very slow, ran EMC slow, and the fastest pulse train I could get it to output corresponded to about 30IPM feed rate. That's an okay feed rate, but nowhere near the theoretical maximum of my hardware. I upgraded the PC to 2.8GHz machine, but still was only able to run up to about 40IPM. It seems there's a fundamental limit with the PC's parallel port or the way EMC accesses it. Nonetheless, the computer upgrade was worth it because now it boots fast and runs the software very quickly, and I can multi-task while EMC is running. The easy answer to my low-freq pulse train problem would have been to have purchased G340 drives instead of G320. The only difference is that the G340 has a built-in clock multiplier (PLL). Too late for that solution, so I built my own clock multiplier using a Cypress Programmable System on a Chip (PSoC), which I set to multiply the pulse frequency 4x.

After installing this, voila! I could now run the hardware at full speed. And yes, believe it or not, it will run at its theoretical limit of 120IPM quite nicely! The X and Y rapids are set at 120 IPM. I timed it and measured it just to make sure I wasn't hallucinating, then pinched myself to make sure I wasn't dreaming (okay, maybe not that last part but you get the idea). Sure enough, it was a true 120 IPM. Sure the full-size VMCs with multi-thousand dollar ballscrews can do faster than that, but we're talking about little benchtop mill with only a few inches of travel! It's almost scary running it that fast. I don't intend on ever milling material at that speed, but rather on using it as a rapid to move the end mill in the air to move into position for a cut. This is especially nice since my CAM software likes to generate a lot of "air" moves.

With my counter-weight setup on the Z-axis, I have been able to run it up to about 100IPM. However, I have it configured to run slower so I have some headroom and don't have an accidental over-current with all the weight it's moving around. This axis doesn't need to go that fast anyway. I'd hate to see a vertical endmill crash at 100IPM.

Something else to point out here is that each servo has its own PID controller which gets its commands from the central EMC computer. Essentially, the servo control is distributed. What is implied here is that, although each axis is under closed-loop control, they are essentially open loop with respect to each other. As an exaggerated example of what this means, if you were to do an X-Y linear move, and physically stop the X-axis, the Y-axis would keep trucking along and you would not get the X-Y move that you thought you were getting. In reality this would never happen because stopping the X-axis would exceed its tolerable error limits, and the EMC computer is notified of this and it subsequently halts everything. But this could happen on a smaller scale when one axis encounters a little error, but not enough error to cause a fault. The end result is that a linear move command would result in a not quite linear move. I theorized that in my system, this would only happen at very high speeds (over 80 IPM), and at actual cutting speeds the actual error would be so low as to be imperceptible. So far I have been right. In actual cuts, I have not been able to measure any error due to this. So in my system, this is not an issue. I mention it, though, because I have almost never seen this talked about in other online literature, and it is good to keep it in mind. On some lower end systems where you are running the servos close to their maximum performance threshold, this can be a real issue. If cost is not an issue, the answer is to use a single central computer both to do the path planning AND the PID control for every axis. The problem with this is that it requires extremely fast data input and output of the computer in order to control each servo. This requires expensive IO cards, and is really overkill for most benchtop applications.

I'd also like to mention an unintended benefit of this system which I come to really appreciate. On some desktop systems, there are physical linkages that act like fuses that break when an axis limit is exceeded. In the case of MAXNC systems, they are notorious for breaking the leadscrew nuts, which are made out of plastic, expensive, and a lot of work to change. This HF system is a more rigid setup. The weakest link in the system is probably the motor couplers, but this is system-dependent, and can be made very strong if you want it to be. With my system, I found that the hardware was strong enough that if I ever exceed a limit on an axis and it reached a hard-stop (don't ask me how I know this), the motor will output a lot of torque to overcome the obstacle. Since motor current is proportional to motor torque, the current spikes up. The Gecko controller sees this and goes into an over-current shutdown mode (the trip-point is hardware adjustable) and issues a fault signal, which halts EMC. Neat, huh? A quick hit of the controller reset buttons (1 Hardware button, 1 software button), re-home the system and you're back in business. No broken parts or anything.


Servo controller system. This photo was taken before hardware E-stop and custom pulse multipliers were added. Each Gecko has its own heatsink. Notice that the extra heatsink and extra connector cutout provide easy expandability for adding another axis later. Please excuse the big bank of capacitors mess. These days it's hard to find a single big one so I went with multiple medium-sized ones.


High-Speed Spindle Conversion

Overall, I have been very pleased with the stock spindle that came on the HF machine. It has a relatively common MT2 taper, is fairly heavy duty, seems to have low runout, and there is low cost tooling readily available ($10 3/8" endmill holder that is actually pretty good quality). With this said, there is one glaring problem with the stock spindle setup: it's slow speed. This is both an asset and a liability. It's an asset because it's geared low (1000 RPM and 2000 RPM ranges), so you can use a 3/8" or 1/2" endmill with ease. Also, the motor is quiet and the controller seems to have a back-emf feedback mechanism so that it does a great job of maintaining the speed you set it at, even under load.

So what's the problem? Well, basic physics and cutting principles tell us that the smaller the diameter of your endmill is, the faster you need to rotate it in order for the cutting surface to strike the material at the same speed. Simply put, the smaller the endmill you use, the faster the spindle you need and vise-versa. I have used the stock spindle with 1/8", 1/16" and even 1/32" bits, but it really spins too slow. I was able to get by just by using really slow feedrates but it's still not the right way to do it.

Needless to say, I wanted these small end mills to spin faster but really wanted to keep the same spindle and the ability to run it slower so I could still use the larger endmills effectively. The solution was to convert to an adjustable-range pulley belt-drive system. The concept is very straightforward. The trickiest part of implementing it is that I couldn't find any off-the-shelf pulleys that met the requirements, and doing anything custom to a high-speed pulley requires precision work (a decent lathe). I did find something close and then modified it.
What I did was purchase the following:

  • Taig Tools pulley set. Part number 1162, but have them change the belt to the shorter 3M 315.
  • Spare belt Taig part #1159
  • Misc. Aluminum and hardware

The two phases to this project were 1.) Create/modify pulleys 2.) Create motor mount...


High-speed pulley conversion. Note the tension adjustment knob on the right side. Sweet.


Pulley modifications


For the pulleys, the Taig pulleys were pretty close to what I wanted except that both bores were the wrong size and the belt is a bit wimpy. Time will tell whether the latter is a real problem or not. In theory, I believe this belt is rated for approximately the correct horsepower even though it looks so puny, so we'll see. The nice thing about it is that it should operate well at the higher speed, which is why I decided to give it a try.

For the spindle pulley, I used a 7x10 HF mini-lathe to enlarge the bore to 0.784" diameter. This is about 0.003" smaller than the spindle diameter, on purpose. I heated the pulley using a heat gun to enlarge the bore the rest of the way, and then slipped it on the spindle and tightened the setscrew. This way I get a nice tight precision fit, and if the pulley heats up during operation (which it will), it will not come loose even though the thermal expansion coefficient of aluminum is larger than that of steel.

For the motor pulley, the 1/2" bore is too large for the motor. The solution was to create an adapter. The adapter has a 1" diameter section at the base where I put the setscrew, then a shoulder, then 1/2" diameter the rest of the way (see photo). One end of the adapter is bored to ~0.314" for the motor shaft to fit in.

Note that when the spindle pulley was bores, the smallest diameter groove was completely removed in the process, since it was smaller diameter than the hole I was making. This was a necessary casualty, and it still leaves you with 4 or 5 possible belt positions, depending on how you offset the pulleys. I chose the 4-position configuration which gives a slightly higher top speed range. The resulting theoretical speed ranges given the 4000 RPM motor are as follows:

  • 0-8320 RPM
  • 0-5720 RPM
  • 0-2797 RPM
  • 0-1923 RPM


Different view of high-speed belt conversion.

Creating the Motor mount

A simple motor mount could have been made using one sheet of 1/4" thick aluminum. The motor holes could be made as oval slots so the motor can me moved to tension the belt. However, I wanted a quick, precise method to move the motor for quick belt position (speed ratio) changes and adjustments. If it's a pain to change the belt position then it's tempting to always leave it in the same position.

The solution was to use two plates (top and bottom) and a leadscrew to adjust the skew between them. The photos on the right should make this self-explanatory. It was a lot more work, but am very pleased with the results. Not only is it quick and easy to change belt positions, but you can adjust the tension by running the motor and then turn the adjustment knob and listen to the spindle. You can hear when the belt becomes fully engaged.


Main High-speed pulley conversion parts.


Same parts, different angle.


Results

The servo conversion was a lot of work. It's amazing how long simple things like creating a cable harnesses can take. However, the process went pretty smoothly, and so far I am extremely pleased with the results. The max feed rate due to the beefy servo system is excellent, while maintaining excellent accuracy and repeatability. I can make round circles without any noticeable divets or marks on the sides (at the axis reversal point where normally backlash will show) by keeping the split nuts reasonably tight and with software backlash compensation for the rest.

I achieved my goal of keeping the stock spindle, yet run it at 4x speed and still being able to gear it down to lower speeds. Interesting effect: at the higher speeds, you have to slowly ramp up the spindle speed over a period of about 3 seconds or more. If you try to crank up the speed instantly, the motor controller will over-current and the "unnormal" light will turn on (yes, it really is labeled "unnormal". Gotta love chinese to English translation). Once you ramp up to full speed, it runs smooth. I have been able to make very very nice cuts in aluminum with an 1/8" EM. I've made successful cuts at feedrates from 5IPM to 50IPM.

My only real concern about the setup is that I don't know how long the spindle belt will last. If it holds up well under all cutting conditions, then I will be very pleased. Also, the spindle bearings do get a bit warm, but I have a high-velocity fan on them to keep them cool, and even if they get warm they'll probably last a long time, so I'm not too concerned.

Vibration was a concern going to this high speed. If you put your hand on the Z-axis, you can feel some vibration, but it is not that bad. Interestingly, if you remove the belt, you can feel approx. the same vibration. My motor shaft is slightly bent and I think is the source of 80%-100% of my vibration. Others have reported silky-smooth operation from the same motor so something's amiss with mine.


Links:

CNC conversion Part I Covers axis motor mounts, leadscrew couplings, coolant system & cage, Home sensors and more.

Yahoo newsgroup specifically focused on the conversion of this machine.




-JS-