code base for multiple projects; you just need a unique
calibration.json file for each gauge. All other code will
remain the same!
I think it’s time to dig a little deeper into the code.
The process I followed when putting together the RG-Stepper driver makes a good place to start.
The first thing I did was document how a
bipolar stepper works. Figure 18 shows the
polarity of the coils for each of the eight steps a bipolar
stepper follows when using half steps. The half steps occur
when one of the two coils are turned off; steps 2, 4, 6,
and 8 are half steps. A drawback to using half steps is the
torque of the stepper is reduced as only one coil is
I should give a plug to Thomas Hopkins’ AN235 app
note from www.st.com. He does an excellent job of
explaining how you can increase the current of the
energized coil to compensate for the half step torque
reduction. The half step torque reduction is not an issue for
this project since we’re only driving the gauge’s needle
with our automotive dashboard stepper, so I didn’t need to
compensate for it. With half stepping, we now have 1,200
steps to represent 315 degrees of movement. This gives us
good resolution, so you shouldn’t have a problem lining up
the gauge’s needle with a value on the gauge face.
Next, I mapped out each of the eight steps in a table
■ FIGURE 19. Half step logic table.
■ FIGURE 18. Half step sequence for a bipolar stepper (from Thomas Hopkins’ AN235 app note).
■ FIGURE 17.
24 December 2017