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?

No comments:

Post a Comment