Gaugette

Building gauges and gadgets with Arduinos, Raspberry Pis and Switec stepper motors.

Jan 26, 2012 - 3 minute read - Comments - Switec X25 Arduino

A Simplified Acceleration Model

The logic in the advance() function of the Switec X25 library steps the motor forward or backward one step, then computes the delay in microseconds until the next step is due. This logic determines the acceleration curve and maximum speed of the needle. My first cut at this code used floating point arithmetic to model this as time/accel/velocity problem. The motion was nice and smooth, but it was overkill, and consumes too many precious Arduino compute cycles. When driving multiple motors, this will create an artificial ceiling on the maximum motor speed. I’ve rewritten that logic to use a simple lookup table instead. This is a fairly obvious approach, but it was reassuring to see similar approaches recommended in both the VID 29 documentation and the MCR MR1107 data sheet .

Jan 23, 2012 - 1 minute read - Comments - Switec X25 Arduino

Two Motors, One Arduino

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.