The mill’s soul

IMG_2456.JPGI just published v0.4 of Pleasant Mill‘s firmware on Github yesterday:

As you might guess from the version number, this firmware isn’t finished yet and probably still has some bugs to fix (help’s highly appreciated, BTW :).

As mentioned before, I use a Seeduino Mega and some Pololu A4983 stepper motor drivers.

One recent addition on the hardware side was a 24V/6.3A power supply. I also glued some small heat sinks on the A4983 chips.

Then I increased the current to 1.68A, the max current, the stepper motors (SY42STH47-1684B) are rated for. Driving the steppers at 24V/1.68A enabled me to dramatically increase the top feedrate for the machine (about 1800mm/min instead 600mm/min). Unfortunately, the little heat sinks weren’t enough and the thermal shutdown of the A4983 kicked in after a few minutes. So I had to lower the current to about 1.2A again (and the max feedrate to 1100mm/min).

As you can see in the image at the top of this page, I’m still using a messy bread board for the electronics. As soon as I have the feeling to know the main issues with the whole shebang, I’ll build some kind of Seeeduino Mega shield, of course.

Right now, I plan to put the stepper motor drivers on a separate daughter PCB, somehow integrated in some kind of big ass heat sink.

If anyone knows a good way to cool the tiny A4983 chips on the Pololu breakout boards, please let me know!

The just published firmware release contains code for the G2/G3 commands (arcs) and for several drilling cycles (G81, G82, G83, G85, G89 and G73, see video below).

The drilling cycle commands also recognize the L (loop) parmeter, which is nice to drill multiple holes in a row. Just switch to incremental positioning (G91) and use something like G81 X10 Y0 Z-12 R1 L7 to drill 7 holes along Y=0mm, 10mm apart and 12mm deep. Don’t forget to switch back to absolute positioning (G90) after :)

I also added the M6 (tool change) command. Of course, I have no automatic tool changer (and I don’t really plan to build one). On the Pleasant Mill, the M6 command pauses the G-code processing and displays a message on the LCD, containing the tool number, requested by the G-code program and waiting for feedback from the operator.

For example, the line

M6 T3

results in


I even wrote some code to save a “tool database” in the Seeeduino’s EEPROM, so the LCD would say something like “Insert tool: 3mm drill bit”, but this code doesn’t work properly yet.

Both, the drilling cycles and the tool change command are showed off in the following video:

And here’s the G-code, I sent to the machine during the video:

G0 Z3
G0 X2 Y2 ; Simple drilling cycle
G81 X6 Y0 Z-8 R2 F300 L4
G0 X2 Y7 ; Drilling cycle with dwell
G82 X6 Y0 P500 L4
G0 X2 Y12
G4 P1000 ; Peck Drilling cylce
G83 X6 Y0 Q2 L4
G0 X2 Y17; Peck drilling cycle, high speed
G73 X6 Y0 Q3 L4
G0 X2 Y22 ; Drilling cycle, slow retract
G85 X6 Y0 L4
G0 X2 Y27; Drilling cycle with dwell, slow retract
G89 X6 Y0 P500 L4
G0 X0 Y-25 Z19.5 ; Tool change position
M6 T2 ;  Change Tool
G0 X2 Y32
G81 X6 Y0 Z-5 R2 L4
G0 X2 Y34
G81 X6 Y0 Z-5 R2 L4
G0 X0 Y25 Z13.5

I also implemented the commands G54 to G59. Each of these commands switches the machine to one of 6 “work coordinate systems” (WCSs). These are 6 user defined “zero positions”, saved in the machines EEPROM.

To define a WCS, use the “Jog XZ”, “Jog Z” and “Jog AB” functions in the mill’s UI (“Cartesian”) to move to the desired position. Then choose the menu command “Set WCS” to save this position in the EEPROM. You also can view already saved positions with the “Show WCS” command.

When writing G-code, you can then use one of the commands G54 to G59 to load the previously saved positions as zero positions.

In order to get the whole WCS stuff working, you need to “home” the machine once (either by sending the G28 command or by choosing “Find home” from the Cartesian menu in the UI). This is necessary to give the firmware an idea of the machine’s absolute zero position. If you try to save a WCS position in the UI or to use G54 to G59 without homing, an error is displayed.



Poor men’s laser cutter

IMG_2345.jpgI know, a CNC mill ain’t a laser cutter. But it’s as close as it gets for me in the foreseen future.

Don’t get me wrong, I’m still happy with printing 3D stuff in plastic. As matter of fact, I used far more printed parts during the build of my new CNC mill than I had planned in the beginning. But there are quite some situations, when printed plastic just isn’t the best choice material for an object.

That’s where usually laser cutters, plasma torches and water jets come in. Or, in case of a poor, lone DIY warrior, a home made CNC mill.

The plan

I looked for an open source CNC machine which would be able to mill wood (mostly plywood and MDF), acrylic and maybe even aluminum.

