Tuesday 29 December 2009

Cooking with HydraRaptor

I needed to assemble some PCBs recently, so I set about making a temperature controller for my SMT oven.

First I had to replace the solid state relay on HydraRaptor.

Solid state relays are triacs with an optically coupled input, zero crossing switching and built in snubbers. I used it for controlling a vacuum cleaner when milling. It was massively overrated but for some reason it failed some time ago. I replaced it with a cheaper one and added a varistor across the mains input to kill any transients, as that is the only explanation I can think of for the old one's demise.

The next task was to write a simple graphing program in Python. I tested it by plotting the response of my extruder heater.

With bang-bang control it swings +/- 2°C with a cycle time of about ten seconds.

Here is the code for the graph: -
from Tkinter import *

class Axis:
def __init__(self, min, max, minor, major, scale):
self.scale = scale
self.min = min
self.max = max
self.minor = minor
self.major = major

class Graph:
def __init__(self, xAxis, yAxis):
self.xAxis = xAxis
self.yAxis = yAxis
self.root = Tk()
self.last_x = None
frame = Frame(self.root)
xmin = xAxis.min * xAxis.scale
xmax = xAxis.max * xAxis.scale
ymin = yAxis.min * yAxis.scale
ymax = yAxis.max * yAxis.scale
width = (xmax - xmin) + 30
height = (ymax - ymin) + 20
# X axis
self.canvas = Canvas(frame, width = width, height = height, background = "white")
for x in range(xmin, xmax + 1, xAxis.minor * xAxis.scale):
self.canvas.create_line(x, ymin, x, ymax, fill = "grey")
for x in range(xmin, xmax + 1, xAxis.major * xAxis.scale):
self.canvas.create_line(x, ymin, x, ymax, fill = "black")
if x == xmin:
anchor = "nw"
anchor = "n"
self.canvas.create_text((x, ymax), text = x / xAxis.scale, anchor = anchor)
# Y axis
for y in range(ymin, ymax + 1, yAxis.minor * yAxis.scale):
self.canvas.create_line(xmin, y, xmax, y, fill = "grey")
for y in range(ymin, ymax + 1, yAxis.major * yAxis.scale):
self.canvas.create_line(xmin, y, xmax, y, fill = "black")
if y == ymin:
anchor = "se"
anchor = "e"
self.canvas.create_text((xmin, ymax + ymin - y), text = y / yAxis.scale, anchor = anchor)

def scaleX(self,x):
return x * self.xAxis.scale

def scaleY(self,y):
axis = self.yAxis;
return (axis.max + axis.min - y) * axis.scale

def plot(self, line, colour = "blue"):
for i in range(len(line) - 1):
self.scaleY(line[i+1][1]), fill = colour)

def addPoint(self,p, colour="red"):
x = self.scaleX(p[0])
y = self.scaleY(p[1])
if self.last_x != None:
self.canvas.create_line(self.last_x, self.last_y, x, y, fill = colour)
self.last_x = x
self.last_y = y

def __del__(self):
The third task was to interface a thermocouple to HydraRaptor. I had a spare analogue input, so I attached one of Zach's thermocouple sensor boards to it. I tested it by attaching the thermocouple to a light bulb with Kapton tape. I then ran a program that turned the bulb on and then off and graphed the temperature response.

As you can see there is a ridiculous amount of noise on the readings. I tracked this down to switching noise on HydraRaptor's 5V rail, which is generated by a simple buck converter from a 24V rail. The AD595 datasheet claims that it has a power supply sensitivity of only 10mV/V so the error should have been a small fraction of a °C. All I can assume is that its rejection of high frequency noise is far less than its DC supply rejection. In fact, pretty much all the supply noise appears on the output.

I fixed it by filtering the supply with a simple RC filter consisting of a 1K series resistor and a 22uF capacitor. I fitted these to the thermocouple board in the unused holes intended for an alarm LED and its series resistor. The power is fed in via the anode connection for the LED. It feeds to the supply rail via the 1K fitted in the R1 position. The positive lead of the capacitor goes into the original +5v connection to the board. The negative lead goes to the GND connection together with the ground lead. This mod will be required whenever the 5V rail comes from a switch mode supply rather than a linear regulator.

Here is the much improved graph with the filter fitted: -

