Wednesday, 22 April 2009

GM17 stepper hack

I have thought for some time that the best thing to drive an extruder with would be a small stepper with a gearbox. The reason being is that a stepper motor has close to zero efficiency when moving slowly. Power is speed multiplied by torque, so as speed increases the efficiency increases until the torque falls away due to inductance. A gearbox allows a much smaller stepper to be used because it can be run faster producing more power.

I had a look for steppers with gearboxes, but they seem to be ridiculously expensive. An alternative idea was to replace the DC motor in a gear motor with a small stepper. I couldn't find one with the correct ratio though until Solarbotics started selling replacement gears for the GM17. They allow the standard ratio of 1:228 to be changed to 1:104 or 1:51.

That makes the GM17 very flexible as they also do a magnetic shaft encoder with an integral H-bridge driver. Great for robotics, but it seems a bit under powered for an extruder.

The motor is about the same size, and has the same shaft, as the tiny steppers I got from Jameco for my first attempt at an alternative Z-axis.

I cut away the plastic cylinder that holds the motor and RepRapped an adapter flange to mount the stepper.

Here it is assembled: -

The small pinion gear is a push fit on the motor shaft, but I found that with the higher torque from the stepper I had to glue it on.

I can run the stepper up to 1000 steps / second in full step mode, with a 12V constant voltage bipolar drive. The step angle is 15° so that is 2500 RPM! It has very little torque at that speed, but it gets multiplied by the gear ratio of course.

At lower speeds the current increases and the motor gets way too hot at 12V, so it needs to be driven from a constant current drive. That is what I was intending to use anyway.

Jameco state the holding torque as 140, so I have calculated the torque after the gearbox, assuming no losses as: -
Ratio Max Speed Max Torque
51 49 RPM 0.7 Nm
104 24 RPM 1.4 Nm
228 11 RPM 3.1 Nm

It seems remarkably high as NEMA23 steppers are only about 1 Nm. Note that the max speed is for about zero torque and the max torque is for about zero speed.

I attached it to a screw drive extruder and managed to extrude ABS at a rate equivalent to 0.5mm @ 19 mm/s with a step rate of 800 pps using the 1:51 gears.

So similar performance to a GM3 with these advantages: -
  • No brushes to wear out.
  • No shaft encoder and PID software.
  • No RFI suppressor.
  • Only needs step and direction pins on the controlling micro rather than two or three H-bridge controls and two quadrature inputs.
  • The output shaft and final gear are one piece, whereas on the GM3 the plastic shaft is on a metal splined shaft that can slip.
  • The clutch is one gear back from the output, so gives higher torque before slipping.
The interesting thing is that the projected torque figures indicate that it would be able to do a pinch wheel extruder with its original gear set. I will give that a go next.

I think the cost is about the same as a NEMA17. The advantage is it is smaller and lighter, the disadvantage is it would need separate bearings and a coupler. The NEMA17 will go a lot faster, but has less torque.


  1. LOL! You are impossible to keep up with, nop! :-p

  2. BTW, the numbers for torque on the solarbotics website were wrong, as I suspected. Their webmaster is a bit of a dufus, apparently.

    Dan Gates tells me that you get 39 oz-in (0.274 Nm)at 3v and 74 oz-in (0.523 Nm) at 6v.

    Those are measured averages taken over 10 motors tested.

    Another shop that sells Solarbotics gm-17's has the right numbers.

  3. Dan also tells me that the motor in the GM-17 is coreless, whatever that means. He says that it produces much less RFI as a result and is a lot quieter (I can attest to that, as I am sure that you've observed, too)

  4. GM17s are quiet when unloaded but get a lot noisier when extruding. I was running at 12V though to get the speed for 16mm/s as it drops a lot with load.

    I haven't looked at the RFI.

    If we stick to 6V (or 5V from PC PSU) then it would be happier, but then it is not fast enough for an M5 threaded rod extruder. Perhaps changing up to second gear would get the speed with the enough torque, but you are left with having to use the shaft encoder to regulate the speed. The motor may be more efficient but I get the impression that it is not as powerful as the 12V GM3.

    At 6V though you can use the H-bridge that comes the shaft encoder. The datasheet is in Chinese so I don't really know if it is any good.

    I prefer to use a stepper as the stop response appears much better and it uses less pins, less firmware and will last longer.

    The GM17 and its add ons and this hack make a very flexible combination for robotics though.

  5. According to Dan, you are not supposed to push the GM-17 over 9v and not over 6v if it is supposed to last you a long time. BTW, he pulled his notes and it gets 84 oz-in (0.59 Nm) at 6v.

  6. Great work! I'd love to have less moving mass and still stepper based extrusion. My GM3 is having a very hard time. It hasn't worn out yet, but it probably will.

    Still I wonder if going open loop with this is the right direction. You'd assume a constant extrusion rate. But maybe some feedback is desirable? If the extrusion is harder to do, it probably filled up the space between the extruder nozzle and the object. Knowing this would improve the print. You'd be able to adjust the horizontal movement speed to the extrusion rate. Perhaps this could even be automatically learned by making a test pattern and measuring the rotation of an encoder on the extruder. Start with widely spaced lines and get them closer and closer to each other until they overlap. When they start to overlap, the software can know (because of a slowdown in extruder RPM) the extrusion width for this height. The effect of extruding very low or high can then be utilized as well. The machine could also adjust the feedrate constrantly during a build to optimize build speed by maximizing the extrusion speed, not keeping it constant and.

    I know it might make things more complex, but you may get better quality and speeds in the end. What's happening with the plastic should dictate the movement, not the other way around.

    I'm not an expert at mechatronics, but this is my gut feeling on how this should work. My gut feeling may be wrong of course ;)

    Of course your print results prove that the route you're going is very successful, but I wonder if it could be even better!

  7. You know, looking at this again, I am wondering why you didn't use the worm gears that you now know how to make to do this job instead of the GM-17 gearbox?

  8. Erik,
    Actually I noticed that the current drawn by the stepper changes quite significantly when I load it so you could measure that to get an idea of the torque.

    Having said that I don't think the torque tells you much about what is going on at the nozzle. It is dominated by the friction at the screw and viscosity at the cold end of the barrel.

    I think you would need to measure the pressure inside the barrel to get information about flow from the nozzle.

    But I can't see why we need that. The only uncontrolled variables are: -

    The filament diameter, which we could / should measure on its way into the extruder.

    The surface temperature of the object. I don't think that alters how the plastic flows, just how it bonds.

  9. Forrest,
    So it looks like the GM17 at 5V with the 1:104 or 1:51 gears would have enough torque and speed for screw drive at a reasonable rate. And the shaft encoder and h-bridge give quite a cheap control solution if you have a 5V supply handy and can process the fast quadrature signals. I will put the bracket and coupler on Thingiverse so people can upgrade their extruder from GM3.

    I might be wrong but I don't think worm gears are very efficient compared to spur gears and would need an extra set of bearing as tin cans and not good with thrust.

    I was thinking of putting an meccano work gear on a NEMA17 though.

  10. nophead: Could you post a picture of the whole extruder? Where all the details can be seen.

    I think this is the latest extruder where all the improvements are compiled in.

    So I would appreciate some photos especially disassembled:)


  11. Khiraly,
    It is a combination of the things that have worked the best so far, but not necessarily the easiest to make. I still have more things to try so it is not my final version.

    Apart from the motor change and a new motor bracket it is the same as this one: The heater and nozzle or described here: