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.

Saturday 17 October 2009

Toothless

Irritatingly, whenever I try to make a new extruder using my existing one, it always breaks down forcing me to have to repair it, even though it is about to be made obsolete. It is as if they know!

The GM3 motor on my extruder started making a noise like a machine gun. On opening it up I found it has stripped a tooth of the final gear.



Since I moved from the 6V version to the 12V version I have been getting pretty good motor life. I do have to lock the clutch and sometimes glue the splined shaft into the last gear, but so far the gearbox has lasted well.

It is just as well my next extruder uses a stepper motor and an all metal drive chain: -



More details soon ...

Tuesday 29 September 2009

Hairy Pea

I have had a few anonymous requests for a new post, so here is an object I made recently: -



It is a whistle downloaded from Thingiverse designed by Zaggo. It must be one of the most printed things on Thingiverse, and in a very short time after its posting. I think the reason it is so popular is that it is a functional item with a moving part (the pea) that is printed in situ. It is attached by one small point at its base and you detach it by pushing a scalpel through the slot.

It is very loud and annoys my wife every time I blow it!

The pea was initially very hairy because I get a lot of ooze with PLA. I had to pick the hairs off it through the slot, a bit tricky. I am currently working on a new extruder (when am I ever not?) with a much shorter melt zone to address this.

The reason I haven't posted for so long, apart from being on holiday in the Spanish Pyrenees, is that I have spent a long time thinking about the design of this one. It will also be super sturdy, so hopefully it will allow me to forget about extruders and move on to other things. I.e. new heads for HydraRaptor as it has spent too long having only two, so not living up to its name.

Tuesday 1 September 2009

Pear shaped

My wife has a tiny orchard in our front garden, four fruit trees on dwarf stock. This year the espaliered pear tree has got a bit out of hand and has produced pears that are too high for us to reach and too far away to reach from a step ladder. In fact some are actually outside of our garden! The tree should really be 2D but it has gone a bit 3D on us.

So RepRap to the rescue, I made a device to cut pears at a distance and another device to catch them.

The cutter is based on a hook shaped Stanley knife blade No 1996. I made a sliding carrier for it with a hole to attach a string and a peg to take a spring.



This fits inside a casing with a tube to mount it on the end of a 16mm OD pipe. A spring keeps the blade extended. A string is pulled to retract it to cut the stem of the pear.

This drawing shows how the parts fit together inside.



There is a rib in the top that prevents the blade from lifting over its locating bumps. The casing was made upside down and makes heavy use of bridge spanning to avoid the need for support material.



As a mechanism it worked well, but useless for cutting pears as I completely underestimated how tough a pear stalk is. So onto plan B, a pair of secateurs clamped to a pole, with a piece of string threaded through an eye to pull them closed: -



The handle of the secateurs is a horrible shape for making something to mate with it because its surfaces are irregular curves (not arcs or ellipses) in two dimensions. Very difficult to model without a 3D scanner. I made use of a channel in the back to be able to grab it with simple flat parts.



This version works well, with a handle to make the other end of the string easy to pull: -



A cup mounted on a second tubular pole catches the pear.



It is a two person job to use both at the same time. A better design would be to mount both tools on the same pole somehow. A better catcher could be made by a plastic bag sandwiched between two circular hoops of plastic to hold the top open.

Here it is in use: -



The only design issue is that it is hard to see where the jaws of the secateurs are when looking along the length of the pole. Mounting the pole at an angle to the clamp would solve that.

Here are the extra out of reach pears that we cropped with the contraption.



The files are available on Thingiverse.

Wednesday 26 August 2009

Fast extruder

I put together my new extruder controller, the worm pulley drive mechanism with the GM17 tiny stepper hack and the stainless steel extruder with heatsink and ducted fan to make possibly the most complicated extruder design yet!



You can see a better view of the drive mechanism fitted on another extruder base here: -



Here is a reminder of what the heater assembly looks like: -



The heatsink is cooled by a tiny fan. When run from 12V it is very noisy and way too powerful. With my new controller I can run it with PWM just a bit faster than its stall speed. That keeps the noise down and still gives more cooling than needed. I attached a thermistor to the heatsink by gluing it into a crimp tag with J-B Weld.



