Wednesday 4 November 2009

Extruder Part 3: the Filament Sensor

The disadvantage of using a DC motor instead of a stepper motor for the extruder is that you can't control the rate at which the filament is extruded without some kind of feedback mechanism. The standard way to do this is with a magnetic rotation sensor, and I've already blogged about etching my own version of the magnetic rotation sensor board. The way I'm using the board is not so standard.

The usual approach is to mount the magnet on the drive axle, so that the sensor detects the rotation of the motor. This is fine so long as the drive doesn't slip on the filament, but actually this happens quite often. What we really need is an independent axle which is driven by the movement of the filament, not the motor. My design is cheap and seems to work well.

You need an M3 bolt, two 10x3x4 bearings, a short length of silicone tubing, and a microswitch with a roller lever:



The silicone tubing should fit tightly onto the bolt. Glue the magnet from the rotation sensor onto the head of the bolt with epoxy resin, getting it as central as you can. The sensor IC specifies a 6mm diameter magnet, but I couldn't get hold of one at a reasonable price, so I used a 10mm which works fine. The parts fit together like this:



The roller lever on the microswitch pushes the filament against the bolt, and the silicone tubing gives it enough grip to rotate the bolt when the filament moves. You need some kind of block to hold everything in place; in the long term this should be printed on the RepRap but (as usual) I made mine out of oak:



It fits on top of the pinch-wheel block like this:



and the filament feeds straight through. The microswitch is connected to D9 or D10 on the extruder controller, so the software can detect when the filament runs out.

The silicone tubing is about 5mm external diameter, and the rotation sensor detects 1024 events per revolution, so the resolution should be about 0.015mm. Assuming 3mm filament extruded to 0.5mm, this gives a resolution of extruded plastic of about 0.5mm, which isn't bad. We could improve it a bit by using thinner walled tubing.

Thursday 22 October 2009

Extruder Part 2: the Pinch Wheel Drive

For some reason NEMA17 stepper motors are much harder to get hold of than NEMA23s. I got a great deal on a set of four 23s, but I couldn't find 17s at less than list price, which works out at about £25 each. Then I remembered some gear motors that I've had in my junk box for about 25 years and never used:

They're on a NEMA17 frame, rated 12V 0.7W, and geared to 8.2rpm. A quick test shows that they can lift 1Kg using a 2in pulley without straining, which works out at 0.25Nm so plenty of torque. Ideal!

Next job: make the drive block. Here is my first attempt:

As you can see, it is based on the standard RP part, but made out of oak. I've started writing my extruder PID software, and I couldn't get it to work at all, so I thought I'd see how the drive behaved under constant power. The results were terrible. Here's a typical run:


The blue line is the PWM power output to the motor, and the green line is the measured speed of the filament. Note the enormous spikes when the filament starts moving: it's obviously sticking, then springing free. No wonder my feedback loop didn't work!

Peering at the pinch wheel mechanism, I could see what was wrong. The ball bearing is held by an M3 cap screw, bolted to a fairly narrow bit of wood. The force needed to pinch the filament hard enough pushes the bearing sideways, and the filament doesn't line up with the hole it goes through. That's why it sticks, and also why it's so hard to load the filament.

I decided to make a new block which holds the bearing on both sides, so it can't be pushed sideways. The bearing slides in through a slot at the side, which is a bit fiddly, but I've assembled it and disassembled it several times, and it's not too bad. I even managed to get a washer in on each side of the bearing. Here it is:

You can see the slot at the side where the bearing goes in, the small hole for the bearing axle screw, and the large hole for the motor spindle. Assembled, it looks like this:

It loads the filament without any trouble, it happily lifts 2Kg, and the spikes on the graph are gone. Success! Now back to programming.

Friday 9 October 2009

Magnetic Rotation Encoder Board

This really ought to be something like part 4 of the extruder, but I'm posting it out of sequence because somebody emailed me to ask about it, and I thought I'd put the details here instead of writing an email, then repeating it all.

