Archive for the 'CAM' Category

The Delta Router + 4th Axis



Every year I make a new thing for ORD Camp.  This year I made a delta router.  The ORD contraptions I make, have one primary function; to spark conversation.  This means they have to be interesting, a little whimsical and a little cool looking.  They are generally rather small for portability and to keep the costs down. Practicality and suitability are way down the list, so go ahead and snark away.  If you do, you are missing the point.

This year there happened to be a session on creativity with constraints.  The question we debated for an hour was, do constraints help or hurt the creative process. Constraints can move you out of your comfort zone and maybe that is a big part of creativity.  The topic was perfect for me because I had intentionally challenged myself with a few constraints on this project.

  • Use non captive stepper motors. Not a lot of people have seen these in use, they are cool to watch and they simplify the design.
  • Limit myself to 3 unique fabicated parts.  People keep thinking deltas are more complicated than .  This was to demonstrate the simplicity.  Go ahead, design a Cartesian machine with only 3 unique fabricated parts.  All other parts had to be commonly available parts.
  • Use stock reprap software.  I could only touch the configuration files.


I met all the constraints except for one.  I designed a common top and bottom bulkhead, but at machining time I decided it was silly to to spend the time to add holes only used on the top to the bottom and the same with the top.  So the four unique fabricated parts are the top, the bottom, the carriages and the end effector.  The top and bottom are 3/4 inch Baltic birch.  The other fabricated parts are 3mm carbon fiber.  All parts were setup and cut in less than 30 minutes on my homemade CNC router.  A 3D STEP of my design is here.


The vertical rails are MakerSlide.  I used steel V wheels because I had them laying around.  The rest of the mechanical parts are Actobotics parts from Servo City.  I thought they were an awesome discovery and then the next day I saw that Sparkfun started to sell them.  They really worked out great.  My only complaint is that they are imperial thread based parts.  I prefer all metric on my designs.

The non captive stepper motors are really cool.  The thread is a 2 start 8mm trapoidal, so it moves 4mm per rev.  They are quite fast and strong.  I custom ordered them at Robot Digg.  The only drawback is you cannot move them by hand.  You can’t spin the rod or the motor.  In this design they are a little vulnerable too.  If they get banged hard they could bend.

The linkages are Acrobotics heavy duty ball ends attached to some standoffs I got at McMaster.


I used some mini arcade style switches for the limit switches.  They are pretty nice snap acting switches, but probably a little less accurate than microswitches.  I chose them because they would be super simple to mount without adding mounting brackets.


The controller is my favorite reprap controller; the Azteeg X3.



The spindle is a brushless DC hobby motor.  It is a Turnigy Trackstar.  The speed controller is a Turnigy Plush 30.  The shaft is 1/8″.  I used a simple shaft coupler to mount the bit.  This added a lot of vibration so the motor could not run at full speed, but that was OK becuase the full speed is close to 30,000 RPM and 550Watts!.  I eventually manually balanced the coupler and it runs a lot smoother now.  I did it by drilling through the existing set screw holes to the other side with a small bit.  I enlarged that hole until it was balanced.





4th Axis


Later when I got home, I thought it would be cool to add a rotary axis to it.  The challenge was going to be using the extruder motor logic for the rotary axis.  I had this attachment laying around that was bought from eBay a few months ago.  A typical 4 axis machine simply disables one of the axes while using the rotary.  That is not possible with a delta, so all 4 axes need to run at the same time.  It is quite fun to watch.



It was perfect because it was so small.  It has a 6:1 reduction gear inside.  I made a simple base for it that would allow it to be quickly mounted to the router.



Firmware Changes.

The firmware changes to Repetier were pretty simple.  Extruders use millimeters as the feed unit, so I just converted that to degrees.  The motor is 200 steps/rev with 16x microstepping plus 6: 1 gear reduction.  This yielded 53.333 steps per degree.   I changed the safe extruding temperature to a very low value and then just wired a 100k resistor across the thermistor pins so it read a constant value above the safe temperature.

 CAM Software

