Close

Audio Amp Motor Driver - New Chip, surprising biasing + Linear Thoughts

A project log for Random Ridiculosities and Experiments

Sometimes yah's just gots tah try somethin', regardless of whether it'll become a full-fledged "project"...

eric-hertzEric Hertz 01/12/2016 at 06:280 Comments

2022-02-05: Heh, stumbled on this old draft from 6 years(?!) ago....

Soldered up the new chip: TA8251AH. This guy could potentially drive *4* motors.

In a sense, its interface is a lot more like a typical motor-driver than the last chip, TDA1510, which has a typical op-amp (or comparator) style interface.

By which I mean... each "channel" on the TA8251 has *one* input and *two* complimentary outputs...The TDA1510, on the other hand, essentially had two separate op-amps, each with inverting and noninverting inputs... so to drive a single motor, 4 inputs had to be taken into account (again, as opposed to *one* on the TA8251).

(Both chips are single-supply; ground and V+, no V-. I'm using 12V)

For the TDA1510, this meant I could treat its inputs (somewhat) like a comparator... To drive it with a PWM signal from a microcontroller, I managed to use some simple voltage-dividers to bump the 0-3.3V PWM signal up to something more like 5.5V to 6.5V, and bias its other terminal to 6V... (explained in the last log). So, when the PWM signal is 0V, the non-inverting input is ~5.5V, this is less than 6V, so the output of the "comparator" is low... Similar for the other case: 3.3V -> ~6.5V > 6V -> output high.

I kinda figured, since the TA8251 only has one input (presumably the 'non-inverting' input, while the 'inverting' input is internally biased).... that the bias-point would be around 1/2 V+, or 6V in this case...

Interestingly, the TA8251's input is biased at 0V! That means 0V at its input results in 6V at both its outputs. About 0.4V at its input results in 12V at the positive output and 0V at the negative output. But, then... how do I get 12V at the negative output and 0V at the positive, to reverse the direction of the motor (or handle the negative half of a sine-wave, if it's driving a speaker, like normal)? Despite being a single-supply chip, it requires ~-0.4V to swap the output polarity!

OK, so that's an interesting bit to consider... how'm I gonna get a 0->3.3V microcontroller signal to go *negative* without a second power-supply...? LOTS of ideas been runnin' up through this head... including creating a negative supply with a 74HC04(?) oscillator, capacitor(s), and diode(s), then using a similar "voltage-divider" scheme as with the TDA1510, except in reverse... Seems doable, but that voltage-divider scheme actually uses quite a bit of current, especially since the input-resistance of this chip is spec'd at 30kohms... might be hard to keep that negative voltage steady, with such a large load.

Then there's the other thing... This guy switches *much* more slowly than the TDA1510. In fact, the TDA1510 was having little difficulty keeping up with ~32kHz PWM, and its sharp edges, despite being *way* outside the audio-range. This guy, OTOH, is *just barely* switching from one rail to the other with 32kHz PWM at 50% duty-cycle. Fine, that's expectable, if someone drove a 20kHz signal at rail-to-rail on a 30W speaker-system, they'd probably be excruciatingly uncomfortable... and that'd be a sine-wave, not a square with all its higher harmonics... So, this thing probably works fine for audio, even at extremes. But it's a little less ideal for motor-driving.

So, a running-thought has been to possibly experiment with driving the motor with a *linear* voltage, through these inherently *linear* audio-amps... Some ponderings: Would they produce *more* or *less* heat this way than essentially switching from rail to rail? Note that most actual motor-drivers work with the transistors in *saturation* off or on... for BJT-based systems this means emitters are typically tied to the rails. In an audio-amp, however, it seems the typical method is to use the emitters tied to the *load*... can they saturate in this configuration? Several other thoughts along those lines...

Another thought: Without *switching* (using a linear voltage, instead), combined with the feedback-loops used in op-amp amplifier circuits (does this chip have an internal feedback loop...? hmmm)... it might be plausible to not need freewheeling/flyback diodes... I haven't quite wrapped my head around this one, but it's something to ponder. Am-Thinkink, the feedback loop should take care of noticing that the output voltage is higher or lower than expected, and compensate accordingly... right?

