I really like the simplicity and low cost of EMC, parallel port, A3982 combo for driving machines. Unfortunately, the existing open source 3D printing projects don't really fit well into that frame work. There has been some RepRap/EMC stuff done here, but the it seems kinda kludgy to me.
For example: to turn the extruder head on or off, EMC has to parse a custom M code using an external python module, this module then uses another python module to send a serial command to a RepRap extruder controller, the extruder controller microcontroller then parses this serial request and commands the extruder motor off.
On top of all this, the RepRap extruder controller does not automatically do constant current drive for stepper motors. This limits your choice of motors and hamstrings their performance.
Since the latest RepRap extruder is designed around a stepper motor, and EMC is natively set up to drive stepper motors, it makes sense to me to have EMC drive the extruder motor as just another machine axis.
At first it looked like this wasn't going to be an easy task. Both the RepRap host software, and Skeinforge want to generate code like "extruder on, move X,Y,Z a bunch, extruder off" rather than "move X,Y,Z and extruder axis 1mm left, move move X,Y,Z and extruder axis 2mm up". Fortunately though, I stumbled across something called the "5D firmware" for the RepRap. This experimental firmware for the RepRap motherboard wants G-code very similar to what I want for EMC. Better still, Skeinforge version 10, released yesterday!!!, added support for generating 5D G-code.
Now that the stage is set, here is how you generate EMC readable (and almost printable) G-code files with Skeinforge.
- Launch Skeinforge
- Under the Craft menu, click Dimension...
- Check the Activate Dimension box, and the Absolute Extrusion Distance option
- Click Save
- Load and process your STL file with Skeinforge as normal
- Open of the generated G-code file with an editor (or make a script to do the next few steps)
- Remove all of the M10X (M101, M103, ...) lines from the file
- The file will contain lots of lines like: "G1 X4.8 Y17.21 Z0.72 F186.624 E2.43", change all of the letter "E"s to "A"s. Find and replace will probably work.
- Save the modified G-code file
- Lastly, you'll need to modify your EMC machine configuration so that the A axis, probably called AXIS_3, MAX_LIMIT travel parameter is a really big number like 99999.
Time to get the extruder finished and test some of this out!