I'm using a gear motor to drive my pinch wheel, and I decided I needed feedback to control the speed. Unfortunately, I didn't order a rotation sensor PCB when I bought the electronics from MakerBot. The various charges mean that buying it now would cost me about £30, which is daft, and no-one else seems to sell it. I looked into getting one made, but that's almost as much, especially as it's double-sided. In fact, the only people I could find offering to make PCBs in small quantities for a reasonable price have pictures on their website that look just like home-made boards I have seen. Maybe I should find out how it's done?

I decided (since I've never made a PCB before) to simplify the board as much as possible. My aims were:

  • Keep the same position of the IC relative to the mounting holes, in case I ever want to replace the board with the MakerBot version;
  • Keep the same connector and pin assignment so that it connects to the Extruder Controller;
  • Switch to a single-sided PCB if possible;
  • Switch to through-hole components, except for the IC (which is surface mount only).
The compromises I had to make were:

  • Lose the two extra mounting holes near the centre of the board;
  • Lose the analog output on pin 2 of the connector.
Since I can't imagine needing either of these, I don't care about losing them. Here's my PCB layout, tracks and components (both seen from the components side):



I used very low power LEDs, and adjusted all the resistor values accordingly, because the AS5040 datasheet says it can only drive 4mA, but otherwise the components are the through-hole equivalents of the originals. Also, I used red LEDs for MAG+ and MAG- because they should only come on if there's a problem, and green for the others. There are two wire jumpers on the components side, one vertical next to C1, and one horizontal next to the IDC connector. There is no hole under the chip, because it is mounted on the other side of the board, nearer to the magnet. This also means that you can use 10mm magnets, which seem to be much easier to obtain than 6mm.

To etch the board, I basically followed the instructions here. I don't have a laser printer, but my local library was happy about me using my own paper in their HP, though they didn't know which way up to feed it in! I tried two different papers which I already had, and the better was the cheaper: ICE professional inkjet photo paper (gloss, 210gsm). I turned my old steam iron up to "linen" and about 30 seconds of heat, followed by a bit extra along the edges, stuck the toner to the copper pretty well. After soaking for about ten minutes, the paper came straight off, leaving just the clay coating. After a few experiments I found that blu-tack (well stretched to soften it) gets the clay off easily, leaving just the toner behind. For etching, I used sodium persulphate (from Maplin) instead of ferric chloride, because it doesn't stain.

At first I thought I could get away without tinning, cause tinning crystals are expensive, but I'd forgotten how much harder soldering is without through-plated holes. Then I remembered seeing a suggestion somewhere that you tin PCBs with solder, and I've got most of a syringe of solder paste left. I squirted a bit on, and pushed it about with my soldering iron, and it worked. Finally I soldered the components on, tested the connections, and here it is:



It seems to work perfectly, but (as far as I can find) there is no firmware available for generation 3 electronics which supports it, so I've got to write my own. Why does that feel so much more like work?

Tuesday 22 September 2009

Extruder Part 1: the Heater

Although I can see the advantages of Nophead's heater, I'm not at all sure that I can machine stainless steel, so I decided to make the standard heater from the RepRap website. I remembered to order insulated nichrome wire and a thermistor when I ordered my electronics from Makerbot, I bought some PTFE rod on eBay, and my local village hardware store sells fire cement, so I just needed the 6mm brass bolt. No-one seems to sell brass bolts any more (or if they do, they want huge amounts of postage), and I searched all my neighbours' junk boxes without luck (I assume they've all thought I'm mad for years, so what's one more eccentricity?) but I did find an old ball-cock valve with a 7mm brass arm. Close enough; stick it in a drill and file it down a bit.

My only machine tool is a cheap, slightly rattly, pillar drill. I have a machine vice and an old set of taps and dies, and I bought four pin vices, an Archimedean drill and a set of miniature drill bits on eBay for about 7 quid inc postage (why are tools so cheap?), so it was time to set up the poor-man's lathe.

If you put a rod in a vice, and try to drill a hole down the centre, your chances of getting it concentric are negligible. Even if you get it started right, it will probably drift off centre and break through the side of the rod half way down. The trick is to put the drill bit in the vice, and the rod in the drill chuck, and that way it stays central when you drill.