(And would this linearization affect the motor's positional-controllability...?)

Anyways... Regardless of whether I choose to go the linear-route, I still have to figure out how to supply a negative input voltage from my positive PWM signal. I can average it, of course, using a resistor and capacitor, to come up with a linear output voltage to feed into the amplifier, but it'd still be 0->3.3V.

For PWM values not near 0% and 100% duty-cycle, I can AC-Couple it... And that actually works pretty well. Also, this chip appears to *actually* output rail-to-rail, so losing a few % of the duty-cycle-range is roughly the same as the loss in power-output-range from the other chip which clipped at a couple volts lower than the upper rail... (~10V).

That's the easy solution... 50% duty-cycle = stop, "full-forward" is something like 80%, full-reverse is something like 20%... Just configure the software so the minimum and maximum PWM duty-cycles assure that the 3.3V signal still exceeds -0.4V and 0.4V on the other side of the AC-coupling capacitor... No prob... Again, the motor itself will never see the full power capable of being supplied by the rails, nor the amplifier-chip, but that seems to be a functional solution... 80% of 12V isn't enough for yah...? Use 18V.

Alright.

Then I got fixated on trying to figure out how to squeeze that extra 20% out of it, or something... and... wound up back to linear..

Actually, was it that I wanted that extra 20% or that I wanted to figure out a way to drive it linear with the negative-input requirement...?

Anyways.

I had the brilliant idea... what about a "peak detector", which would maintain the value of the negative peaks coming out of the AC-coupler...? Feed that into a capacitor, and the output should always be the lowest-value... Then voltage-divide/calibrate that back up so that 50% PWM results in 0V to the input... Brilliant, right...? Except, of course, feeding this into a capacitor to "maintain" the negative peaks means that when the PWM value increases (to attempt to reposition the motor), the negative peak from before will still be stored... brilliant fail. And so many more fails in that line-of-thought that I can't quite recall at the moment. Lots of consideration of time-constants and load resistances that I hadn't really pondered... and more.

Oh yeah, another brilliant fail on this front... well, lemme show you the circuit...

0->3.3V PWM (20-80% duty cycle) 
                V+
                ^
                |
                \    Bias around
                /   / 3.3V / 2 + 0.4V ?
                \  /           - ?
                | /
0->3.3V >---||--+--|<|----+----->  >----.
                |         |             |
                \        ===            \ Amp
                /         |             / Input
                \         V             \ ~30k
                |        GND            |
                V                       V
               GND                     GND

OK, great, right...? The idea being to do the "calibration" on the *supply* side, rather than the *load* side (where R/C constants would be a bigger concern). But the "negative peak" detector *never goes positive*. Duh.

So, realistically, there needs to be some sort of "pull-up" resistor on the capacitor-side of the diode, and then R/C becomes a big concern, and all the other factors of peak-detection (and over-maintaining) and whatnot came to mind...

Was about to call it quits, but then it came to me... I don't want it *always* pulled-up... I want it pulled-up whenever the input-signal *goes* up... The input to the peak-detector being a rectangle-wave with a constant magnitude (3.3V), which varies in *offset* (as a result of varying duty-cycles)... I want increasing positive peaks to pull up the negative-peak-detector...

this came to me...

0->3.3V PWM (20-80% duty cycle) 
                V+
                ^
                |
                \
             R1 /
                \
                |
                +--|>|----.
                |         |
                |       __|__|
                |      | / \   3.3V
                |       /___\  Zener
                |         |
0->3.3V >---||--+--|<|----+----->  >----.
                |         |             |
                \        ===            \ Amp
             R2 /         |             / Input
                \         V             \ ~30k
                |        GND            |
                V                       V
               GND                     GND

Check it out! When the positive peaks increase, the detector is pulled up, when the negative peaks decrease, the detector goes *negative*. The capacitor... well, shoot, now what does that do...?

The whole thing's not an *average* but it kinda takes the average *of a single cycle*, and is relatively immune to the load resistance... R1 and R2 can be a potentiometer for calibrating the offset-voltage

Discussions