Friday 1 January 2010

New Year New Plastic

Just over a year ago a friend asked me to make replacement for a broken clip that was part of a light fitting. It was not too difficult to model and I made a copy in ABS with 0.3mm filament, 0.24mm layers.



It did the job mechanically, but with one obvious aesthetic problem: -



The original clips were made from transparent polycarbonate and all I had at the time was green ABS. I didn't use PLA because I worried the lamp could easily get hot enough for the clip to go soft and drop the shade. The only transparent thermoplastic that I could get hold of in filament form was PMMA (AKA acrylic / Perspex, etc), which is available in 1m rods. It is too stiff and brittle to use in my previous extruder, so I promised to have a go when I moved to a pinch wheel design.

The first attempt was a complete failure. It melts at 130 - 140 or 165°C depending where you read. It has a relatively high glass transition, 100-114°C, again depending where you read. I found I could extrude it with a fair amount of force at 180°C. It is very viscous with plenty of die swell. I couldn't get it to stick to anything, including itself, at that temperature though. It isn't sticky like PLA, so it wouldn't stick to masking tape. The obvious second choice was a sheet of acrylic as all thermoplastics will stick to themselves.

The general rule of thumb to make plastic weld to itself is that the average of the temperature of the hot part and the cold part has to be higher than the melting point. So to get it to stick to the base, which is at room temperature it would have to be extruded at twice the melting point minus the ambient temperature. The only plastic that seems to break this rule is PLA which melts at 160°C but will bond to itself at 180°C. I think it is something to do with it having a low glass transition and / or that it is sticky like a glue when it is molten.

I upped the temperature to 240°C but it started to hiss and smoke and still did not bond to the base. Lots of places quote the boiling point of PMMA to be 200°C! I dropped the temperature back to 220°C and it is much happier, but still does not stick .

So the only way to make it bond with itself is to raise the ambient temperature. Cue the heated bed. I set the temperature of my aluminium plate to 100°C, the hottest it can safely be below the glass transition. I taped a small scrap of 3mm acrylic sheet to the middle of the bed with Kapton tape. From my experiments before I estimate the surface temperature would be about 85°C. That gives an interface temperature of about 150°C and that seems to be enough to get it to bond to itself.



Here is a short video of 0.3mm PMMA filament being extruded at 16mm/s: -



Here is the finished object: -



It was not too difficult to release from the bed with a penknife once the bed has cooled that is, I keep forgetting that it is hot! The bed takes ages to cool unless I blow it with a fan.

I am very pleased with the final result. I only had 1 meter of 3mm filament to get this right and I managed to find a suitable bed material, temprature settings and make three clips. The build quality is excellent even if I say it myself.



So another useful material in the RepRap arsenal. Apart from HDPE I think it has the highest working temperature. It is very stiff and brittle though. I had a couple of jams due to it snapping where it enters the extruder barrel. The alignment is not quite right because being so hard it does not press into the worm pulley as far as other plastics. The extruder could do with an adjustment there perhaps, or a bigger entrance to the pipe.

It is a bit more transparent than PLA. It smells a bit more when it is extruded, but it is not an unpleasant smell, I would describe it as sweet and aromatic. The major downside is that it is only available in rod form, so the biggest object you can make in one go is 7 cm3 and at £1.49 per meter on eBay, it is comparatively very expensive.

Hot bed

Making a heated bed to combat warping has been on my "to do" list for a long time. In fact I ordered the materials more than a year ago. My plan was to use an aluminium plate with many small power resistors screwed on the back.

The plate is 8" square to match my table and 6mm thick. A friend with a CNC machine shop kindly machined it for me. It saved me a lot of hard work with a hacksaw and file and looks a lot better as well.



I estimated that it would need about 50W to raise the temperature to 100°C, so I aimed for 100W to give a reasonable margin for control. I used 9 10W 12Ω resistors wired in parallel. Driven from 12V this would take 9A giving a power of 108W.

The holes in the resistors are only big enough for M2 screws. I drilled blind holes and tapped them with a plug tap, actually a broken tapered tap that I ground to a flat end.



Tapping small holes in aluminium is tricky, that was how the tap came to be broken in the first place. The correct size hole for M2 is 1.6mm but I drilled it 1.7mm to make it easier to tap. In fact aluminium is so ductile that the peaks of the thread are still the correct diameter. I.e. the 1.7mm drill would not fit the hole after tapping and the thread was a good tight fit on the bolts. I used paraffin for lubrication.

Soldering the resistors was fun.



I used stout wire to handle 9A and high temperature solder because I fancied using it as a hot plate for soldering. My 50W iron did not have enough power to melt the solder when the resistors were mounted with two thick copper wires leading from them. To get round that I placed it on a silicone matt and powered it up to raise the temperature to 100°C and then soldered it while hot and live, not something I would recommend. As the iron bit is grounded I had to solder all the 0V connections first and then swap the polarity.

The original plan was to power it from a 12V PC power supply and switch it with a big MOSFET. Initial tests with a bench power supply showed it took about 15 minutes to warm up to 80°C. When calculating the power I had forgotten take into account the specific heat capacity of the thick sheet of aluminium. I didn't want to add 15 minutes to the build time, so I decided to double the power. I have abused these resistors before and got away with it. I changed the wiring slightly to make a series parallel combination with a total resistance of 12Ω and fed it from 48V AC giving 192W.

I used a big 350W transformer and controlled the mains to it with a solid state relay. Since the temperature is controlled there is no real point in using a regulated DC supply. It is much more efficient to use AC and avoid the losses associated with rectification and smoothing. It also allows me to use the same control hardware and firmware that I used for the SMT oven.

I made some PEEK insulating stand-offs to mount it on my XY table with a gap of about 6mm below the resistors: -



I wrapped the feed points around two of these to make the transition to a lower temperature with PTFE sleeving before using normal flex to handle the movement of the table.



I also added some foam board to insulate the top of my X-Y table.



This just fills some of the air gap under the plate to prevent air circulating and convecting heat downwards.

I made some PTFE washers to go under the nuts that hold it down by slicing up a failed extruder insulator: -



These deformed considerably when I heated the table to 230°C, highlighting why PTFE insulators fail when used in an extruder.

Here is the final result mounted on the machine: -



I added Kapton tape around the edge as I thought it would stop hot air escaping from underneath, but it didn't seem to make a lot of difference.

Here is the open loop response at full power: -



Although it can reach the required temperature, it is much too slow for SMT soldering. It needs to be able to rise at about 1°C / second for that. So I will stick to using the oven for soldering for now. I was hoping to be able to paste boards, place components and then solder with the board still on the table, but it obviously needs a lot more power.

Here is the response using bang-bang control from the host at one second intervals.



Some analysis: the initial rise rate is about 20°C in 75 seconds. The specific heat capacity of aluminium is 0.9 J /gK and the total weight of the bed plus resistors is 700g. So with 192W the time taken to rise 20°C should be 0.9 × 700 × 20 / 192 = 66 seconds, reasonable agreement as we ignored any heat loss.

The initial fall rate is 5°C in 85 seconds while at a temperature of ~80°C above ambient. So the rate of heat loss is 0.9 * 700 * 5 / 85 = 37W. Looking at the steady state the power is on for about 1 in 6, which would be 32W, so again reasonable agreement.

The plate is ~ 200mm square so its area is 0.04m2 so it looks like we need about 1kw / m2 to reach the sort of temperatures needed for HDPE and probably twice that to have reasonable warm-up time and control. Mendel's build area is also 200mm square, so would require a similar power.

You might have noticed the thermocouple is covered with a piece of ceramic cloth in the photo above. This is what happens if it is just stuck down with Kapton tape:-



You can see that as the temperature rises you get increasing thermal noise. Even with the ceramic cover in place you can see similar noise on the open loop test when the temperature was much higher. I think the reason for this is the convective air currents causing chaotic air turbulence. If you think about it you have hot air rising but, away from the edges, the only way cold air can replace it is by falling through the rising air.

A better place to put the thermocouple would be under the bed to avoid the convection currents, but I wanted to try controlling the surface temperature when it was covered by a bed material. Here is what happens with the thermocouple on top of a 3mm thick sheet of smoked acrylic: -



The set point is 95°C in this case. Clearly a case where bang-bang does not work too well, with 5°C overshoot and 3°C undershoot.

The acrylic loses about 15°C between the bottom and the top surface. That makes it curl upwards, so it would need a frame around the edge to hold it down. Fortunately I have one made from HDPE laminated with aluminium so it should stand the heat. It also adds a significant time lag.

Another problem is that acrylic has a glass transition at about 114°C. When the control was of the top surface temperature, the bottom surface exceeded that during the overshoots and went soft.

So I will need to implement PID for top surface control, but I had a suspicion that a transformer was not going to like PWM into its primary much. Anyhow I put the thermistor back onto the plate and moved the bang-bang control from the PC to the firmware in preparation for building something. Bang-bang was an apt name for what happened next. When the temperature crossed the set point it started dithering the mains on and off. The transformer sounded like it wanted to jump off the desk and then blew its 3A anti-surge mains fuse.

The solid state relay turns the power on at the zero point crossing of the mains, and off when the current is zero. Current builds up slowly through an inductor so what could possibly be wrong? I had noticed big transformers thump when you connect them to the mains, but I had always assumed it was because the secondary usually has a big smoothing capacitor to charge up. However, this was a purely resistive load, and even with no load attached the transformer thumps on start-up, so some reading up on transformer theory was required!

It turns out that transformers take a big surge current and turning on at the zero crossing point is actually the worst point to turn them on. The reason is that when a transformer is running, being an inductor, the current lags behind the voltage by 90°. So normally when the voltage is crossing zero, the current is at its maximum reverse polarity and over the next half cycle of voltage it goes though zero and then to its maximum positive value: -

If the current starts at zero then over the first half cycle it will rise to twice its normal value: -

That would not be too bad except for the fact that transformers usually run with their core close to magnetic saturation for efficiency reasons. That means the core saturates during start-up. The inductance disappears and then the only thing limiting the current is the DC resistance of the primary, about 3.3Ω in my case, so the current can be enormous. Counter intuitively, the best time to turn a transformer on is when the mains is at its peak voltage.

So I learned something I didn't know about transformers. The fix was simple, I added a solid state relay to the secondary circuit and plugged the transformer into the mains. Bang-bang control then was able to pulse it very quickly due to the dithering caused by noise, which ends up with some proportional control, that reduces the temperature swings to a fraction of a degree.



So I can add PID control firmware and it can be shared with my oven control but I have an extra solid state relay and a big transformer. A better solution would be to pick the resistor values to give the correct wattage when wired in series across the mains. Of course mains on a moving table is not the safest design. I would use a heavy three core flex with an earth lead to the plate and a second independent earth strap for safety.

It turns out the first use for my heated bed was not to combat warping, but actually something more essential, details coming soon ...

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.root.title("HydraRaptor")
self.last_x = None
frame = Frame(self.root)
frame.pack()
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"
else:
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"
else:
anchor = "e"
self.canvas.create_text((xmin, ymax + ymin - y), text = y / yAxis.scale, anchor = anchor)
self.canvas.pack()
self.canvas.config(scrollregion=self.canvas.bbox(ALL))
self.root.update()

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.canvas.create_line(self.scaleX(line[i][0]),
self.scaleY(line[i][1]),
self.scaleX(line[i+1][0]),
self.scaleY(line[i+1][1]), fill = colour)
self.root.update()


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
self.root.update()

def __del__(self):
self.root.mainloop()
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)
try:
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)
graph.plot(profile)

t = 0
state = s_preheat
m_state = s_preheat
hydra.set_mains(100,100)
while t < xAxis.max:
sleep(1)
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:
hydra.set_mains(100,100)
state = s_reflow
elif state == s_reflow:
if temp >= reflow_temp - overshoot:
hydra.set_mains(0,100)
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
hydra.init()

except:
hydra.init()
raise

oven_cook(profile)
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: -

hydraraptor.blogspot.com/2009/07/lessons-from-a3977
hydraraptor.blogspot.com/2009/08/motor-math
hydraraptor.blogspot.com/2009/08/mixed-decay-mixed-blessing

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.

Summary

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: -