Here's how to set it up. First, put the drill bit in the pin vice, and do it up tight. Then grip the cutting end of the drill bit in the drill chuck, push the drill down, and set the drill table so that the machine vice can hold the pin vice. With the drill down, tighten the machine vice on the pin vice, and bolt it to the table. Then release the drill chuck, and let the drill up. You can then put the brass rod in the chuck, and drill it out.

I followed the instructions on the RepRap web page: slight dent in one end using poor-man's lathe, drill 0.5mm hole with Archimedean drill (and sewing machine oil), taper off end until dent is gone, drill it out from other end with poor-man's lathe (more sewing machine oil) and finally, M6 thread. I think next time, I'll thread it first. It makes it harder to hold in the drill, but I managed to bend it a bit with the die (not enough to matter, but enough to annoy me), which happens far too often.

Drilling and tapping the PTFE rod, winding the nichrome wire, adding the fire cement and fitting the copper pipe were straightforward, but how to dry out the cement without a variable power supply? I tried baking it on the lowest shelf of the oven on slow-cook, but I wasn't sure it was reaching the right temperature, and I certainly wasn't going to turn it up to 250C.

Here's my method of avoiding the damp cement short circuit problem. Connect a 100K pot to the thermistor terminals on the extruder board, the heater to the heater terminals, and the thermistor to your multimeter, set to 100K. With the thermistor resistance table in front of you, launch the RepRap software (I used ReplicatorG) and set the temperature you want. Now you have to continually adjust the pot so that the temperature shown on the software matches the resistance shown on your multimeter. As soon as it's dry enough to insulate the heater from the thermistor, you can replace the pot with the thermistor, and leave it to software control.


Here is the final part, complete with the first piece of oak! A bit wonky perhaps, but plastic filament pushes down to the end without any trouble, so we'll see.



Thursday 17 September 2009

Soldering

I've been soldering bits of electronics since I was a teenager, and I've also soldered tinplate and copper water pipes, but until recently I assumed surface mount soldering couldn't be done without an automatic  solder-paste stencil-printing machine and a temperature-controlled reflow oven. The RepRap project pointed me to several excellent write-ups on how to do it at home on a hotplate or in a toaster oven, so I thought I'd have a go. Then I thought, why buy an electric hotplate and worry about ventilation, when I've got four gas burners sitting under an extractor fan in my kitchen, and an old frying pan waiting to be chucked out?

I started with one of the stepper-motor-driver boards, because they're the smallest. I'm not entirely sure what I did wrong: either not enough solder paste or not enough heat, but the main lesson I leant was "test the joints before you plug it in!" Several of the joints weren't properly made, including one of the sense resistors, and I blew one of the channels in the driver chip when the poor thing tried to produce infinite current. Then I damaged the pcb tracks getting the old chip off. After I'd patched the thing back together with a new chip and bits of copper wire to replace the lifted tracks it looks like this:
which is ugly, but it works. I used verowire for the data tracks, and the trimmings from through-hole components for the high-current tracks.

