Sunday, April 8, 2012

Low Cost CNC Machine Part III - 1 1/2 Half-Finished Translation Stages

A continuation of Parts I and II....

I went on a bit of a tear today, building another four of the CNC shaft mounts, plus printing two hex-nut mounts and another motor mount.  As a result I have one nearly completed stage that just needs end-stops added, plus another that's about halfway done and still needs bearing mounts and end-stops.

The newly created hex-nut mounts follow the trend of the shaft and bearing mounts, except that the frame size of the Keling NEMA23s that I'm using don't match that well with shaft centers at 1" height, so the threaded rod ends up a few millimeters above the linear shafts.  Consequently the nut has to be moved a little closer to the carriage to take up the difference.

Nothing really novel here, but having everything mount on standard hole-spacings with standard hardware really makes the design and assembly process easier.

With the hex-nuts in hand, I can now test the stages to see how they perform.  The assembled stage is shown below, with the half-finished stage partially assembled on the carriage.  The extra pillow-block bearings were the ones I'd bought from VXB, I will probably not actually end up using them.  Note that I'm really short on 2" 1/4-20 machine screws, so every mount only has one screw on the clamp side. 

I also tested out a simple anti-backlash nut idea.  It involves backing an additional nut onto a stack of rubber washers.  This is pretty cheap, with adjustable preload and surprisingly enough, seems to stay in place just by friction, although I think a proper mount should probably be designed.  A closeup is below:

For testing I'm using the standard Pololu A4988 drivers, driven by an Arduino Uno.  After some mishaps a few months ago, I fried two of my drivers so I'll have to pick up some new ones. In the photo below you can see the Arduino connected to the 4-axis driver board I've kludged together, connected to the stepper in bipolar parallel, which should give about 180 oz-in of torque.

Early tests showed that even unloaded, it was important to control acceleration of the motors to make sure they didn't skip steps.  I wrote a simple sketch that ramps the step rate up from a low rate where the motors can slam from forward to reverse without stuttering up to a much higher rate, about 2500 steps/sec with no microstepping.  The code is below:

// step pin is #3, direction is pin #2
void setup(){
 pinMode(2, OUTPUT);
 pinMode(3, OUTPUT);

inline void advance_steps( int dir, int steps ){
  int increment  = 4;
  int delay_init = 1000;        // 1/2 initial step delay, in us
  int delay_final = 200;        // 1/2 final step delay, in us
  int delay_curr = delay_init;  // current delay
  // compute the end of the ramp up and the start of the ramp down
  int ramp_up   = min( steps/2, (delay_init-delay_final)/increment );
  int ramp_down = max( steps/2, steps-(delay_init-delay_final)/increment );
  // set the direction
  digitalWrite( 2, dir );
  // start stepping
  int i=0; // step counter
  // ramp up
  for( ; i<ramp_up; i++ ){
    digitalWrite( 3, HIGH );
    delayMicroseconds( delay_curr );  
    digitalWrite( 3, LOW );
    delayMicroseconds( delay_curr );
  // constant feed-rate
  for( ; i<ramp_down; i++ ){
    digitalWrite( 3, HIGH );
    delayMicroseconds( delay_curr );  
    digitalWrite( 3, LOW );
    delayMicroseconds( delay_curr );    
  // ramp down
  for( ; i<steps; i++ ){
    digitalWrite( 3, HIGH );
    delayMicroseconds( delay_curr );
    digitalWrite( 3, LOW );
    delayMicroseconds( delay_curr );

void loop(){
  // move carriage one way
  advance_steps( LOW, 15000 );
  // then reverse
  advance_steps( HIGH, 15000 );

So I tried it out, and it worked! Moves the carriage back and forth like all-get-out.


Pretty cool to see something you've taken from initial idea to built prototype actually perform.  Doesn't hit the 100 mm/s feedrate that I'd like, but I didn't really expect that from the 1/4-20 rod.  With a proper leadscrew it should be no problem to get to that rate.  Yes, that is a T-Pain microphone on the chair in the background.

Next I wanted to see how loaded down the motors were.  To test this I added 16 pounds of freeweights.  It still ran smooth as silk, and after 15 minutes, the Pololu driver was only slightly warm.

I'm really pleased with how this turned out.  The stage is actually pretty quiet, much quieter than I'd expected.  On top of that, it seems to have power to spare even from a 12V supply.  Since the Pololu drivers are rated for up to 35V, I think I should be able to run it at 24V and get even faster feedrates. I haven't checked the accuracy yet, but if the 1/4-20 rod was perfect (Ha!) and there was no backlash (Ha!) then it would have a resolution of 6.4 um/step.  It might be wishful thinking, but I'm hoping to get it to within a few thousands of an inch (0.025-0.05mm).

Next steps are to finish the z-axis and install endstops.  Then I'll make the components for the y-axis and start thinking about a frame.

1 comment:

Irfan Ali said...

Thanks for taking the time to discuss this, I feel strongly about it and love learning more on this topic. עיבוד שבבי