The next thing I tried was bang-bang control of the oven to a fixed temperature with the thermocouple attached to a scrap PCB. No great surprise that there is massive overshoot due to the thermal lag caused by the loose coupling of the PCB to the heating elements via air.

It is obvious some form of proportional control is required, so I implemented PWM control of the mains supply to the oven. As triacs don't turn off until the end of the mains cycle there is no point in varying the pulse width in less than 10ms increments (in the UK). So I implemented a simple firmware scheme where I can specify how many 10ms units to be on for out of a total period, also specified in 10ms units. Setting the period to 1 second allows the heating power to be expressed in 1% units.

My original plan was to implement a PID controller, but after examining the required soldering profile I decided a much simpler scheme would probably perform better.

The is a profile for tin-lead solder that I got from an Altera application note. I mainly use leaded solder at home because the lower melt point gives a much bigger margin for error, it wets and flows a lot better, the fumes are less toxic and it doesn't grow tin whiskers.

Looking at the profile you can see the times are not too critical, but the temperatures are. I reasoned I could simply apply fixed powers to get the right temperature gradient until each target temperature was reached. To get round the overshoot problem I simply measured the overshoot and subtracted it from the target temps.

After a little experimenting I got this profile, which looks pretty good to me: -

The blue line is the target profile, red is actual and the green lines show the time at which each target was reached.

The preheat slope and re-flow slope are simply full power until the temperature is equal to the target minus the overshoot. During the first half of the soak period I had to ramp the power from 0 to 50% to get it to turn the first corner without overshoot. When the reflow peak minus the overshoot is reached I simply turn the oven off. When it gets to the cool section I open the oven door.

Here is the code: -
from Hydra import *
from Graph import *

profile = [(10,20), (120,150), (210,180), (250,210), (330, 180), (420, 20)]

slope = 140.0 / 100
overshoot = 15.0
pre_overshoot = 25

preheat_temp = 150.0
soak_temp = 180.0
soak_time = 90.0
reflow_temp = 210.0
melt_temp = 183.0

preheat_slope = (soak_temp - preheat_temp) / soak_time

s_preheat = 1
s_soak = 2
s_reflow = 3
s_cool = 4

def interp(profile, x):
i = 0
while i < len(profile) - 1 and profile[i + 1][0] < x:
i += 1
if i == len(profile) - 1:
return 0
p0 = profile[i]
p1 = profile[i+1]
return p0[1] + (p1[1]-p0[1]) * (x - p0[0]) / (p1[0] - p0[0])

def oven_cook(profile):
hydra = Hydra(True)
xAxis = Axis(min = 0, max = 500, minor = 5, major = 25, scale = 2)
yAxis = Axis(min = 10, max = 250, minor = 5, major = 20, scale = 2)
graph = Graph(xAxis, yAxis)

t = 0
state = s_preheat
m_state = s_preheat
while t < xAxis.max:
temp = hydra.get_temperature()
print temp
graph.addPoint((t, temp))
# Control the power
if state == s_preheat:
if temp >= preheat_temp - pre_overshoot:
hydra.set_mains( 0, 100)
t_soak = t
state = s_soak
elif state == s_soak:
power = (t - t_soak) * 100.0 / soak_time
if power > 50:
power = 50
hydra.set_mains(int(power), 100)
if temp >= soak_temp - overshoot * preheat_slope / slope:
state = s_reflow
elif state == s_reflow:
if temp >= reflow_temp - overshoot:
state = s_cool
# Draw the time lines
if m_state == s_preheat:
if temp >= preheat_temp:
graph.plot([(t,10), (t,temp)], "green")
m_state = s_soak
elif m_state == s_soak:
if temp >= melt_temp:
graph.plot([(t,10), (t,temp)], "green")
m_state = s_reflow
elif m_state == s_reflow:
if temp < melt_temp:
graph.plot([(t,10), (t,temp)], "green")
m_state = s_cool

t += 1


This is the first board I soldered with it: -

All the joints were good. I had a few solder balls and some bridging but that was due to not getting the right amount of paste on each pad. I will be working on a solder paste dispenser soon!

I need to do some more testing to see if the arbitrary algorithm will work with large and small boards and with inner planes, etc. It relies on the overshoot being fairly constant, although with leaded solder you have some leeway.