The rest of the boards all went perfectly, and all seem to work, so here are my tips for the beginner:

  1. Be a bit generous with solder paste. Solder balls come off easily, and desoldering braid fixes bridges without trouble. If you have to add more solder by hand, you'll probably end up with too much, so you'll have to use the braid anyway. Might as well be generous in the first place (but not too much!).
  2. Shut the door, open a window and turn the extractor on full. You really don't want to breathe too much of the fumes: a friend-of-a-friend ended up in hospital with breathing difficulties after doing research on solder paste. I hold my breath when leaning close to examine the board as it heats up.
  3. Don't be too worried about heat. Surface-mount chips are designed to be cooked, and will probably survive unless you burn the board. I use a large aluminium frying pan on one of the smaller burners, and I cook it for about three minutes on a fairly low heat to warm everything up, then turn the heat up pretty high until the solder melts, which is usually about three more minutes. Then I turn it off and leave it to cool in the pan.
  4. Examine it carefully! I use a large magnifying glass for peering, an old hat pin for prodding, and a pair of bent-nosed pliers for tweaking, and I check that everything is on its pad with shiny solder before letting it cool. You don't want to have to desolder anything.
  5. If you have to desolder a chip, cut through all the legs then desolder them individually. Unless you are a real expert, there simply isn't any way to undo that many solder joints at once. The chip is already dead: don't bugger the board as well.
  6. Removing solder bridges is just part of the job. For the finest pitch QFPs you might end up with the whole side bridged together, but even if it takes several goes, desoldering braid will fix it. Put the braid on the bridge, heat it up until the solder melts, cut off used braid, repeat until bridge is gone.
  7. TEST BEFORE USE! Look at the schematic, and use a multimeter to check that each pin on each chip is connected to what it should be, and not to its neighbours (unless it's meant to be!). The audible continuity setting is good for this, but it can't distinguish between a 0.25Ω resistor and a short. It also lights up the LEDs, which is disconcerting if you're not expecting it.

Soldering tools
So now I feel I have a new skill, with a zero equipment cost. I might have bought ready-assembled boards if they had been available, but I'm glad I didn't. After the first failure, the rest were fun.

Thursday 10 September 2009

Buying things

One of my original aims was to keep costs as low as possible, because I don't really have any income. Ordering things from the US is extremely expensive: I got the generation 3 electronics kit from Makerbot, which works out like this:

kit: $145 £87.71
postage: $31.75 £19.20
vat: £16.04
service: £8.00
total: £130.95

so the total is 1½ times the list price. Of course, for cheaper items the proportion is even worse, because the postage and service charge are constant. If you can add extra items to the order they are very good value (unless the postage goes up!) so I got my nichrome wire & thermistor at the same time. I wish I'd got some extra boards as spares, but I can't order the smallest thing now without paying an extra £27 in postage & service.

The pound is so low against the euro at the moment that ordering from Europe isn't much better. The best deal I could get for ABS filament was €98.90 for 5Kg from RepRapSource in Germany, but with postage that works out as £114.10. At least there's no import duty!

I've got some good deals on ebay. Powerful stepper motors as specified for the Darwin RepRap have list prices around £50 each, but I got a set of four for £47 (inc postage) brand new. Anything small and light tends to be good value, but postage can be a killer. I'm still looking for a reasonable way to buy 8mm steel bar.

Fortunately for me, Bolton has an excellent nuts & bolts shop, called Brabbin & Rudd. I got all my nuts, bolts & studding for £20 (though stainless would have been more) which is about half the price I could find online. I wish I could buy more things like that: walking round a warehouse crammed with shelves full of every kind of fixing you can imagine, and watching someone pour them into a counting balance is so much more fun than waiting all day for another delivery because you're always at the end of the round. I wonder what Farnell's warehouse is like? I imagine it as a sort of high-tech Alladin's cave.

Currently working on: Firmware for the extruder controller. It seems it doesn't support the rotation sensor.


P.S. Someone put a job lot of 25 90cm x 8mm steel rods up on eBay for £15.50 inc postage, so that's another problem solved. A bit of patience makes all the difference!

Wednesday 9 September 2009

Hello anyone!

I started building my RepRap at the beginning of August, and so far I've spent £400 (including £114 on ABS filament), and built the electronics and the extruder. My original plan was to try to beg/buy a set of plastic parts off someone, but this seems to be impossible, so I'm using BodgeIt's approach, and making all the bits as best I can. Once it works, I can replace them with my own printed parts. If anyone with a working machine reads this and wants to offer me a few parts they've got spare, I'd be very grateful!

The title of my blog, "Oak & Silicon", reflects both the materials I'm planning to make the machine from (I happen to have a lot of oak offcuts to use up) and the combination of low and high tech in this hobby that appeals to my sense of humour or irony or something. There's something almost steampunk about cooking up fine-pitch surface-mount PCBs in an old frying pan over a gas flame.

I'm planning to write a few posts on what I've done and learnt so far, before I catch up with what I'm struggling with at the moment. Of course, if I manage my usual rate of writing, I'll never catch up.