Last night I built a pair of improved wiring harnesses so I could connect two motors to the Arduino. Once concern I have is that the control logic that manages the acceleration and deceleration could be so slow that it will interfere with the motor drive signaling when trying to control more than one motor. I have in mind to replace the floating point logic with a lookup table, but for now I like being able to easily fiddle with the motion parameters.
My first cut at the Switec X25 library
stepped the needle at a constant speed. You can see the constant speed
motion in the original video.
Wiring It Up
Given the comments by Toby Catlin
about cooking the motors while soldering, I opted to make up a harness with a connector rather than
soldering directly to the motor.
The pins on each winding exactly match the spacing of the first and fourth pins
of a standard 0.1” connector. JST RE connectors are the right pitch, but the pins on the motor are
too short and too narrow to engage with the connectors. For my first harness I cut up
a floppy disk cable connector into two 4-hole sections and soldered wire to the first and fourth
pins. It worked fine but it is pretty bulky, and the metal contacts in the connector did not solder
very easily. For now I just pushed the tinned ends of the wires directly into the Arduino connectors.
I wrote some code for the Arduino to step the motor using the IO pattern established
in this post
and a quick ruby script to query my pfSense firewall to get some live data to test with.
Gaugette is a project detailing the construction of custom analog gauges using
an Arduino microcontroller and Switec X25.168 stepper motors.
Each motor requires 4 digital I/O pins,
and a single Arduino can drive three motors. The limit
is purely due to Aruidno limit of 14 digital I/O lines.