Stepper Driven Extruder

There is now a MakerBot Stepper-Driven Extruder, Stepstruder MK6!!! Yay!

Using a stepper driven extruder allows much better control over extrusion speed, and people have been experimenting in this area. This page is to help you if you either want to upgrade your cupcake to use a stepper extruder, or you are using a reprap mendel with a stepper extruder but want to use the makerbot toolchain to control it.

Build/purchase a stepper driven extruder

There are several designs for extruders that you may consider. Many people are using a Wade Geared Extruder, Makergear has a stepper plastruder, and now Makerbot have introduced the stepstruder.

Deciding how to drive it

There are two main options for driving the stepper. You can use your existing extruder controller to drive the stepper via the same H-bridges that are used to drive the DC extruder or you can use a dedicated stepper driver board. A dedicated driver board gives better results (run quieter, cooler, and easier to configure), but you may not have one handy. Either way, you have to install a custom version of the extruder controller firmware. You can continue to use standard motherboard firmware (either 1.6 or the newer 2.x series).

Driving it from the extruder controller

There are two firmware options for driving the stepper from the extruder controller board. Option A is based on the 1.8 EC firmware, and people have been successfully using that. Option B is based on an experimental build of the 2.x EC firmware, which is known to NOT work with the Lin Engineering steppers (please report any successful uses of this).

Option A: Using an Extruder Controller v2.2 with the 1.8 EC firmware

