## Thursday, 30 July 2009

### Lessons from the A3977

Having established that I want to move to a stepper driven extruder I set about designing a new extruder controller for HydraRaptor. I fancied using one of the Allegro micro-stepping chopper drivers.

With these chips there are a few things you can adjust by changing component values, like the off time, minimum on time and percentage fast decay. The data sheet explains what they do and gives the formulas but it's not obvious what you should set them to for a particular motor.

Not having any previous experience with Allegro drivers I decided I needed to knock up an evaluation circuit. Fortuitously Zach had sent me some PCBs a long time ago that were his first version of the Stepper Motor Driver v2.0. They used the PLCC version of the A3977.

PLCC packages were a bit of a halfway house between through hole and surface mount. They have leads which come out of the side and then curl underneath.

They are handy for programmable devices because you can either surface mount them or put them in sockets (which can be either SMT or through hole). The problem with them in this application is that using a socket is not recommended for current and heat dissipation reasons.

That makes the package a worst of both worlds solution. It is big and bulky like through hole parts but still difficult to hand solder because the pins are underneath. The surface mount version of the A3977 is a fine pitch (0.65mm) TSSOP with a heat slug underneath, so again not easy to solder by hand, it really needs to be done by the solder paste and oven / hotplate method.

Zach moved to the A3982 on subsequent versions, which is easy to hand solder because it is in a SOIC package with 1.27mm pitch. It also has a lower external component count. The down side is that it does not do micro stepping and is only 2A rather than 2.5A. I will probably use the A3983 (which is like the A3982 plus micro stepping and in a TSSOP package).

I managed to hand solder the PLCC at my second attempt. My first attempt had a short, which damaged the chip. I damaged the board removing it (with a cutting disk), so I had to start again on a second PCB. Lots of cursing! The lesson is always to meter a PLCC for sorts before powering up as you can't see shorts underneath it.

Here is my test lash up: -

I can set the step rate with a signal generator, vary the supply voltage from 8 to 35V, see the temperature of the chip and look at the current waveform on a scope .

The initial results were disappointing due to a couple of problems: -

The first was that the chopping occasionally had glitches in it. With the motor stationary I could hear it clicking, and with a scope I could see some cycles shorter than they should be. It got worse with higher supply voltages. At low speeds it did not make much difference, but it did lower the maximum speed. I tracked it down to a lack of high frequency decoupling on the 12V rail. I added a 220nF de-coupler close to the chip and the problem went away. Adding it further from the chip actually made it worse.

The times and weights are calculated, and don't include the raft time, which is significant, or the time waiting for temperature changes and raft cooling. I weighed the parts on kitchen scales and they came out at 931g, so pretty close to the calculation. The cost shown is on the basis of ABS at $20 / Kg. I save all the rafts for the day when we get recycling working. I weighed them in at ~ 200g, that is about 20% wastage and will bring the actual printing time up to about 100 hours. I also wasted 150g in failed prints, for silly reasons, more on that later. It gives a measure of the reliability I am achieving at the moment, i.e. 8 parts failed out of 117 prints so 93% success rate. Of course the bigger the part is, the more chance something will go wrong, so by weight and time it is much worse . I used plain ABS for most of the parts because it seems to bond better than coloured. I used black for the opto tabs. No guarantee that they will be opaque to IR, but I think black ABS usually is. The green parts are just ones I had left over from experiments. I made some of the bearings in HDPE as that should be a better bearing material than ABS, lower friction and longer lasting. The black ones are "jam" bearings so I left them in ABS as they want maximum friction. Some of the parts are my own design. Most significant are the z-axis parts described in the previous post. Here is a list of the other design tweaks, with links to the article describing them:- simplified diagonal tie brackets, X-motor washer, x-carriage bearing and the feet. Some parts I had never printed before. The Pinch wheel extruder: - The nozzle wiper assembly has appeared in the latest Darwin release but I can't find any assembly instructions. I leave it as a puzzle for Edward Miller, the guy who is actually going to build this machine. Similarly the new adjustable z-opto flag assembly: - I aimed to print these parts over the course of a week, three batches a day, but the machine had other plans and it actually took me two weeks. I will give more details tomorrow. ## Sunday, 19 July 2009 ###$8 Z-axis

About a year ago I blogged an alternative Z-axis for Darwin using four tin can steppers instead of one expensive stepper and a belt drive. The only thing missing was a source of cheap motors to make it economically viable. Some time ago Forrest Higgs pointed out a source of cheap 15° motors for $2.50 made by Airpax. I also found them available for$2 at Surplus Shed. That makes a z-axis for $8 possible, which is much cheaper than original motor, let alone the belt. They are surplus stock, so when they are gone they are gone, but there does seem to be a lot of them around. Unfortunately it costs more than$40 to ship them from the US, so the economics don't look nearly so good this side of the pond.

They are 12V 0.4A per coil, so four wired in parallel will take 1.6A, well withing the 2A capability of the RepRap electronics. They are six wire unipolar motors, but they can also be driven from a bipolar drive by using the red and orange wires as one coil and the green and brown as the other.

The pull in rate seems to be about 200pps, which would give 200 × 15 × 1.25 / 360 = ~10 mm/s with M8×1.25 threaded rod.

The boss on the back of the motor is a bit bigger than the motors I used before so I have updated the bracket design accordingly. The motors come with a spiral drive screw on the shaft. I could not find a way of getting it off, so I made a new coupling piece that clamps over it. It has a pointer so that it is visually obvious if the motors get out of step with each other.

I have uploaded both of these to Thingiverse. The other parts needed are shown below: -

And this is how they go together: -