I don’t have any high end CAM software that does anything really cool on a rotary.  I did have an evaluation copy of DeskProto, but that timed out.  I did have Vectric V Carve that does have a wrapped rotary feature.  That would be good enough to do my Hello World project.  I had to write a post processor for it.  I basically hacked the Mach3 wrapped rotary post processor.  I had to make it really simple and tell it convert “A” moves to “E” moves.  There were a couple other changes too. The post processor is here.


Changes and Issues

  • I really need a tail stock to support the stock and help set up the job level.


  • The feed rate on rotary axes are tricky because millimeters per minute is quite different than degrees per minute and there is no way to deal with that in GCode.  The actual feed rate through the material depends on the radius (Z).  Programs like Mach3 can compensate for it.   I could really hack the firmware or maybe write a post post processor to compensate the speed based on the Z.
  • I need to get some real software to some interesting carving with this thing.


First Job Video

Go Deltas!





RepRap Brushless DC Spindle Control

I need a tiny spindle for a CNC Build Club project I am working on.  I decided to use a Brushless DC  Hobby motor.  These motors have a huge amount of power for their size and cost.   I want the machine to be able to turn the spindle on and set the speed via GCode so I spent some time testing this out.

You need to power these motor with special 3 phase controller.  These are typically controlled like a hobby servo, so the interface is a little different than a typical spindle motor.  The machine is going to be a delta type machine, so I will be using RepRap firmware.  Marlin was selected over Repetier because it has built in servo control.

Part Used

The motor is a Turnigy Track Star motor.  I like it because it is sealed and air cooled and it is 550W.  That is over 2/3hp.


This is the Brushless Electronic Speed Control (BESC) I used.  It is a Turnigy Plush 30A.  It has a battery eliminator circuit, which is basically a 5V output to eliminate the need for a battery for the RF receiver and servos.  This is the thin red wire on the 3 wire connector.  This should not be used because the Arduino has it’s own 5V supply.



The controller I used is an Azteeg X3.


 Hobby Servo PWM

Hobby servos use pulse width to control the position of the servo.  You basically use a pulse from about 1ms (off) to 2ms (full speed) to control the servo.  This must be repeated about every 20ms.



The BESC has a safety feature where you must turn it on in a special sequence.  You must set the pulse length to minumum (1ms), turn on the motor power supply, wait until you hear the startup beeps, then a few more beeps which tell you the count of batteries connected.  You can then vary the pulse length to control the speed.

Basic Arduino Control.



The first thing I worked on was basic manual control using an Arduino.  I started with the “Servo…Knob” example that comes the Arduino IDE.  I modified it a bit to match the pins I was using.  It reads the voltage on a potentiometer and uses the value to set the pulse length.  The sequence was, turn the knob to the minimum, turn on the power supply, wait for the startup beeps, then use the pot to control the speed.  At first it did not work.  I looked at the servo library code and found it used 540 microseconds for the minimum pulse and 2400 microseconds for the maximum pulse length.  I switched from myservo.write(val) to myservo.writeMicroseconds(val) to use the actual time values and it worked.

Here is the code.

// based on the servo...knob example.
#include <Servo.h> 

// define the min and max because the servo library has a wider range 
#define MIN_PULSE 1000
#define MAX_PULSE 2000

Servo myservo; // create servo object to control a servo 

int potpin = 0; // analog pin used to connect the pot
int val; // variable to read the value from the analog pin 

void setup() 
 myservo.attach(3); // attaches the servo on pin 3


void loop() 
 val = analogRead(potpin); // reads potentiometer (value between 0 and 1023) 
 val = map(val, 0, 1023, MIN_PULSE, MAX_PULSE); // scale between 1ms and 2ms
 Serial.println(val); // show the values
 myservo.writeMicroseconds(val); // sets the servo using microseconds 
 delay(20); // wait a bit

Automatic Startup Using Arduino

The next step was to try semi-automate the startup sequence.  In the previous step, I found that holding the pulse to the minimum length for about 4 seconds was long enough.  This code would test that.  After startup the Arduino output the minimum pulse, lit an LED as a signal to turn on the power supply, then wait for 4 seconds.

// based on the servo...knob example.
#include <Servo.h> 

// define the min and max because the servo library has a wider range 
#define MIN_PULSE 1000
#define MAX_PULSE 2000

Servo myservo; // create servo object to control a servo 