I also want to play with PID to see if I can get a more general solution. The problem I see is that PID does not look into the future, so will always overshoot somewhat, which is exactly what you don't want. I think rather than using the angular profile, that is impossible for the oven to follow, I would have to put in a rounded curve, such as the one the oven actually follows now, as the control input.

Monday 21 December 2009

Reliable extruder at last?

... well only time will tell but I have now fixed all the teething problems on my "no compromise" extruder.

The first problem was it was leaking plastic. I simply tightened the thread about another quarter turn while hot. The problem started when I had to dismantle it to replace the first resistor that I damaged. When I put it back together I didn't get it tight enough as it is difficult to judge when full of plastic and hot. The seal relies on the fact that the relatively sharp edge of the stainless steel tube can bite into the softer aluminium. It seems to work when tightened enough.

The other problem was that the motor would skip steps in the middle of a build for no apparent reason. It seems the amount of force required to extrude varies wildly for which I have no explanation, but I did find some mechanical issues that were reducing the torque available.

I noticed the gear would always be in the same position when the motor skipped. I found that the grub screw was catching on the bearing housing. You would expect it just to grind the PLA away, but PLA is very hard, so it would take a very long time to do so. I increased the clearance around the wheel hub and also around the moving part of the ball bearings.

Another issue was that both the worm and the gear were slightly off centre on their shafts, so when the two high points coincided they would bind. The hole in the Meccano gear is slightly bigger than the 4mm shaft it is on, not sure why. The hole I drilled in the worm is 5mm but the MakerBot motors have imperial shafts about 4.75mm, so that was even more eccentric. Added to that was the fact that the motor bracket has a slight warp to it angling the shaft down a little. All these things conspired to make it stiff to turn once per revolution. I fixed it by tightening the bottom motor screw tight and slackening the top two a little. That was enough to reliably extrude PLA. Making the motor holes into slots would make things less critical.

Although the extruder was working reliably for PLA I wanted more torque in reserve, so I switched to a higher torque motor more suited to my driver chip. The Lin motor I was using was rated at 0.3Nm holding torque for 2.5A, but my controller can only manage about 1.5A without some better heatsinking. I switched to the Motion Control FL42STH47-1684A-01 which gives 0.43Nm at 1.7A. So at 1.5A I have gone from 0.18Nm to 0.4Nm, i.e. doubled the torque and also got the right shaft diameter to fit the hole I drilled in the worm.

The only downside is that it is bigger and heavier, not really an issue on HydraRaptor.

To give it a thorough test I printed off a couple of Mendel frame vertices.

These take about 2 hours each with 0.4mm filament, 25% fill, double outline at 16mm/s, infill at 32mm/s. Six are needed in total.

I still have to test it with HDPE and PCL., I know it works with ABS.

Sunday 13 December 2009

Motoring on with the A3977

Previously I have blogged about how to set up the Allegro A3977 driver chip to suit a particular motor: -


Most boards I have seen using the A3977 and similar chips just have a current adjustment, with all the other values fixed. Unless you strike lucky this is not going to allow accurate microstepping because the off time and PFD need to be adjusted to suit the motor and supply voltage.

A while ago Zach sent me samples of the prototype V3 stepper controller kits and the NEMA17 motors used on the MakerBot. I made up the board using my SMT oven (pizza oven controlled by HydraRaptor, more on that later).

It works well, but the initial component values are not optimum for the motor, so I decided to make a test bench from the older prototype board that I have been experimenting with. I RepRapped a chassis for it with a panel to mount some switches to vary the timing components.

The chassis is one of the biggest parts I have made, not in volume, but in overall expanse. It warped a little, despite being PLA, heated bed coming soon!

The switch on the left must be at least 20 years old and the one on the right more than 40 but they both still work fine. I save all this junk and eventually it comes in handy.

I also have potentiometers on V
ref and PFD, so together with a bench PSU and a signal generator I can vary every parameter.

I knocked up a label on a 2D printer, it's so much easier to make this sort of thing than it was when the switches were born!

Zach has updated the board to have four preset potentiometers to make it fully adjustable. There are test points to allow the pots to be set to prescribed values with a multi-meter.

