Hi folks, I'm trying to build my first EMC-controlled servo, and I've
got some questions. I'm building it out of a small brushed DC motor
(a Pittman 8322 with shaft encoder ) and a home-made copy of Jeff
Epler's L298-based servo driver . I'm controlling it with EMC 2.1.6,
feeding it PDM & direction signals over a parallel port.
My first question is, does this seem like a reasonable motor to make
a servo mechanism from? Given the limitations of its torque output,
of course. The motor specs:
reference voltage: 19.1 V DC
no-load current: 0.16 A
Peak/Stall Current: 2.51 A
Continuous Torque: 1.6 oz*in
Stall Torque: 7.4 oz*in
no-load speed: 7847 rpm
encoder: 256 lines per revolution
The first step was to read the encoder, that was easy and works fine. The
encoder produces 1024 edges per revolution. I'm sampling the A and B
lines at 40 KHz, so by my calculations I should be able to reliably keep
track of position up to about 1100 or 1200 rpm.
The next step was to spin the motor, and that's where I'm running into
issues. At 0% duty cycle the motor is stopped, and at 100% it runs fast,
so that's good. However, the mapping from duty-cycle to rpm is confusing.
Duty cycles from 0 to about 55% give me increasing whining from the
motor but no movement at all. 55 to 100% gives increasing motor speed
I'm using a driver circuit basically identical to the one published by
Jeff Epler (thanks Jeff!). The only power supply I have access to right
now is an ATX one scrounged from some dead computer, so I'm driving
the motor at only 12 V; it's rated for 19.1 V so that's probably part
of my problem. Just like in Jeff's example, I run a PDM pulse train
into the H-bridge enable pin, and direction and not-direction signals
into the two H-bridge inputs. The resolution of my pulse generation
is 100 us, so the pulse train has transitions at no more than 10 KHz,
well below the 25 KHz nominal commutation frequency of the L298 H-bridge.
So my main question is: What, if anything, can/should I do about the
dead band from 0 to 55% duty cycle? Live with it and tune it out in the
I built this big goofy HAL "circuit" that adds 0.56 to duty cycles above
0.01, it worked but feels kind of kloodgy.
What causes this motor behavior? I guess at those low duty cycles
(especially given the low input voltage) the energy being fed to the
motor is not enough to overcome inertia or static friction or something.
I tried increasing the pulse-generating period, up around 1 KHz the motor
became more responsive but also more "clicky" and it ran kind of rough.
I think 10 KHz is about as slow as I want to go.
If I can get this servo moving reliably I'll build two more, and put
them on a McWire Mill .