You need to compile your own version of this firmware after making some simple source changes.

  • Check out the G3Firmware from makerbot github [http://github.com/makerbot/G3Firmware], main branch
  • copy configuration.h.dist to configuration.h
  • Start your arduino-018 development environment, and open ArduinoSlaveExtruder/ArduinoSlaveExtruder.pde. Within this, edit configuration.h and uncomment:

STEPPER
define MOTOR_STYLE 2 <— uncomment

then comment out
//PWM
#define MOTOR_STYLE 0 <—- comment out set MOTOR_STYLE to 2 for a stepper motor.

  • Make sure to use the Arduino Diecimila, Duemilanove, or Nano w/ ATmega168 board.
  • Verify/Compile. If this is your first time compiling the firmware you may encounter firmware-compilation-errors (e.g. complaints about Servo.cpp are common see firmware-compilation-errors for more).
  • When it compiles OK, connect your USB2TTL cable to the extruder controller, select Upload To Board and press the reset button on the extruder controller about two seconds later.

Option B: Using a Extruder Controller v2.2 with the 2.X firmware

A pre-built firmware image that supports the stepper is now on the firmware download site. You can install the firmware on your ECv2.2 board with ReplicatorG's built-in firmware uploader. Just make sure you explicitly select the version of v2.3 that has stepper support, and upload as you ordinarily would.

Tuning

This firmware drives the stepper with half-steps. It is currently configured to run at approximately 40 half-steps per second when a value of 255 is given as the extrusion speed. The frequency of the steps varies linearly with the speed value; setting the speed at 128 should run the stepper at approximately 20 half-steps per second. NOTE: this firmware directly interprets the M108 Snnn codes as RPM, so ignore the section below about modifying your gcode.

Wiring it up

Wire one coil of your bipolar stepper motor to the 1A/1B ports (where you'd ordinarily connect a DC motor for a DC-driven extruder), and the other coil to the 2A/2B ports. The particular order of your wires depends on your stepper motor. For a Lin Engineering 4218L-01-10 the order is 1A=black,1B=green,2A=red,2B=blue.

Driving it from a dedicated stepper driver

There are two firmware options for driving the stepper from the extruder controller. Option A is based on the 1.8 EC firmware, and people have been successfully using that. Option B is based on new support for an external stepper in the 2.x EC firmware, and several people have been using this with success.

You can flash a new firmware using:

avrdude -V -F -patmega168 -P /dev/cu.usbserial-FTF0GE9Y -c stk500v1 -b 19200 -U flash:w:EC-ecv22-v2.6-extstepper-norelay.hex

Change the port (/dev/cu.usbserial-FTF0GE9Y) and filename (EC-ecv22-v2.6-extstepper-norelay.hex) as needed.

If this method doesn't work you can also update the firmware using RepG with the following steps:
1. Go to the .replicatorg file on your computer - eg. C:\Documents and Settings\Owner\.replicatorg)
2. Edit the firmware.xml file in there by adding in the following(or similar):

/>
<firmware
major="2"
minor="6"
relpath="firmware/EC-ecv22-v2.5_2720stepsPerRev.hex"
name="Stepper EC Firmware"
description="Stepper EC Firmware"
/>

3. Then save the .hex file (in this case EC-ecv22-v2.5_2720stepsPerRev.hex) into the firmware folder in .replicatorg

4. Start up RepG and upload the firmware like it was a regular firmware update.

Option A: Using an external driver with the 1.8 firmware

  • Get Rick Pollack's patched version of the ArduinoSlaveExtruder (see here)
  • Start your arduino-018 development environment, and open ArduinoSlaveExtruder/ArduinoSlaveExtruder.pde.
  • Make sure to use the Arduino Diecimila, Duemilanove, or Nano w/ ATmega168 board.
  • Verify/Compile. If this is your first time compiling the firmware you may encounter firmware-compilation-errors (e.g. complaints about Servo.cpp are common see firmware-compilation-errors for more).
  • When it compiles OK, connect your USB2TTL cable to the extruder controller, select Upload To Board and press the reset button on the extruder controller about two seconds later.

Wiring it up

Using a 4th MakerBot Stepper Driver

If you are using a v2.3 Stepper Driver to drive your stepper extruder and you have the patched version of v1.8 extruder controller firmware, connect the Extruder Controller to the v2.3 Stepper Driver as follows:

Connect D9 to DIR
Connect D10 to STEP
Connect the Enable pin (on stepper driver) to Ground. (or better yet, attach it so that you can toggle it to enable/disable the stepper driver. If you are using a Wade, the large gear is very handy for making manual adjustments but it can only be hand turned when the stepper driver is disabled.)

Using a Pololu Stepper Driver

An A4983 Pololu Stepper Driver is capable of driving the stepper at 1/16 microsteps. This results in VERY smooth and quiet operation.

flickr:4874166644

More instructions and a BOM for this simple stripboard controller can be found [here].

Also, Matz is working on a PCB design [here].

Option B: Using an external driver with the 2.X firmware

There is a brand new option on the block for driving an external stepper from 2.X EC firmware. It is now merged into the official firmware tree. You can install a precompiled firmware:
[[https://github.com/koenkooi/G3Firmware/]] and click 'Downloads'

Or you can compile your own firmware:

  • Make sure you can compile the v2-firmware
  • If you are not using a MakerBot v2.3 Stepper Driver board you may want to edit src/Extruder/boards/ecv22/ExtruderMotor.cc and set extruder_steps_per_rev to a higher number (such as 3200 for a pololu board set to 1/16th microsteps)
  • Compile with extstepper=true and stepper=false and whatever other options you would like (such as relays=true), e.g.:
  • scons -f SConstruct.extruder extstepper=true stepper=false
  • Upload the firmware as described at v2-firmware, e.g.:
  • scons -f SConstruct.extruder extstepper=true stepper=false port=/dev/ttyUSB0 upload

Wiring it up

Using a 4th MakerBot Stepper Driver

flickr:5144834329
NOTE: in this image the red and gray wires need to be swapped. See [here]

Using a PSCC15 Pololu carrier board

flickr:5240246250
For notes on pins see [here]

Using a Pololu Stepper Driver

You could use the stripboard described above either as-is (with enable hardwired to on), by connecting SCL/SDA to the EC board quadrature pins 7/8. Alternatively modify the stripboard to also allow connecting the pololu enable pin to D10.

Making replicatorg recognize a stepper extruder

If using the extruder controller H-bridges as a driver with the 2.x firmware, no machines.xml modifications are needed as it interprets PWM settings as a kind of RPM. Otherwise you will need to modify your machines.xml as follows:

If you are upgrading your cupcake to use a stepper, you can add: motor_steps="400" to the <tool name="Pinch Wheel Extruder v1.1" …> line in the replicatorg machines.xml entry for your machine. Note: The value of motor_steps is currently ignored by ReplicatorG, so any number over zero should work.

If you are controlling a mendel, you will instead want to add a new machine entry that has the correct axis definitions as well. See here.

When this change has been done and you have the appropriate device selected in replicatorg, opening the control panel will reveal a new entry field for RPM. With an external stepper driver firmware, the PWM field is ignored, and you can leave it empty. For the 1.8 H-bridge driver try a PWM of 140 (too high a value can overheat the H-bridges). Set RPM to something like 10. Click forward and you should see your stepper motor working. The exact RPM to use when extruding depends on the gearing of your extruder, but around 10 is a good starting point for Wade's Geared Extruder.

Producing gcode that uses RPM for speed control rather than PWM

The flow rate value in skeinforge configuration for controlling speed produces M108 Snnn commands that the firmware uses to control PWM. We instead want our gcode to contain M108 Rnnn commands to control RPM, and (if using the 1.8 firmware / H-bridge combo) a single initial M108 Snnn to set the overall PWM. This can be accomplished by postprocessing your gcode using an external script (e.g. this or this), or by installing the skeinforge rpmify plugin that will do this for you from inside skeinforge. The version of skeinforge-35 that is bundled with replicatorg-24 includes a new skeinforge plugin called reversal that incorporates rpmify functionality as well as implementing rapid reversal/pushback for ooze removal — it is highly recommended (it can also be installed into other / external versions of skeinforge if you desire)

Once you have created the gcode, do a manual inspection that the appropriate M108 codes are being used.

References

Unless otherwise stated, the content of this page is licensed under GNU Free Documentation License.