Vref and PFD can be measured as a voltage, but the two RT values have to be set by measuring resistance with the power off. My multimeter seems to give accurate readings of these despite them being in circuit. A good tip is to measure the resistance with both polarities and if it reads the same either way round then it is most likely the chip is not affecting the reading.

So here is a list of motors and optimised settings: -

MakerBot Kysan SKU1123029 NEMA17

This is the motor that MakerBot use for the axis drive on the Cupcake, details here. It is actually a 14V motor, so is not ideally suited to being driven from a 12V chopper drive. You normally want the motor voltage to be substantially lower than the supply.

You can't run it at its full current because the duty cycle would tend to 100%. With a fixed off-time, the on-time tends towards infinity and the frequency drops into the audio range.
In practice I found the maximum current at 12V was 0.3A, any higher and the microstepping waveform was distorted on the leading edge due to the current not being able to rise fast enough.

To maintain the sinusoidal waveform at faster step rates requires the current to be lowered further, 0.25A gives a good compromise. It is not a bad idea to under run steppers anyway, otherwise they can get too hot for contact with plastic.

I used the minimum values for CT and RT, i.e. 470pF and 12K to keep the chopping frequency as high as possible, so that it is outside of the audio range. Not only is this a good idea to keep it quiet when idling, but also you want it much higher than your stepping frequency, otherwise they beat with each other.

The values give a minimum frequency of ~17kHz @ 0.3A and a maximum of ~150kHz on the lowest microstep value.
17kHz is not audible to me, but younger people might be able to hear it. There is still some audible noise at the point in the cycle when both coils have similar currents and so similar high frequencies. The beat frequency, which is the difference of the two, is then in the audio range. It isn't anywhere near as loud as when the chopping is in the audio range though.

I can't see any spec for the maximum switching frequency although a couple of parameters are given at less than 50kHz. I suspect 150kHz is a bit on the high side, which would increase switching losses, but with such a low current compared to the rating of the chip I don't think it is a problem.

One problem I had initially was that the switching waveform was unstable. It had cycles with a shorter on-time than required, which let the current fall until it then did a long cycle to catch up. The long cycle gave a low frequency that was back in the audio range.

I think it was a consequence of the motor needing a very short off-time in order to be able to have the duty cycle nearly 100%. The current hardly falls during the off period, so a little noise due to ringing can trigger it to turn off too early. It is not helped by using the minimum blank time. I fixed it by putting 1uF capacitors across the sense resistors.

The PFD value is best set to 100% fast decay with this motor.

It works better with a 24V supply. The full 0.4A current can be achieved (but it gets much hotter of course) and it maintains microstepping accuracy at higher step rates than it does on 12V.

MakerBot Lin SKU4118S-62-07 NEMA17

This is the NEMA17 that MakerBot used to supply. It is at the opposite extreme compared to the one above, i.e. it is a very low voltage motor, only 2V @ 2.5A. As mentioned before, this causes a couple of issues: -
  1. The inductance is so low that the ripple current is significant compared to the lowest current microstep, causing positional errors. OK at 2A, but gets worse with lower currents.
  2. It is difficult to get 2.5A from the A3977 without it overheating. The PCB layout has to be very good. The datasheet recommends 2oz copper and four layers. 2A is no problem and that is the maximum with the 0.25Ω sense resistors fitted to the board.
At 2A the motor runs at about 40°C, so just about OK for use with PLA. The chip gets a lot hotter, about 77°C measured on the ground pins.

I used a value of 56K for RT and 2.1V on PFD. To some extent the optimum PFD value depends on how fast you want it to go.

Motion Control FL42STH47-1684A-01 NEMA17

This is the recommended motor for the Mendel extruder, details here. After buying a couple of these a friend pointed out that Zapp Automation do the same motor with dual shafts for about half the price!

This is a high torque motor so it is longer and heavier than the previous two NEMA17s. Electrically it is in the sweet spot for the A3977 with a 12V supply. The A3977 can easily provide the full current and the switching frequency doesn't have wild fluctuations or drop into the audio range.

When microstepped at 1.7A it gets to about 43°C but the chip only gets to 56°C.

I used 39K for RT and 0V on PFD, i.e. 100% fast decay.

I have high hopes for this motor as a replacement for the one above that is in my extruder currently. It should give me almost twice the torque and has the correct sized shaft, i.e. 5mm. The Lin and Kysan motors both have imperial shaft sizes which caught me out as I drilled the worm gear for 5mm thinking NEMA17 specified that, but it must just be the frame dimensions.

MakerBot Keling KL23H251-24-8B NEMA23

This is the motor I used on my Darwin. It has 8 wires so it can be connected in bipolar serial or parallel. Series has the advantage that the full torque can be achieved with 1.7A which is easily within the range of the A3977. Parallel has one quarter of the inductance so torque will fall off with speed four times slower. To get full torque 3.4A is needed but I found 1A was enough for the X and Y axes. I think Z needs more torque but my z-axis uses different motors so I don't know how much.

An RT value of 56K is fine for currents in the range 1-2A. PFD is best at 0v, i.e. 100% fast decay.


Here is a summary of the motor specifications :-

Motor Resistance Max Current Voltage Max Power Holding Torque Inductance
LIN 4118S-62-07 0.8 Ohm 2.5 A 2.0 V 10.0 W 0.30 Nm
Kysan SKU 1123029 35.0 Ohm 0.4 A 14.0 V 11.2 W 0.26 Nm 44.0 mH
Motion Control FL42STH47-1684A-01 1.7 Ohm 1.7 A 2.8 V 9.5 W 0.43 Nm 2.8 mH
Keling KL23H251-24-8B Series 3.6 Ohm 1.7 A 6.1 V 20.8 W 1.10 Nm 13.2 mH
MakerBot Keling KL23H251-24-8B Parallel 0.9 Ohm 3.4 A 3.1 V 20.8 W 1.10 Nm 3.3 mH

Here are my suggested settings :-

Motor Current Vref CT RT PFD
Kysan SKU 1123029 0.25 – 0.3A 0.5 – 0.6V 470pF 12K 0
LIN 4118S-62-07 1 – 2A 2 – 4V 470pF 56K 2.1V
Motion Control FL42STH47-1684A-01 1 – 1.7A 2 – 3.4V 470pF 39K 0
Keling KL23H251-24-8B Parallel 1 – 2A 2 – 4V 470pF 56K 0

Friday 4 December 2009

Quality control

I RepRapped a doorstop for our new bathroom shower: -

It has a 10mm hole most of the way down and a countersink to take a ~5mm wood screw.

A 2mm self adhesive felt pad covers the screw hole and acts as a shock absorber.

It has a rim around the bottom to prevent it rocking if the base warps or the wall is not flat. To support the bottom of the hole there is a one layer membrane: -

I removed it with a 5mm drill: -

I was quite proud of it but my wife had something more like this in mind: -

I can't print chrome yet, so I will have to go out and buy one, and it has three screws which have to be drilled through the tiles into the wall.

The files are on Thingiverse if you prefer function over form.

Monday 30 November 2009

Pinchless Extruder

While dismantling my extruder for a small mod I accidentally discovered that the worm pulley has so much grip that it will still extrude PLA with the pressure roller removed. It is hard to see on this low quality video but it was extruding 0.4mm filament at 32mm/s.

I will still run it with a roller because it helps to guide it into the tube when self feeding to start a new filament. I also expect softer plastics would need it.

BTW, I have stopped using Vimeo and gone back to YouTube because they added an artificial processing delay unless you pay.

Friday 20 November 2009

Beefed up bracket

When I started reversing my extruder I noticed the motor bracket flexing. Here is a short video showing it in operation: -

BendyExtruder from Nop Head on Vimeo.

It was immediately apparent that I had not made it strong enough.

As the worm gear is about twice the diameter of the threaded pulley the axial force on the motor is about half the force required to push the filament, i.e. a few kilograms. After making a few objects it cracked along the layer where the bearing housing rises out of the flat motor mount.

I designed a new bracket but I was back in a chicken and egg situation with no working extruder to print it. As Erik pointed out you need a Robin Hood / Friar Tuck strategy of having two machines so that one can make replacement parts for the other. I must get my Darwin up and running!

In the meantime I cobbled it back together with some random bits of metal, some tiny G-clamps and tie wraps: -

I made some of the new bracket thicker where I could: 8mm instead of 5mm, which should be ~2.5 times stronger. I also added some ribs and extruded it at 10°C higher temperature.

This one seems solid as a rock, but it did warp a little more. The stronger you make something the more it warps.

Here is a video of it not flexing: -

Wednesday 4 November 2009

No compromise extruder

I have settled on using vitreous enamel resistors embedded in an aluminium block for the heater. I think they are the easiest heater to make and likely to be the most durable. They also work fine with simple bang-bang control, whereas it would appear that the Nichrome and Kapton version requires PID.

One of the aims of my new design is to reduce the amount of molten plastic to minimise ooze. Also less molten plastic means less viscous drag. I also wanted to reduce the thermal mass (to reduce the warm up time) and completely cover the hot part with insulation to allow a fan to blow on the work-piece without cooling the nozzle.

To achieve these aims I switched to a smaller resistor (same resistance but less wattage) and mounted it horizontally rather than vertically. There is some risk that the resistor may fail but I think as long as it has good thermal contact with the aluminium block, so that its outside temperature is less than 240C, then I have a good chance it will last.

The smaller resistor also means a much smaller surface area so less heat is lost. T0 keep the molten filament path as short as possible I combined the heater and the nozzle and made it from one piece of aluminium. That also gives very good thermal coupling between the nozzle tip, the melt chamber, the heater and the thermistor.

I turned it out of a block of aluminium using my manual lathe and a four jaw chuck, but I think I could also mill it out of 12mm bar using HydraRaptor.

A feature that I have used on my previous extruders is to cover as much of the nozzle as possible with PTFE. That stops the filament sticking so that it can be wiped off reliably with a brush. It also insulates the nozzle.

My previous nozzle cap implementations have been turned from PTFE rod. The downside of that is that the working face, that has been cut and faced on the lathe, is not as smooth and slippery as the original stock.

To cover the face of this version I used a 3mm sheet of PTFE so it has the original shiny surface.

Normally PTFE is too slippery to glue so my original plan was to screw it on with some tiny countersunk screws. However, the sheet I bought was etched on the back to allow it to be glued, so I stuck it on with RTV silicone adhesive sold for gluing hinges onto glass oven doors.

To insulate the rest of the heater I milled a cover out of a slice of 25mm PTFE rod.

I normally stick items to be milled onto the back of a floor laminate off-cut using stencil mount spray. I didn't think that was going to work with a PTFE cylindrical slice that is only a little bigger than the finished item. Instead I milled a hole in a piece of 6mm acrylic sheet that was already stuck down with stencil mount. The hole was slightly smaller than the PTFE so I faced it and chamfered it on the lathe and then hammered it in.

I roughed the shape with a 1/8" end mill and then sharpened the internal corners and cut the slots for the resistor leads with a 1mm end mill. I tried to mill the whole thing with a 1mm bit but it snapped due to a build up of burr in the deep pocket. On reflection it was silly to expect to be able to mill deep pockets with a 1mm bit and of course it is much faster to rough it with a bigger bit.

I used my normal technique of taking 0.1mm depth cuts at 16mm. That allows me to mill plastic with no coolant, but I expect I could have made much deeper cuts in PTFE. It mills very nicely, probably because it is soft and has a high melting point and low friction.

I haven't done any milling for a long time so for anybody new to my blog here is my the milling set-up: -

It is simply a Minicraft drill with some very sturdy mounts. The spindle controller I made originally would need its micro replaced as the one I used has a bug in its I2C interface. Instead I just connected it to the spare high current output on my new extruder controller.

The remaining part of the extruder is the stainless steel insulator.

I made the transition zone shorter than the last one I made because I wanted all of the inside of the transition to be tapered. The aluminium sleeve carries away the heat from the cold end of the transition to an aluminium plate that forms the base of the extruder. That in turn carries the heat to the z-axis via an aluminium bracket. I used heatsink compound on the joints.

Here is a view of the bottom half of the extruder: -

And here is a cross section showing the internal details: -

So that was the plan, what could go wrong? Well everything really! The first problem was that the resistor shorted out to the aluminium block. The smaller resistor only has a thin layer of enamel over its wire. Normally I wrap aluminium foil round it to make it a tight fit. I didn't drill the hole big enough so it was a tight fit with only one layer and pushing it in abraded the enamel. The solution would be a bigger hole and more layers of foil, but I just glued it with Cerastil as a quick fix. Of course it only failed after I had fully assembled it and run some heat cycles so I had to strip it down again to fix it. Not easy once the wiring has been added.