int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin 
int led = 13; // led pin

void setup() 
 pinMode (led, OUTPUT);

 myservo.attach(3); // attaches the servo on pin 3 to the servo object
 delay(1000); // wait a bit for the human to get ready

 myservo.writeMicroseconds(MIN_PULSE); // go to the low end
 digitalWrite(led, HIGH); // signal p/s turn on
 delay(4000); // wait a bit
 digitalWrite(led, LOW); // ok to control with pot

void loop() 
 val = analogRead(potpin); 
 val = map(val, 0, 1023, MIN_PULSE, MAX_PULSE); 

RepRap Control


The plan was to use the servo control feature to adjust the speed and the heater control circuit to control the power. Here are the changes I had to make to Marlin. Search for these lines in the files indicated and change them.

Overview: The temp sensors are all disabled.  You need to remove HEATER_BED_PIN from the array of SENSITIVE_PINS or the M42 command will ignore it.  Setup what pin you want for the servo output.  I changed the default pulses to comply with what the BESC wanted.

in file configuration.h
#define MOTHERBOARD 67  //azteeg X3
#define TEMP_SENSOR_0 0
#define TEMP_SENSOR_1 0
#define TEMP_SENSOR_2 0
in file pins.h
#define SERVO0_PIN         31
in file servo.h
#define MIN_PULSE_WIDTH 1000 // the shortest pulse sent to a servo
#define MAX_PULSE_WIDTH 2000 // the longest pulse sent to a servo
#define DEFAULT_PULSE_WIDTH 1000 // default pulse width

I used Repetier host to talk to the controller.   Here is the GCode I used to test.  It runs the motor for 10 seconds.

; set speed to zero
M280 P0 S0
; power up speed controller
M42 P8 S254
; wait for startup tones
G4 P4000
; go to full speed
M280 P0 S180
; run for 10 secs
G4 P10000
; turn speed to 0
M280 P0 S0
; turn off power
M42 P8 S0


It turns out I was not able to get the bed heater circuit to directly control the power to the BESC.  The bed heater circuit switches the ground side of the the circuit and the positive voltage is always present.  The controller would not turn off.  It was using the servo ground wire, which is probably not rated for that.  I had to find a way to switch the positive voltage.


The easiest way to do this was with a relay.  I wired an automotive relay to the bed circuit.  I put a flyback diode across the relay to protect the bed heater circuit.  It all works perfectly now.


12-/27/2013 I tried hooking both grounds to the heater power circuit and it pulled ground from the servo signal pin.  That can’t be good for the BESC or the CPU, so back the the ugly relay.


Camera Slider Controller Hack


I have been having fun with my camera slider controller.  It is a cool, little, general purpose motion and camera controller that will soon to go on sale at Inventables. Taking a picture is very easy.  You just plug the camera into it and run the takePicture() function.  It has a lot of spare I/O pins that can be used for some cool hacks.

I always thought it would be cool to take a time lapse movie of a 3D print, but do it exactly one layer per frame and have the picture be taken at the exact same location every time so the print appears to grow out of thin air.  I know people have done this before, and I could probably hack the circuit right onto the printer controller, but camera slider controller was ready to go with the circuit and connectors all ready to go.  With less than ten minutes of coding and making a cable, I was ready to go.

GCode Hacking

The first task was hacking the GCode to output a a signal I could read remotely.  Kisslicer has a feature where you can add a few lines of Gcode every “N” layers.  I added the following GCode.  Note the “1″ in the layers box.  This means do it every layer.




G1 X0 Y0 means move to 0,0

G4 P500 means dwell for 500 milliseconds.  This was added because the next command was happening before the move completed.  I think this has to do with the way commands are buffered.  I think there is a more elegant fix for this, but adding a little delay here was a quick fix.

M42 P11 S255 means set I/O pin 11 to full on (255  is max).  Pin 11 is the first of the “servo” pins on my RAMPS controller.  This three pin connector would map directly to the servo connector on the camera controller.

G4 P1000 is a 1 second delay.  I had my DSLR on “auto” so it would need to focus for each shot, so I gave a little extra time.

M42 P11 S0 turns pin 11 off.

I ran a few test layers with my volt meter hooked up to the connector and it looked great.

