Gaugette

a simple and cheap Arduino analog gauge using the Switec X25.168 stepper motor.

How Fast Is It?

I recently removed the internal stops on a VID-29 stepper. I’ve used this free-turning motor and an optical sensor to exerimentally test some operational limits of the motor. The test rig uses a photo-interruptor to determine the needle position:

Methodology

I move the need forward under varying conditions, then move the needle back to the home position in a known-reliable manner while counting the steps. If the steps counted back do not match the number of steps programmed forward then we know we have exceeded the operational limits of the motor.

After some experimentation I selected a delay of 1000μS per step for the counting phase as this is well within the safe limits of operation. I confirmed that in this safe range I get reliable results counting steps confirming that the sensor is accurate enough to detect a single one-third degree step.

Note: Be sure your needle is tight! Until I eliminated needle slippage, my results showed anomalous drifts both above and below the expected values.

Constant Speed Test

In this test the motor is turned at constant speed to identify the maximum constant speed that the motor will respond to. The speed is set by manipulating the motor accelleration table. I also recorded the total sweep time with the micros() function to determine the variation between the programmed inter-step time and the actual inter-step time.

The following table shows the results from the constant speed test. Each test was repeated 5 times. In each case the expected result was 500.

Delay μSTest 1Test 2Test 3Test 4Test 5Actual μSSteps/Sec°/S
5004-64-645091964654
5204-64-645301886628
5402-42-425491821607
5602-42-555681760586
5802-42-425891697565
600927-426101639546
620500506500926301587529
6405005005005005006491540513
6605005005005005006681497499
6805005005005005006911447482
7005005005005005007111406468
7205005005005005007291371457
7405005005005005007491335445
7605005005005005007711297432
7805005005005005007911264421
8005005005005005008101234411

Results

The results show that with a programmed step period 600μS or less the motor could not advance with each step - and in fact often moved backwards. At 620μS the results were unreliable, and at 640μS and above the motor behaved reliably.

The actual inter-step delay was 8 to 11 μS more than the programmed delay.

Observations

I compared my results with the VID29 data sheet which states rather confusingly that “The angular speed can reach more than 500Hz” (presumably they mean °/S, not Hz?), and elsewhere that the maximum driving frequency is 600Hz (I can’t make any sense of that). The ~10μS difference between programmed delay and measured delay gives a useful measure of the error of the timing logic in the SwitecX25 library.

In setting up this test I discovered a bug in the SwitecX25 library: the library does not enforce a timing delay between the last signal change before stopping, and the first signal change after starting. This only exhibits if the motor is stopped and immediately restarted (within ~600μS). Because the two signals come too close together, the step may be missed. This leaves the motor out of phase with the libraries state map, and it appears the motor then misses 5 more steps before it gets back into phase, so this error shows as a 6-step error.

Test Code

Here’s the full source code for this test.

Comments