15 years ago
servo power line. My hope was to use current information from the
buggers as a basic force feedback. I put a low pass filter on the
output of the current amplifiers and ran that into an ADC. Problem was
- I never got very good data from it. Pretty much no data at all. I've
been really busy with other things (mostly gait generation), so I
couldn't spend much time figuring out what was wrong, so I essentially
just forgot about it.
Anyways - I inherited an old analog scope, and have been messing
around with it today trying to figure out how to use it (I'm much more
used to the high end DSOs that we have in my university's labs)
I decided to take a look at the output from those high side current
amplifiers, expecting utter rubbish to be on the output. Instead - it
was a nice clean square wave. I then added in a second channel which
was the PWM pulse I'm feeding it, and no big surprise here, the
current square wave starts right after the PWM signal's falling edge.
What I find interesting, however, is that the magnitude of the current
square wave is pretty much constant. Instead, the duration of the
square wave is what varies with load on the servo! The harder I press
against the servo, the longer the current pulse gets. All with a very
nice and constant amount of current. I had previously read in the
amount of current flowing with my multimeter and found a sort of
exponential relationship with load vs. current - but that must be
because my multimeter was averaging! Suddenly now, everything makes
sense. This also explains why I found that max current tapers out as
you increase the PWM frequency - I suspect that at a certain point the
duty cycle of the current pulse hits 100% - hence it tapering out.
It's annoying though - the ADC isn't even really necessary. I just
need to time how long the current pulse is. I think in the next
iteration of my leg controllers I'll just put an op-amp integrator on
the lines so that I don't have to waste extra CPU cycles on it. For
now - I'm just going to constantly sample the ADCs and watch for the
falling edge of the current pulse.
Well, hope this is helpful to somebody out there. Wish I had figured
this out sooner!