Camera Slider Controller Hacking

The controller has 2 servo connectors that are intended to be used for hobby servos in a pan and tilt arrangement.  The signal pin on the connector can also be used as and input.  The code is simply going to watch for that pin to go high.  When it does it will display the next layer number and take the picture


Arduino Code

In the setup() section you need to make the PIN_SERVO_1 pin an input because that is connected to the printer controller.

pinMode(PIN_SERVO_1, INPUT);

The loop() section looks for the PIN_SERVO_1 pin to go high. When it does the layer number is incrememented the picture is taken and the LCD is updated. The camSignalRead flag is set so we don’t go read the same pulse more than once. The flag is cleared as soon as the signal

void loop() {

   if (digitalRead(PIN_SERVO_1) == HIGH) {
     if (!camSignalRead) { // make sure we read once per pulse
       camSignalRead = true; // 

       lcd.cursorTo(2, 0);
       sprintf(sVal, "Layer %d", layerNumber);


   else {
     camSignalRead = false; //reset this. the pulse is over 



Simply connect the signal pin (D11) on the servo 1 connector of the printer controller to the signal pin on the servo 1 (J7) connector of the camera slider controller. You also need to connect together a ground pin on each controller.






Camera Setup

I setup my DSLR on fully automatic and disabled the flash. I am sure the movie would have been better if I manually focused and locked the speed and aperture settings, but I just wanted a quick result. The controller first sends a focus signal and then a shutter signal. The focus signal acts like the half button push you do to focus most cameras.

The Print

The printing was done on the Quantum Delta printer.  I used my CNC Ninja Squirrel as the test print. It was scaled to 50mm tall. At at 0.25mm layer height, that gave 200 layers. The print took about 45 minutes with the added delays. It was run in a busy room at Pumping Station One so there was a lot of activity in the background and some light level changes.



The Result

Click here if the video is not displayed below.


CNC Translator for BeagleBone

The Rosseta Bone is a “universal” CNC translator for BeagleBone Black.

Rosetta Bone

The BeagleBone is awesome little controller.  It is a lot like the Raspberry Pi, but it has one special feature that makes it viable for CNC.  It is the PRU.  This is Programmable Realtime Unit.  This a part of the CPU that runs separately from the OS and gives it the critical timing required for smooth stepper motor control.  People have tapped into this and LinuxCNC to make a real embedded version of LinuxCNC.  Add in all the other capabilities like HDMI, keyboard, mouse networking, etc and things get amazing really fast.


I bought the BeagleBone Black which is the second generation BeagleBone.  It has more features than the original “white” version and actually costs less.  There are several CNC capes for the BeagleBone, like the BeBoPr or Replicape, but they are expensive, can be hard to get and some have issues with pinout changes that came with the BeagleBone Black.

BeagleBone CNC

Continue reading ‘CNC Translator for BeagleBone’

Why Are My Laser Cut Edges Not Straight?

People often ask me  why the edges of their laser cuts are not square.  The laser beam is being focused at an angle to a spot, so no cut can be perfectly square, but there are things that can make it worse.  Note: All of the images are exaggerated to show the affects.

You first need to understand how the lens works.  Laser cutters use a collimating lens.  This means it takes parallel rays from the beam and focuses them to a single spot.  For a couple of complicated physics reasons, it  can never do this perfectly, but it should do it close enough not to be a factor in this discussion.  Below is a picture of a collimating lens.  A typical beam width is usually about 5mm-8mm and a typical lens is about 20mm-25mm wide.

You can see that the beam forms an hour glass shape.  This can cause a little angle.  With a 6mm wide lens and a 50mm focal length, this angle is typically 3-4 degrees.


To get the least affect on your part, you might want to center the focus in the middle of your material.

If you are getting a bigger angle than a few degrees, it is more likely because the beam is not in the center of the lens.  The lens will still focus to that same point, but the hour glass is at quite an angle to your work piece.

This type of angle is offset in one direction, so you may see it more in certain directions of travel.  If the beam is moving from right to left in the above image, you might not notice the problem at all.

Does a longer focal length help?  It can, but due to the complicated physics issues I referred to earlier, a longer focal length creates a larger spot size, which reduces power density.  See this calculator.

Alibre is Now Geomagic

3D Systems recently acquired Geomagic.  Several years ago they acquired Alibre.  Alibre is a parametric CAD program.  It appears that they are simply re-branding the existing version of Alibre as Geomagic, but will incorporate feature of the Geomagic product line over time.  Here is the basic product line.

  • Geomagic Design Expert $1999
  • Geomagic Design Pro $999
  • Geomagic Design Personal $199

I am also pretty sure that Cubify Invent @ $49 is a further simplified version of “Personal” that allows you to work at the part only level.  A comparison of the upper levels is here.

I have used Alibre and Cubify Invent and find them to be quite capable.  Some day I may loose my easy check out access to Pro/Engineer and these products are on the radar as possible solutions.  I found the even Cubify invent could do a few little tricks that are a pain in Pro/E.


Intro to V Carving

In a couple weeks we are going to do a CNC V Carving night at Pumping Station One.  We hope to fabricate a number of designs on the CNC router.  This blog post will serve as a basic introduction to the concept and will help people get artwork ready.

What Can V Carving Do?

V Carving uses a V shaped bit to to “carve” a design into the material.  Because the bit has a v shape, you can cut narrow shapes with the tip or wider shapes near the bottom.

You can even cut shapes wider than the widest part of the bit by doing multiple passes of the bit.  The depth of the cut is proportional to width of the cut, so you need to make sure your material is thick enough.  If you have very wide areas, you can set a depth limit and you can make that area have a flat bottom with a second flat bit.

Normally routers cannot cut square inside corners because you are cutting with a round bit.  V Carving can get around this limitation because the bit can rise up into the corners until it gets to the zero radius tip.

Finishing Tricks

V Carvings can look great simply cut in the natural material, but they can really pop when you put a contrasting finish in the carved areas.  This is a time consuming process and can be difficult to do well.

You can often shortcut this process by using masking materials.  You start by applying a background finish to the work piece.  This is then masked with tape or specialized masking material.  The router then cuts through that as it is cutting the design.  Now, only the cut area is exposed and you can simply spray paint the exposed area.  If the design has multiple colors you can cut one color, paint, remask and repeat the process.

The files should in in DXf, DWG, AI, EPS or PDF  format.  Many programs like InkScape and CorelDRAW can output these formats.  If you have hi resolution bitmap, some of these programs can convert to a vector format.  Feel free to try that, but help with that will be beyond the scope of the session.

The quality of the masking material comes into play with very fine details.  If your design will leave tiny isolated dots of masking, some materials may not stick well enough and break free during cutting.  If that happens, you can manually touch up those areas later.  I like to use Avery Paint Mask, but plain masking tape, adhesive shelving paper and materials for vinyl cutters also work.

What is good artwork to start with

  • Avoid very thin lines lines.  The  material needs to be needs to be perfectly flat and consistently thick for this.
  • Very large areas to cut will take a long time, so avoid them for this session.
  • Multiple colors.  Multiple colors is OK, be each color needs to be separated from the other color so there is masked uncut area between them.

This logo would work.  The red would be the base material and all other colors would be cut and colored.

This one would be very hard to do because of the adjacent colors.

How to bring the artwork to the session.

To save time, the artwork should be as ready to import as possible.  Problem artworks will be pushed to the back of the queue and might not get cut.

The artwork needs to be in a digital, vector format.  By digital I mean you can sent the file electronically.  Vector files are created with actual geometry.  Lines are lines and not a string of pixels.  Scans and photographs are not usable.  If you zoom in and the image gets pixelated, it is not ready to use.  The shapes also need to be closed.  If you have a square, for example, all the corners need to meet or the software cannot determine inside from outside.  Tiny gaps can be closed in the CAM software, but if you can see them, close them.

Try not to be too complex or have large cut areas.  These will take a long time and will limit how many people we can accommodate in one session.  We can still create G-Code, but you many need to cut it at a later date.

If there is time I my cut small PS:One snowflakes for the people who did not bring any artwork.


The idea material is a smooth, pre-finished piece of wood.  It needs to be as least as deep as 1/2 the width of your widest feature if you are not planning a flat bottom.  The material should be as flat and consistently thick as possible or the results can be distorted, because the depth of the cut is so critical.  Avoid oily or wet finishes because the mask material may not stick well.  Plywood does not look well and often interior layers have voids.


Image From


Image from:

Web Page G-code Viewer

Try this Web Page G-code Viewer

I met programmer and maker, Joe Walnes, through a few local Chicago maker groups.  He  showed me a really cool web based G-code viewer he wrote to preview his 3D printer G-code.   It used WebGL for super smooth motion of the model.  It also allowed you to drag and drop your own files right into the page.  It worked great, but really only worked with 3D printer G-code.  He posted the code on GitHub.

I have a couple programming projects in the works that need a G-code viewer, so I decided to update his program to handle more types of programs.  Joe had a really nice UI and design pattern for the code, so I left that  alone.  He also helped me out with a few issues as I worked.

G-code Parser

A parser is a bit of code that breaks down text into tokens, or the basic grammer of the G-code.  He was working with very well formatted G-code so his parser was pretty simple.

G1 X5 Y5 Z6 E0.124

I was dealing with really Fugly lines of G-Code like this, so I needed to totally rewrite the parser.


Graphics Generation

Reprap 3D printers basically use G1 (straight moves) for everything.   I needed to add the code to handle G2 and G3 (arc moves).  This was a little tricky because there are no arcs in WebGL.  I had to break them into small line segments.   Joe also treated each Z level as a separate layer.  That is nice for printers, but not for general G-code.  I changed that and the way the color of the lines worked.

A Work in Progress.

It works on all my CAM generated 3D printer and CNC router G-code, but I want to add code to deal with more advanced features that are often hand coded like incremental moves, machine offsets, parameters, math functions and subroutines.

I will post the source code soon.


You need a WebGL capable browser like Chrome, Opera or Firefox.  I hard to turn on WebGL  in my Firefox.  I got it to run on my Android phone in Opera, but could not spin/zoom the model with the screen controls.

To view your own files, just drag and drop the G-code into the browser.  It will use the zoom settings for the previous model, so if you drop something that is a different size or offset to the side you may need to zoom around to find it.


Position Correcting Hand Tools

A post on the PS:One Hackerspace news group pointed me to this awesome digitally correcting hand tool.  It allows you to cut complex shapes by roughly following an outline.

The tool is attached to a hand held frame.  Actuators within the frame can move the tool to compensate for errors you would make when trying to cut a complex shape.

A high contrast pattern is placed on the work piece.  They are the horizontal bands of shapes in the image above.  The tool creates an internal map of the work piece using a camera.  It can then accurately determine it’s location anywhere on the work piece without the drift that might occur using incremental positioning sensors.  The outline of the cut to be made is shown on the screen.  The location of the tool center is also shown on the screen.  You only need to follow the line within the correction limits of the tool.  The tool digitally corrects to produce remarkably good results.

This same idea could be applied to a lot of different 2D fabrication tools.  There is a very comprehensive paper here showing all the details.


Thermal Friction Drilling

Thermal friction drilling very cool (hot actually) drilling technique that is especially useful for creating tapped holes in thin wall materials. The pressure and friction of a specially designed conical bit heats the material to a plastic state and forms it into a hole that has 3-4 times the depth of the wall thickness. It looks like it is best for hollow tubing because the back side of the hole is a little rough. The bit forms the top of the hole into a flat bushing which is perfect for fastening to round tube.

The bit is made from carbide and is held in a special holder/collet assembly that isolates the heat generated on the tool from getting to the machine. Lubrication is required to prevent the material from welding to the bit. Any machine that meet the speed and power requirments, including drill presses can use this technique. According to the web site a 6mm hole would require about 2500-31100 RPM at 1.2kW (1.6 hp).

Most of the thermal drilling companies recommend thread forming taps. These taps form the threads by displacing the metal rather than cutting it. The resulting threads are smoother and stronger than cut threads. I have used them on conventionally drilled holes. The pilot hole needs to be slightly larger than a standard pilot hole. The taps are a lot stronger because they do not have flutes. The can be run faster and don’t bind up with chips. It looks like the combination of thermal drilling and thread form taps creates a very clean operation.