Splines on motor shaft

From RepRap
Revision as of 21:13, 9 September 2012 by DavidCary (talk | contribs) (link to video showing how to put splines on motor shaft, etc.)
Jump to: navigation, search

Get your stepper to put splines on its own shaft

Several people cut splines directly on the shaft, producing a popular pinch wheel variations.

The only mechanical equipment this technique needs is a Dremmel or other mini-drill with a small cutting disc. In addition you will need a few pieces of wood, some woodscrews, an old (but not sloppy) door hinge, a few strong cable ties, an Arduino or Sanguino, and any RepRap stepper driver card.

Finished Stepper

This shows the stepper with its shaft slotted. The slots are exactly regularly spaced round it. Note the Blu-tack covering the bearing; this is to prevent iron filings getting in when you're doing the cutting.


This shows the arrangement you have to make. It took me about half an hour to set up.

Cut a rectangle of wood slightly wider and slightly shorter than your minidrill (E). Drill holes in it and use the cable ties to hold the drill very firmly - do them up tight. Attach that piece of wood to a larger one using the hinge (D). Put a woodscrew in at (B) to set the limit below which the drill cannot descend - you will use this to set the depth of the cut slots.

Arrange things so that the disc is cutting away from the body of the motor (as shown) so it doesn't spray it with iron filings.

C is a small block of wood to hold the hinge open when you are not cutting the slots.

A is the stepper, held by a G clamp. F is the Arduino, and G is the stepper driver board.

Adjust the woodscrew (B) so that the drill's cutting disc is about 1mm above the stepper's shaft.

Then very carefully position the stepper and the G clamp so that the cutting disc is exactly aligned with the stepper's shaft. Sandwich the stepper with a couple of scraps of wood to stop the clamp damaging it. You may find it easiest to do the G clamp up loosely, then gently tap the sandwich pieces to get the alignment right.

Take care that, when the slots are being cut, the cutting disc will not foul the main body of the motor.

Put Blu-tack round the motor's shaft to prevent any cutting dust getting in the motor's bearings.


Adjust the woodscrew (B) so that the drill's cutting disc is gently resting on the stepper's shaft (remember that cutting discs shatter easily). Turn B so that there is about a 1mm gap between its head and the wood to which the drill is attached. This will be the depth of cut.

Put the block of wood under the drill board to hold it away from the stepper's shaft. Mark the shaft with a felt-tipped pen.

Copy and paste the Arduino program below into a sketch in the Arduino development environment, upload it to the Arduino, and select the Serial Monitor window (the right-hand button of the row at the top of the development environment). (The program will work in the Sanguino as well as the Arduino - make sure you get the stepper driver control pins right.)

Power up the stepper driver board, press the reset button on the Arduino, and type 400 as the number of steps you want in the "Send" box and click "Send".

The stepper should rotate one complete revolution. Adjust the stepper current so that it is quite high. The shaft isn't driving anything, but the current will be left on when it is stationary (deliberately) to hold it so that it doesn't slip as the slots are being cut.

The cutting disc I used made a slot 0.8mm wide. Allowing for an equal 0.8mm land between slots on a 5mm stepper shaft gives about 10 slots all the way round - that is 40 steps between each slot. If the dimensions of your system are different, you may have to recalculate that. Obviously the number of steps between each slot must be an exact divisor of 400.

Turn on the drill (quite fast). Lower it very gently against the stepper's shaft and it should slowly cut a slot. Allow it slowly to come to rest on the adjusting screw. After a few moments you should hear the drill's pitch rise as the last of the slot is cut away.

Lift the drill, rest it on the wooden block, rotate the stepper, and repeat...

The cutting will heat the shaft, so you may want to blow a fan on it and let it rest a while between cuts.

Cutting discs wear and so reduce in diameter. I managed to do 10 slots round a shaft without this being a problem. Forrest Higgs says you can get diamond discs surprisingly cheaply - those should hardly wear at all.

There is an advantage to a worn (and hence small diameter) disc: you can make the cuts nearer the body of the motor. The standard RepRap pinch-wheel extruder runs the polymer filament 6mm away from the main face of the motor (not from the raised boss round the shaft). To do that you'll need a worn wheel.

 * Stepper driver program to rotate a stepper by fixed increments.
 * Adrian 13-IV-9

// These pins are the same as for a RepRap stepper extruder on 
// an Arduino

#define stepPin 11
#define dirPin 12
#define enablePin 5

void setup()
  Serial.println("Starting stepper controller.");

  pinMode(stepPin, OUTPUT);
  pinMode(dirPin, OUTPUT);
  pinMode(enablePin, OUTPUT);

  digitalWrite(dirPin, HIGH);
  digitalWrite(stepPin, LOW);
  digitalWrite(enablePin, LOW);

// Horribly written function to get an integer from the serial data stream

int getANumber()
      int i = 0;
      int j = 1;
      char c;
      while(Serial.available() <= 0);
      while(Serial.available() > 0)
        c = Serial.read();
        if(c == '-')
          j = -1;
          i = 10*i + (c - '0');
        delay(50);  // Particularly nasty hack
      return j*i;

void loop()
    int i, j, steps;
    Serial.println("Number of steps (-ve goes other way): ");

    steps = getANumber();
    Serial.print("Taking ");
    Serial.println(" steps.");
    if(steps < 0)
      digitalWrite(dirPin, LOW);
      steps = -steps;
    } else
      digitalWrite(dirPin, HIGH);
    for (i=0; i<steps; i++)
        digitalWrite(stepPin, HIGH);
        digitalWrite(stepPin, LOW);

If you're using a RepRap Motherboard v1.2 with a Stepper Motor Driver 2.3 connected to the X axis, then the pin settings for the above code are:

#define stepPin 15
#define dirPin 18
#define enablePin 19

Further reading