I can tell the controller to keep the temperature below a specified level by turning the fan on and off. I set the trip point to an arbitrary 35°C. It will even turn it on when the extruder is idle, much like the radiator fan of a car runs after the engine is switched off. This is needed to ensure PLA will never soften and jam in the cold part of the tube.

I run the tiny stepper motor at about 300mA to keep it cool enough to touch. It will take more current than that but runs very hot. A good design would use a single fan to cool the motor and the heatsink.

I ran the motor with micro stepping, so even though it has a 15° step, that gives 192 steps per revolution. The GM17 gearbox has a reduction of 228:1 giving a massive 43,776 steps per revolution of the worm pulley. That seems a lot, but the diameter of the pulley is 13mm, so one turn is 40.84mm of feed. That gives 1072 steps per millimetre. In comparison I have been using an 816 step shaft encoder and an 0.8mm pitch thread, which gives 1020 steps per millimetre, almost the same.

I started extruding ABS with my usual feed rate of 16mm/s for 0.5mm filament, which is 3.14 mm3 per second. I kept doubling it until it failed, which was 128mm/s if I have got the calculations right. At that point it mostly worked but something was slipping occasionally. I think it was the clutch in the gearbox. Backing off to 64mm/s it works fine. That is four times faster than the GM3 manages with a screw drive. It is too fast for HydraRaptor but I reckon my Darwin could go that fast. I have no idea what the build quality would be like but it would get the time to print one down to about 24 hours.

Here is a video of it spewing out plastic.

Fast Extruder from Nop Head on Vimeo.

It isn't mechanically compatible with HydraRaptor without making a new bracket to mount it on the z-trolley, so I haven't made anything with it yet.

Monday 24 August 2009

Time for a new extruder controller

Having decided to switch to stepper drive for my extruder I needed to make a new extruder controller for HydraRaptor, the previous one has served me well for two years.

The spec for the new one is: -
  • I2C or RS485 comms link to the main controller.
  • Micro stepping bipolar stepper drive.
  • Heater control from a thermistor.
  • Fan control output.
  • Second fan control and second thermistor for controlling extruder heatsink temperature.
  • A spare output for a solenoid, etc.
  • A filament empty input.
I designed it in Kicad and got the PCB made professionally. Here is the schematic: -



U4 generates a local 3.3V rail from the 12V supply. C8 and C9 are the bulk low frequency decoupling for the 12V and 3.3V rails respectively. C1, C2, C3, C5, C7, C12 and C13 are the high frequency decouplers placed close to the chips that they are decoupling. D2 is a green LED to indicate the board is powered.

U2 is an RS485 transceiver which I intend to use on my Darwin. It is slew rate limited and ESD protected but somewhat expensive compared to the older 5V versions. R1 ensures the transmitter is off until the micro takes control of it. HydraRaptor uses I2C to talk to its heads at the moment, via K1.

Q3, Q4 Q5 and Q6 are NIF9N05CL protected MOSFETs to control fans, heaters and solenoids, etc. They are protected against over current, over voltage (hence no back EMF diodes), over temperature and ESD. They also have controlled edge rates to minimize RFI. Q1 and Q2, together with R3 and R4, are level translators to increase the gate drive voltage on the two higher current drives. That minimises the on resistance to ensure they stay cool without heatsinks, even at 2A or more. R13 and R14 ensure the drives are off before the micro starts. D6, D7, D8 & D9 are red LEDs to indicate when the outputs are on. Essential for the heater output, but a luxury for the others.

R15, R16, R17 & R18 form the correct potential dividers to give a good approximation to linear temperature response for 10K thermistors, see here for details. For a 100K thermistor they would simply be 10 times bigger. C10 and C11 remove high frequency noise. Probably unnecessary as a little noise actually seems beneficial because it converts bang-bang control to proportional.

The thermistor inputs have their own analogue ground rail, which is only linked to the main ground at one point close to the VSS pin of the MCU. This is done via a zero ohm link, R25, on the schematic. On the PCB this is the smallest footprint available and is shorted by a bit of copper, so no part is actually fitted. The reason for this bodge is to keep the track separate from the ground fill, so that no current from the heater or motors is passing along it. That might cause a small voltage offset that would affect the temperature reading.

U1 is the stepper motor driver. I used the Allegro A3983 as it gives micro stepping with a smaller external part count than the A3977, but as mentioned previously it does have some disadvantages.

C6 and C7 form a charge pump which generates a supply rail for the gate drive that is higher than the main supply voltage (12V). That allows the top transistors of the H-bridges to be N-channel devices, rather than P-channel, which have inferior performance.

R22 sets the off time of the chopper and needs to be different values for different motors as described here.

R23 and R24 are 1W current sense resistors. I found them to be expensive in the 2512 SMT package. It is actually cheaper to use two 1210 0.5W resistors in parallel, or through hole parts mounted vertically, which take up less board area.

The reference voltage for the chopper is generated by a high frequency PWM output on the micro and smoothed to DC by R2 and C4. That allows software control of the motor current. As I had plenty of spare I/O on the micro I also have software control of the step mode (full, half, quarter or eighth), the enable and the reset pin. R5 ensures the stepper is disabled before the micro is running. As with R1 it ensures the circuit is well behaved before the micro is programmed, or when it is being run under a debugger.

D3, D4, D10 and D11 indicate the state of the stepper outputs, a bit of a luxury really. With SMT parts there is not much point in using bi-colour LEDs. It is cheaper to use back to back red and green next to each other.

I used an MSP430F2012 micro on my first extruder controller because you get a full development kit including an excellent C compiler, in circuit programming and source level debugging for $20. I think there is also open source support via gcc, but I have not investigated that yet.

For this one I had to move up to an MSP430F2112 to get a UART for the RS485. As it is the same core with different peripherals I assumed my $20 eZ430 SpyBiWire debugger would still work. Big mistake! It programs OK but it locks up when trying to debug. It also miss-identifies the chip. I have two, and the second one I tried said the firmware needed updating and offered to do it. JUST SAY NO, if you say yes it reprograms the eZ430 and it never talks again. I contacted TI and they have no plans to fix this firmware updating bug so I got an MSP-FET430UIF debugger for $99. It does JTAG as well as SpyBiWire so I should be able to mend my second eZ430, as it has JTAG test points and I read the security fuse is not blown. I also suspect a new eZ430 may well work as the web page has been updated to show it supports the F21x2 now.

D1 and D5 are red and green status lights. I light the green one to show the processor is running and blink it whenever it receives a command. The red one indicates errors.

P3 is a connector for a filament out switch. I haven't implemented one of those yet as a spool of filament usually lasts many months. It uses an internal pullup resistor to pull it high when the switch is open.

P1 is the SpiBiWire connector for programming and debugging.

Even with extravagant motor control I had three spare I/O lines, so I brought them out to a connector with the supply rails for future expansion.

This is what Kicad predicted the populated board would look like: -



I found 3D models for all the parts on the web but the connectors were a bit of a nightmare. I used Tyco MTA100 and MTA156 connectors as they seem to be about the cheapest form of wire to board connector. As usual there is an expensive tool to insert the wires, but you can get away with using a pair of needle nosed pliers, or even make a tool as it is only a metal plate with slots in it mounted in a plastic handle. We should be able to RepRap one.

Tyco have STEP and IGES 3D models on their website. Kicad needs VRML, which should have been no problem as CoCreate can import STEP or IGES and export VRML. But Kicad did not like the VRML from CoCreate, it seems it has to come from Wings3D. Wings can import STL but it does not like the STL from CoCreate or AOI either. In the end I had to do IGES -> CoCreate -> STL -> AOI -> OBJ -> Wings-> VRML -> Kicad! I coloured the body and pins in Wings.

I got five boards made by PCB-Pool in 8 working days for €125 including shipping, certainly not the cheapest, especially as it included Irish VAT at 21.5% (VAT is only 15% at the moment in the UK), but I like the web interface, the quality is good and they include a free solder paste stencil.



They also email pictures of the board being made at five different stages, although two of mine went missing. Here it is before the tin plating was added: -



And here it is finished apart from routing the outline: -



Using the stencil is very easy. You trap the board between two L-shaped pieces of PCB material stuck to a flat surface with some masking tape. You then align the stencil over the pads and stick one edge with masking tape. Spread some solder past along the edge that is stuck and then wipe it across the board with a metal squeegee to force it through the holes and leave it exactly level with the surface of the stencil.

You then lift the stencil carefully from the edge that is not taped down.



Notice how the paste for the heat slug on the A3983 is split into four and reduced in area. This is recommended to stop the chip floating on the paste and sliding across the footprint. It was not easy to do in Kicad. It doesn't seem possible to do it in the component footprint, so I had to draw on the stencil layer of the PCB. That means if I use the chip again I will have to do it again. I had the same limitation when expanding the resist layer around the fiducials. These are the two copper circles bottom left and mid right. They are used for optical alignment of pick and place machines.

The next stage is to place all the parts with tweezers. I used 0805 footprints for all the passives, so they were not too fiddly to do by hand. I hope to be able to automate the pasting and placement with HydraRaptor soon.

Then I cooked the board in a cheap electric oven, a Severin TO 2020 for €45.



I believe you can get these for as little as £15. I expect they give more even heating than using a hotplate, as they heat from above as well as below, but a hotplate has the advantage of taking up a lot less space and probably uses less power. I will be making a heated bed for HydraRaptor, so I might be able to use that.

The temperature profile was controlled by a thermocouple attached to a PID controller that I borrowed from work.



When I have time I will connect one of Zach's thermocouple boards to a spare analogue input on HydraRaptor and plug the oven into the software controlled mains outlet that HydraRaptor has, and then program it as a PID controller. Not another head, but certainly another manufacturing capability. I will also try putting extruded objects through a heat cycle in the oven while they are still attached to the base. It should release the stress so they don't warp further when removed.

This was the finished result after hand soldering the connectors: -



U2 is not fitted because I got the footprint wrong, doh! I can bodge one on when I need RS485. There are two construction faults on this picture, can you spot them?

The reflow was not perfect. The big capacitor did not flow at all. The temperature needs to be a bit higher, or perhaps the warm-up a bit slower. There were solder bridges on the TSSOP chips. That was because you are supposed to shrink the stencil apertures by an amount related to the stencil thickness to get the correct amount of paste. Normally the stencil manufacturer will do that for you but PCB-Pool do not offer it on their free stencils, presumably because they are shared with other designs. Unfortunately Kicad only seems to be able to make them 1:1 with the pads. It is open source, and written in C++, which I know well, so I could have a go at adding that facility if I had the time.

I have tested the board and used it to control one of my experimental extruders, more details tomorrow. The only thing wrong with it apart from the foorprint error is that the A3983 gets too hot to deliver its full rated current of 2A. 1A is no problem, which should be plenty for the extruder designs I have in mind.

The back of the board is nearly all copper to give a good heatsink but at 2A per coil the chip will dissipate 2 × 2A2 × (0.3Ω + 0.3Ω) = 4.8W. The datasheet recommends a 4 layer board with 2oz copper on the outer layers. I am not sure what the extra cost of 2oz is. I will investigate the heat distribution in more detail at some point.



Sunday 9 August 2009

Black and blue

I got some of the 3M blue masking tape that Vik Olliver recommended as a bed material for PLA. It seems to be available up to 50mm wide, so four strips covers the bed of my machine.



Whereas I could not get PLA to stick reliably to MDF, it sticks easily to the tape.



Why is it black? Well my feed of PLA from the overhead hanging basket snapped. It must have got kinked and bent through too sharp a radius. When I pushed the new end into the top of the extruder to restart it, I must have caught some of the grease from the top bearing. The grease is yellow, but as soon as the stainless steel bearings have run for a while it turns black. That small amount of material was enough to turn the first few layers of my object dark grey.

The object was a complicated shape and came out very hairy: -



It took a lot of cleaning up and has some defects and weak spots where there is a lack of material due to the oozing that occurs on the way there. I have some compensation for this effect, which works well for ABS. Basically I estimate the amount of ooze from the time the extruder is off and then run the extruder for a while to replace it before starting a new thread. I think the constants need to be completely different for PLA.

The object was relatively large, but showed no sign of warping, even when removed from the bed. The base of it is completely flat.



I had successfully removed several small objects but I damaged the tape removing this one. It was easy to replace one strip and reducing the temperature of the first layer from 210°C to 180°C seems to allow large objects to be removed easily.



Another problem I had was the PLA started revolving fairly quickly in the extruder, making the hanging basket spin. Each time it revolves it reduces the amount fed by one thread pitch. If it happens too much the object has material missing. I fixed it by applying some oil to a felt washer that the filament passes through. A good reason for moving to a pinch wheel feed though.

I made a 65mm cube shaped box and it showed no sign of lifting from the bed.



It was easy to remove though and this time did not damage the tape. Even after it was removed the base stayed fairly flat.



Much better than my attempt to make the same box in ABS some time ago.



Not only did it curl after it was removed from the base, it also ripped itself open at the corners while it was being built. There is also a wavy distortion on the left face which I had not encountered before.

I think what happened is that when the cracks opened the edges lifted, causing the nozzle to bear down on the wall it had already built. That meant there was excess plastic for the gap between the surface and the nozzle. Normally when that happens blobs are left on the surface. When the next layer is done the nozzle just plows through the blobs. Because the walls are only 1.5mm thick in this case, and tall, they flexed sideways instead. That caused a ripple and the effect seems to build up layer on layer. I could see the wall flexing as the nozzle passed over it.

So PLA allows bigger objects to be made before a heated bed or chamber becomes necessary.

Even relatively large PLA objects can be made without a raft. That saves a lot of time and material, but you do have to get the z-calibration spot on and the bed perfectly level.

The masking tape makes a good, cheap, reusable bed material and it is quick and easy to replace if you do damage it.

Mixed decay, mixed blessing

Having set the correct off time to suit my motor I can now micro step it with equal spaced steps, but only if I disable the mixed decay mode.


When the chopper switches off it can do it two ways. It can turn on both low side transistors. That short circuits the motor and lets the current recirculate. If the coil was a perfect inductor and the transistors perfect switches, the current would circulate forever and you would have a superconducting magnet. Real coils and transistors have some resistance, which causes the current to decay, but as these are relatively small the mode is called slow decay.

This is fine and efficient until you take the motor's back emf into account. During the rising part of the sine wave the magnet is moving towards the pole piece, so it generates a voltage that causes the current to fall faster. The on time gets longer to compensate and all is well.

On the trailing edge of the sine curve the magnet has gone past the pole piece and generates a voltage that increases the current in the coil. If it is going fast enough it can mean that the current doesn't fall at all during the slow decay period. As I showed previously that can cause a severely distorted waveform which makes the motor noisy.



The Allegro chips offer a mixed decay mode, where they switch to fast decay for part of the chopping cycle on the downward half of the sine curve. In fast decay mode one low side and one high side transistor turn on and reverse the voltage across the motor. That overcomes the BEMF and causes the current to fall much faster. It also returns current to the supply rail, which can upset some power supplies if there isn't some other load to absorb it.

Mixed decay gives a current waveform like this: -



The off time is fixed, so the current falls further making the ripple greater. If you set the percentage fast decay to give a clean waveform at your top speed, then the ripple increases at slower speeds. It is maximum when stationary, when there is no BEMF and fast decay is not required at all.

The problem is that the target current is the trip point of the comparator, so it is the peak of the chopping waveform. That means the average current is less by half the ripple current giving a positional error.

With the low inductance motor I am using, the ripple current has a large amplitude, so the error introduced when the motor is stationary is about the same as a micro step. That means the first step with fast decay is about twice as big as it should be and the last step is virtually zero.

With the A3977 I can disable fast decay and the steps are fairly even, but fast running is then distorted. The PFD setting needs to change with speed.

With the A3983 that I have used on my new extruder controller the PFD setting is fixed at 31.25%. That means I can't get evenly spaced microsteps with the NEMA17's that I have, when running slowly. Not a big problem with the extruder because I plan to gear it down 40:1, which means one micro step is only about 0.02mm. I am only using microstepping to give smooth motion rather than extra resolution.

The problem is exaggerated because not only am I using a low inductance motor, but I am also trying to run it at 1A, whereas it is rated for 2.5A. At 2.5A the off time would be about 2.5 times smaller, so the ripple would be 2.5 times less. The steps in the current waveform would be 2.5 times bigger, so the distortion would be reduced by 6.25 times. As it is about one microstep now, it would reduce to 1/6th of a microstep, so would be acceptable. The temperature rise would then be 6.25 times greater of course.

I was planning to use A3977s for my axis control though, where positional accuracy is important. I am beginning to think I will be better off just using dual H-bridges and doing the rest in software using a powerful micro with a fast ADC.

To be able to cope with a wide variety of motors you need to change the current, the off time setting and the percentage of fast decay. You also need to take the ripple current amplitude into account to control the average current, rather than the peak. All these things could be automated with a software solution.