Our doubts are traitors
And make us lose the good we oft might win
Moving a microscope stage around is not an easy job. Made more difficult by trying to retrofit motion on a manual scope. (There is a very good reason why the commercial solutions are so expensive — it’s a complicated problem.)
Dr. Kott started the project using the setup designed by the pathologist in Australia. But had problems. And so we played with different steppers. Different controllers. Different methods — steppers and gear? Steppers and linear actuators? Move the slide, not the stage? Attach the motors differently? We’ve gone back and forth a hundred times.
Two primary issues: How to drive the knobs (hardware) and how to control the motors (software).
Writing up our thought processes would probably take a novel, so let me summarize some key “lessons learned” for those working with steppers and wishing to automate microscopes, telescopes, X/Y plotters, or whatnot.
If you are using bipolar steppers, or unipolar steppers which can act as bipolar, I recommend motor control boards such as the Easy Driver (available from Brainy Bits, and others). These are excellent motor controllers — but their limitation is bipolar steppers. (Dr. Kott found these, and I highly recommend the technique — if you are using bipolar steppers.)
Which comes to our problem: The steppers were are using are the extremely common 5 wire unipolar geared steppers. They are small, and geared, so are perfect for applications such as this. But, the nice stepper drivers out there (like the Easy Driver) won’t work with them. So you have to use their included “controllers”.
And their “controllers” are a misnomer. They are NOT stepper controllers. They are simply Darlington Transistor Arrays — a method which allows a low power device (like an Arduino) to control higher powered devices (like DC motors). They aren’t “smart” like the Easy Driver. It’s not a smart chip — it’s just a bunch of power transistors in a DIP.
On the software side, we’re using an Arduino. The long and short of it is that you should use the AccelStepper for most all of your stepper needs. It’s well written. It’s non-blocking. It has a lot of neat features. Don’t bother with the default Aruino stepper libraries — just start with AccelStepper.
But, we didn’t use that.
Why? Because I was lazy and didn’t want to recreate the wheel. While researching how folks were using the geared unipolar steppers, I was reminded of a Geek Mom post about a stepper controlled Etch-A-Sketch.
And guess what? She used exactly the same motors. And needed to move things in almost exactly the same way as I did (X/Y). And had already written the code.
So I took her library, stripped out things I didn’t need, and now use it as our primary method of working with the motors. It doesn’t use AccelStepper, but it does handle everything we needed. And works perfectly with the unipolar steppers and their “controller”.
Believe it or not, this is the super-short summary of our motor control process. In the end, we used these inexpensive geared unipolar steppers, their included boards, and a library created by someone automating an Etch-A-Sketch. That’s what Product Development is all about.
Next up: Controlling it.