The next problem is that it leaks. I think it is because I dropped the extruder when I was building it and bent the thin edge at the end of the stainless steel barrel. That forms the seal with the heater block, so even though I straightened it I think the seal is compromised. I keep tightening it and thinking it is fixed but after hours of operation plastic starts to appear at the bottom of the PTFE cover.

The other problem is that mostly it extrudes very well, I now do the outline at 16mm/s and the infill at 32mm/s, but sometimes the force needed to push the filament gets higher and causes the motor to skip steps, or the bracket to bend so far that the worm gear skips a tooth.

I have made several objects taking between one and two hours and it worked fine. Other times, mainly when I was making small test objects with Erik, it will completely jam. Actually it seems to jam when it is leaking badly, which implies the pressure of the molten plastic is much higher as well as the force to push the filament. The only explanation I can think of is there is an intermittent blockage of the nozzle exit. More investigation required.

Tuesday 3 November 2009

Hacking with Erik

Erik de Bruijn (RepRap evangelist) is in the UK at the moment visiting Salford and Nottingham universities to spread the word. Yesterday he came here to see HydraRaptor. We spent a very interesting afternoon and evening, swapping extruder ideas, comparing objects we had made, and doing a couple of very successful experiments.

The first was something I had been wanting to try for a long time, and that was reversing the extruder drive to stop ooze. My latest extruder (details to follow) has a much smaller melt chamber but still has significant ooze when extruding PLA. Erik is pursuing the Bowden extruder idea, which should benefit even more from reversing.

Because my machine is controlled by Python, rather than g-code, it is very easy to try out things like this. We hacked the code to instantaneously reverse for a short distance very quickly at the end of each filament run. After moving to the start of the next run it fast forwards the same distance that it reversed before resuming the normal flow rate.

I designed a simple test shape to allow the results to be compared. It is a 15mm square with four 5mm towers at each corner. I am not using Enrique's latest Skeinforge which I think would minimise the extruder moves in fresh air to just three per layer. This is with a very old version that does the four outlines and then returns to fill each of them in.

Plenty of hairy bits showing the ooze. These can be removed easily, but what is worse is the object will be missing that amount of plastic making it weaker. This can be extreme with a thin structure which is remote from other parts of the same object.

We tried reversing 1 mm at 8 times the extrusion speed to start with. That worked but was obviously more than was needed. We tried 0.25mm which was too little and settled on 0.5mm, although a lot of that is taken up by the motor bracket flexing. I need to make it stronger.

The result was no hair at all!

A very simple fix for a problem that has used a lot of my time in the last two years.

The second experiment was something Erik wanted to try. He has discovered that PLA is soluble in caustic soda, so potentially could be used as soluble support material for ABS. The question was: can we extrude ABS onto PLA and get it to stick well enough to resist warping?

We made a 5mm thick slab of PLA 20mm wide and 40mm long, 90% fill. On top of that we extruded a 30 x 10 x 20mm block of ABS with a 25% fill.

The ABS looks very glossy so I think it may have some PLA in it. Possibly we needed to flush it through for longer. The ABS block is also a bit scrappy. The reason was that the extruder was playing up. It was leaking plastic, hence the burnt bits and the stepper motor was skipping steps leaving a deficit of plastic. This extruder had never done ABS before and still has some teething problems, but it shows that ABS will bond to PLA well enough to stop it curling.

Next we extruded a block of PLA on top of the ABS.

That also bonded well. The messy bit at the join is because HydraRaptor did its normal circuit of the object that it normally does on the first layer but it was in mid air.

To see how well they were bonded we put the PLA base in a vice and attached a small g-clamp to the PLA block on top. The g-clamp was pulled with a strain gauge until the ABS came way from the base at about 8Kg. Interestingly the first layer outline of the ABS was left on the PLA. That was deposited at 215°C whereas the infill of the first layer was at 195°C. These are the values I use for depositing ABS onto a raft, so in an object layer on top of support it would be 240°C giving a stronger bond. See Erik's writeup and video here.

So PLA looks like a good candidate for supporting ABS. They bond well and PLA is very rigid to resist warping. It can be dissolved with drain cleaner but also I expect it would be easy to peel when softened in hot water.