The internet is full of DIY CNC mills, but only a few people publish plans and/or enough technical data. There are some kits, but I didn’t want buy a kit, since I already had many parts for a CNC mill lying around (high torque stepper motors and Pololu A4983 motor drivers from a dead end project of mine, waiting for recycling, a bunch of precision rods from old scanners and printers). Also I love to plan and build stuff by myself.


Eventually I stumbled upon the website of the Mantis CNC mill. This mill is open source and kits are available for sale.

I liked the compact size and use of wood for the main construction. However, there are several things, I don’t like:

  • For my taste, there’s way too much glueing involved in the construction. Although this makes the build process easier, glueing stuff together with epoxy means also there won’t be any chance for adjustments later. They even glue one of the stepper motors to the back of the machine….
  • The Z axis construction is made for a -glued in- custom spindle. No easy way to attach other tools, like a Dremel or maybe an extruder on the machine.
  • The Mantis’ work area was a little bit too small for me.
  • The whole construction and plans are in imperial measure. No offense, but I’m a very happy user of the metric system.

That said, I used the Mantis plans as base for my own, custom plans.

I slightly scaled the parts up and “rounded” them to the next metric measure. The 10″x4″ build platform became a 300 x 150 mm build platform and so on.

In order to keep track of the changed parts and the construction as a whole, I constructed the machine in a 3D application:


I also changed the construction of the Z axis in order to provide a more versatile base for different tools. The Z stepper motor sits on top of the Z axis in my construction (and isn’t glued to the back of the X axis plate).


Based on my 3D drawing, I wrote a BOM for the wooden parts. I use 16mm MDF and the whole material cost less than 10€ in my local hardware store (already cut to size).


Here are some pictures from the build process. Building a LCD (and a micro joystick switch) directly into the machine was part of the plan from the beginning.


One thing, I wasn’t sure about were the bushings. Since they uses bush bearings in the original Mantis construction, I ordered some sintered bronze bushings together with the acme threads.

Despite all precautions and match drilling all holes for the precision rods, I wasn’t very happy with the results when first assembling the x axis.


The slide was much too sluggish (see following video). So I decided to go back to proven mechanics and designed Mendel-style linear bearings for all three axis.


Since there isn’t too much room for the bearings (especially at the Z axis), I designed the printed ball bearing retainers as low profile as possible. The “inner” ball bearings are halfway sunk in the base plate.



This not only keeps the assembly as low as possible, but also guarantees the same height reference for the fixed bearings (the axle sits directly on the plate). All upper bearings are adjustable.

Here’s a short video with a comparison of both bearing styles. I guess, bush bearings are only usable when the whole construction is manufactured by CNC machines…

I published the STL files for the linear bearings on

Build platform

The build platform is (same as in the Mantis construction) a sandwich of two boards of the same size. The linear bearings and the acme rod are attached to the lower board. That way, the upper board can be easily replaced in case of an accident or maybe if a heated build platform is needed in the future.

I drilled a grid of 4mm holes in the upper board, each with its own drive-in nut. The grid then can be used to easily attach a workpiece on the build platform by using scew clamps or directly bolting the piece down.



The tool

As spindle, I attached my Dremel to the Z stage. I printed an upper and lower clamp on my Makerbot Cupcake, which hold the Dremel gentle and tight on the Z axis.


The electronics

For a while I planned to use RAMPS electronics from UltiMachine to drive the three steppers (and any extruders in the future). But ever since I looked in the store, the PCB was out of stock. In addition to that, I already had a Seeeduino Mega lying around, which I liked to use for this job and which is not shield compatible with the Arduino Mega. Finally I needed some custom connections for the LCD, the joystick switch and the emergency stop button, I built into the mill.

So I decided to go for my own, custom RAMPS shield for the Seeeduino Mega.

Based on the open source design of the UltiMachine RAMPS electronics, I started to design the new Seeeduino shield.



The board design is far from finished yet! Meanwhile I started to put the electronics onto a big breadboard on the backside of the mill.


As soon as the circuits are working correctly and the schematics are fully tested, I’ll manufacture the final shield PCB. But this might still take a while and I’ll definitely write at least one other blog post about this topic.

So far, the breadboard contains only three Pololu A4983 boards for the steppers, as well as connectors for three endstop switches and some additional components for the LCD and switches.

I currently use mechanical endstops for the three axes. I’m still not sure if I’m happy with these. Maybe I’ll switch to opto endstops later, since I have the feeling, that they are much more accurate.


The software

I used the newest version of the RepRap firmware as a starting point. I very much like the acceleration feature for the cartesian system. Originally I thought I’d use the RepRap firmware more or less unchanged and just add code for the LCD and switches.

But it turned out quickly, that I’d need to make bigger changes to the firmware in order to implement some features I planned (e.g. jogging with the joystick switch etc.).

One thing came to another, I started to re-write some parts, added some code in the G-Code parser which is important for milling (G2, G3, G81 etc.). Then I started to throw out obsolete code and to redesign other code in order to implement stuff more object oriented…

Long story short, the firmware tuns out to be more based on the RepRap firmware than to be just an extended variant.

I have plans to go even further and to try to implement G41/G42 functionality (Cutter Radius Compensation). In order to do so, the G-Code parser needs a lot changes and extended functionality.

In order to keep my focus on the functionality important for milling, all 5D-extruder support is currently removed from the firmware. I’ll definitely add this code again later, when the milling code is working.

I’ll also publish my version of the firmware as open source, of course. But I’ll need some more time to further stabilize and clean up the code  before that. Please stay tuned.

The movie

Finally, here’s a video of the mill’s first real cut and a short demo of the LCD menu system of the current firmware:

Getting Support


I need a tripod stand for my iPhone 4.

Fortunately, there’s a nice design for one of these, ready for download on Thingiverse:

A minor problem with this object is, that Bradley Rigdon, the creator of this design, owns a couple of Dimension 3D printers. Since these professional printers automatically print with support material, large overhangs and such are no problem for them. And there are some large overhangs in the iPhone 4 tripod design…

It’s no secret, that the standard MakerBot Cupcake doesn’t have a second extruder for printing support material. Nonetheless, some people (including yours truly) recently started experimenting with Skeinforge’s built-in support stucture feature. It turns out, that these support structures don’t necessarily need a second extruder with dedicated support material.

Keen to experiment, I turned on the support feature in Skeinforge and sliced the downloaded STL (BTW, which needed resizing by factor 25.4, since the original STL was exported in inches).


In the relatively old version of Skeinforge, I still use for several reasons (v2009-11-06), the support settings are part of the Raft preferences:

Bildschirmfoto 2010-10-23 um 21.46.28.png

I printed the generated gcode in white ABS with my -more or less- standard MakerBot.

Removing the support structures after printing is relatively easy as long as you choose “Support on Exterior only” in the above settings.

Besides the relative coarse bottom side (which was likely more a problem with some Skeinforge settings unrelated to the support structure), the main problem with the printed object was the tiny wall on one side. You’ll know which wall I mean and what’s the problem when you compare the following picture with the object’s STL-screenshot above:


One thing I learned in the last year, printing 3D objects with my MakerBot: avoid printing single, tall, thin walls in upright position, unless you want to break them away later (intensionally or unintensionally…).

The missing wall on the above object broke away when I tried to attach the object to my iPhone for the first time.

The easiest solution for such a problem is usually to print the object “on its side”, i.e. rotate the whole thing by 90°:

Bildschirmfoto 2010-10-23 um 22.23.31.png

But in this case you’d run right into the next problem: Now you’d need to manage the 90° overhang (marked with the red circle). In order to use Skeinforge’s support structures for that, you’d need to switch the “Support Material Choice” setting to “Support Everywhere” (instead of “Support on Exterior only”). But removing those “inside” supports after printing isn’t easy and the support structures would likely degrade the surface of the rail on the upper side of the object, critical for the fit of the iPhone.

My solution for the dilemma was to print the object only slightly rotated:


I started with 30° rotation from the upright orientation. Since I used support structures anyway, the weird angle shouldn’t be a problem to print. By choosing a rotation angle smaller than 45° the resulting additional overhangs of the former vertical walls shouldn’t need additional support (Skeinforge automatically don’t generate support structures for those overhangs; see “Support Minimum Angle” in the above settings).

By rotating the object, the iffy wall is now also sliced in an angle, which greatly improves its stability:

Bildschirmfoto 2010-10-23 um 22.45.43.png

The print looked ok on first sight…


… and the stability of the printed object was indeed greatly improved.

But unfortunately, printing the 30° overhangs didn’t work very well:


I did some additional adjustments in the Skeinforge settings:

Bildschirmfoto 2010-10-23 um 22.55.32.png

To give the curved lower part more plastic to stick on, I changed the “Thread Sequence Choice” (Fill Preferences) from the default value “Perimeter > Loops > Infill” to “Loops > Infill > Perimeter”.

I also reduced the rotation of the object from 30° down to 15°, which still should be enough to give the front wall sufficient stability:


This time, the print looked good:

The refined settings seem to do the trick.

Here’s the printed part after breaking away the support material:

And here’s a comparison of all three different prints (left to right: 15°, 30°, 0°):


The stability-improved vertical (diagonal) structure  (from left to right: 0°, 30°, 15°):


One more lineup (left to right: 0°,  30°, 15°):


And now to an interesting question: Does the part work?

See for yourself:

Looking good!

After the successful first test, I coated the whole thing with liquid rubber (Plasti Dip):


The rubber coating isn’t needed for grip (of the iPhone). But I thought, a little bit color couldn’t hurt. And also I like the rubbery texture on printed objects :)