All in all a good day's hacking.

Sunday 25 October 2009

Worm drive

I have spent a long time trying to make an extruder that is reliable, performs well and is cheap and easy to make. My last design fits most of those criteria but I have doubts about how long it will last because I am putting a lot of torque through the plastic gears of the GM17 gearbox. These doubts were heightened when a tooth snapped in a GM3 gearbox that I have been using for a long time.

I decided to make a new extruder for HydraRaptor concentrating on performance and reliability. I have tried to pull together all the results of my experiments to pick the best solution for each part of the design, regardless of cost and ease of building. The result is a "no compromise" design that has taken me a long time to make. Hopefully it will be reliable so that I can move on to exploring other things.

The design criteria for an extruder for HydraRaptor are a bit different from Darwin. The weight of the extruder is far less important because it is a moving table machine (rather than moving head). The z-axis is a big slab of aluminium so I don't need a heatsink or fan, I can just conduct the heat away.

I found that the best form of traction is a "worm pulley". Screw drive has slightly more grip on softer plastic but is far less mechanically efficient. It also has the nasty habit of making the feedstock rotate in some cases and also generates dust.

The pulley can impart in excess of 100N force on the filament before it slips, so to have the grip as the limiting factor we need a motor that can provide that amount of torque. The pulley has a radius of 6.5mm so that equates to 0.65Nm. I could do that with direct drive off a NEMA23, but even with micro stepping a single step is quite a lot of filament: 13mm × π / (200 × 8) = 0.025mm. That doesn't seem much but 0.5mm filament comes out 36 times faster than its 3mm feedstock goes in, so that is almost 1mm extruded per step. That seems way too big for accurate control to me, so some gearing is necessary.

A worm gear is attractive because it gives a big reduction in one step so I came up with this arrangement: -

The pulley is on a 4mm splined shaft supported by two ball bearings. The gears are Meccano gears which are readily available. I couldn't find any other metal gears at reasonable prices. I had to drill out the worm wheel to fit the motor shaft. I filed flats on both shafts to allow the grub screws to grip.

This bearing cover holds the bearings in place and guides the filament: -

The assembly is clamped together by M5 hex head bolts that are captive in the plastic.

You can see the top of the stainless steel pipe that the filament feeds into. It has an aluminium outer sleeve to conduct the heat away from the transition section, rather than a heatsink. More on that later.

A skate bearing is used as a roller to apply pressure to the filament: -

A piece of M8 studding forms the axle. It is held in place just by friction. The bearing is centralised by cheeks on the plastic which are clear of the moving part.

The pressure is applied by springs and M5 wingnuts: -

The nuts on the bearing cover prevent the roller from meeting the drive pulley when there is no filament. That allows filament to self feed easily simply by inserting it into the hole in the top.

I measured the performance by attaching a spring balance to the filament and measuring the force at which the motor stalled for a given current: -

The motor is a NEMA17 rated at 0.3Nm holding torque with two coils on at 2.5A. The reduction ratio is 40:1, so I expected to only need about 0.637 / 40 to give a 100Nm pull. I was disappointed to find that I needed 1.5A to pull 10Kg.

With sinusoidal micro stepping drive the holding torque will be 0.7 times the two coil on value. I.e. 0.21Nm @ 2.5A, so 0.126Nm @ 1.5A. The torque from the pulley is only 0.016Nm assuming a reduction of 40:1, so the worm drive is only about 13% efficient if I have got my calculations right. Before I greased it, it was only half as efficient, so worm gears certainly waste a lot of effort in friction. The article here says they are between 98% and 20% for ratios 5:1 to 75:1, so I am probably in the right ball park. There will also be some friction in the bearings and pull out torque will be a bit less than holding torque, even though it is only rotating slowly.

So it reaches the target torque but with far less efficiency than my version with the tiny motor and the GM17 gearbox.

The other disappointment is that is is quite noisy, even when micro-stepping. That is simply because the z-axis couples any vibration to the wooden box behind it that then amplifies it. I
am tempted to fill it with something to dampen it down.

So this half of the extruder seems to perform, and it should be reliable because there is not much to wear out, except perhaps the worm gears, that is where most of the friction is and they are only made of brass.

I will test the bottom half of the design tomorrow.