Close

Class-D audio-amplifier as a DC-motor driver?

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 12/15/2015 at 03:3413 Comments

Acquired a bunch of TDA7490 Class-D audio-amplifiers from The Electronic Goldmine for a great price a while back with the intention of trying them out as DC-motor drivers...

A bit ridiculous, but who knows.

Now I'm in need of a semi-permanent DC-motor driver for another project, and so-far all my latest are merely breadboarded, so I thought I'd try it out.

A few things:

There's probably more I'm forgetting...

Either way, that last bullet-point is a bit annoying as far as using this chip as a motor driver in *several* projects... This'll probably end up being a one-off. So I decided that even if this doesn't work as a motor-driver, I could make use of it as a... *cough* audio-amplifier *cough*. So I decided to make a somewhat general-purpose board for experimenting that'll also be usable as it was intended.

The beginnings of which are shown in the image, above...

I usually do point-to-point hand-wiring for one-off things like this, ("infinite" layers for "traces"!), but I'm running low on solderable-breadboard of that size... And this'll be somewhat permanent one way or another, so why not try my hand at PCB-etching again (it's been over a decade!). I haven't any laser-printer toner in my possession, and my laser isn't yet attached to a reliable 2-axis system (seriously, @johnowhitaker figured out how to laser(verb) toner directly onto a PCB, brilliant, and definitely in my TODOs once I have my 2-axis system running!). and I don't have a laser-printer for toner-transferring, so I'm trying the "old" method of PCB-etching... traces drawn by-hand.

I tried to hand-draw the thing on paper before laying it out, but it's a little bit difficult for several reasons, so I ended up drawing it in a regular ol' PCB program (gEDA PCB)...

This layout is *highly* derived from the example in the datasheet, but of course modified for my multi-purpose experiments, and a few other things.

The Copper-Clad board I decided to use is *pre-drilled* at .1in spacing, so that's kinda handy and kinda not. It definitely makes layout a bit more complicated... Nevermind all the pins needing to be .1in (which, again, the chip isn't), there's also a bit of work to be done to assure that traces don't go through holes and get cut in the process. A few other things, as well... Also some consideration as to how to solder on both-sides things that mount right-atop the board, like the big-ass capacitors and the terminal-blocks (as opposed to having leads that stick a little above it, like resistors and ceramic-caps).

This project would've been done several days ago if I'da done it point-to-point on a breadboard. But now I'm *finally* on to transferring (by hand) from the PCB-layout in software to the copper-clad board (again, shown in the first picture).

Some of the really skinny traces and traces-between-pads will be difficult with a permanent-marker, but I long-ago acquired a bunch of stuff from a robo-hacker friend who went guitarist, including a bunch of these press-on/rub-on "dry transfers" from RadioShack that should handle the really tight spots.

The latest delay is that my permanent-marker-traces bridged a little bit in a few places, and I accidentally drew a crossover of one trace, so I need to figure out how to clean those up... worst-case-scenario I'll etch then fix it up with a razor-knife or dremmel, but I'd like to clear it up before etching (I figure there'll probably be a few non-pen-related issues in the etching-process, anyhow... better to alleviate as many as possible from the start!)... So I'm thinking either a cotton-swab and some alcohol, or maybe a toothpick... both of which might just result in spreading it 'round. Alternatively, maybe just *scrape* the ink off those areas...

This was supposed to be finished *days* ago... the project I'm doing this for has been in-the-works and thus non-functional for far too long!

(The project this is for is the first axis of a large modular 3-axis system... hopefully usable for several purposes including a lathe, a mill, a [PCB] router, laser-table, and (with this first axis) a drill-press, The mechanics of the first axis are functional. The "drill-press" idea includes a second motor which will be used-as/attached-to the lever... A feedback-loop between the two motors (and encoders) will, hopefully, allow for force-feedback despite the significant gearing-down of the axis-motor. Another new experiment...

Discussions

zakqwy wrote 12/15/2015 at 15:02 point

your PCB layout reminds me of space invaders and that makes me happy.

also i bought an LM3886 something like... i dunno, 15 years ago, with the intention of building an amplifier of some kind. Never happened. Yours if you want it.

  Are you sure? yes | no

K.C. Lee wrote 12/15/2015 at 15:07 point

I actually built ghetto amplifiers modules into heatsink with those LM3886.  :)

  Are you sure? yes | no

Eric Hertz wrote 12/16/2015 at 03:37 point

Hah, thanks! I thought Space-Invaders, too :) Happy coincidence, and surely a lot stole from the ST design. Not *intended* on my part :)

I think I'm stocked on audio-amps for now, still have four of these TDAs! But thanks for the offer! But, whoa! That looks a heck of a lot easier to work with... and much more thorough documentation... Build It!

Just finished etching, bouts to clean up

  Are you sure? yes | no

K.C. Lee wrote 12/15/2015 at 04:31 point

Take a look at the left half of the instrumentation amplifier (just before the R1/R3 and the rest of the differential amplifier which is connected to the speaker).  The BTL amplifier is wired up the same way with V2 = Gnd.

http://masteringelectronicsdesign.com/how-to-derive-the-instrumentation-amplifier-transfer-function/

They explain how the circuit works much better than I can type.

  Are you sure? yes | no

Eric Hertz wrote 12/15/2015 at 05:06 point

Cool thanks. I'd looked around for BTL circuits (many of which look quite similar) but I hadn't thought to look for an instrumentation-amp.

  Are you sure? yes | no

K.C. Lee wrote 12/15/2015 at 06:02 point

Me neither until I was typing up the reply trying to explain it with inverting amplifier, then I noticed the symmetry and instrumentation amp came to mind.  Now it makes sense.

  Are you sure? yes | no

Eric Hertz wrote 12/15/2015 at 06:56 point

great observation!

  Are you sure? yes | no

Eric Hertz wrote 12/18/2015 at 03:42 point

TBH, that page has much too much math for my taste... so I did some analysis of my own from the image you linked (thanks for that). Some interesting results: It looks like the output voltage of the lower op-amp will, in fact, be slightly lower in absolute-value than the upper op-amp's output... which means the "bridged" output will not be centered at zero. (IG goes through R55 and RG for the upper-output, but only through R6 for the lower-output). Not a big deal, but an interesting observation. 

I think that also means that adjusting the gain changes *something* at which "clipping" occurs... I haven't fully wrapped my head around it, but something like in a normal op-amp circuit, clipping occurs at input * gain = V+, whereas in this circuit it's something more like input * gain^2 = V+ (or something). Again, not particularly relevent, but another interesting observation.

Similarly-interesting-but-unrelated: It looks (again, to me) like adjusting the voltage input to the second op-amp (e.g. setting it to 1V rather than 0V) has the effect of adjusting the *gain* of the circuit. This I find quite interesting, as it basically means all those 2-potentiometeres-in-one used for headphone-amplifiers, stereos, and whatnot could be replaced with a single potentiometer, using this circuit... Or, even more interesting, a *voltage-controlled gain* could be controlled by e.g. a uC PWM output. Cool! Another case where this intrigues me is e.g. this old Jukebox Amplifier I've got sitting-around which has a volume-control which A) only uses one potentiometer for stereo, and B) has a *delayed* change-in-volume, as though its volume potentiometer is connected to a capacitor. (which could be done with a voltage-controlled-gain circuit, but not with a typical input-voltage-divider-controlled-gain/op-amp circuit). I wondered how it worked, and this might well explain that. Besides making for a nicely-ramped volume-adjustment, this also serves to basically elliminate noise from a dirty potentiometer (excellent), as changes on the potentiometer's output is essentially "debounced". Very cool, and something I might just have to add to my Marantz stereo if/when I ever hack it.

I remember learning about instrumentation-amps in school, but I don't remember those observations. Thanks for commenting with this!

  Are you sure? yes | no

K.C. Lee wrote 12/18/2015 at 04:08 point

This is the droid that you are looking for:  V12 = -V11 * R6/(R5+RG)

(dark equation on my browser because of transparent background.) 
So to make them symmetrical around 0V,  i.e. V12 = -V11, 

it follows that R6 = (R5+RG).  So for R5 = R6, RG=0

I have no idea what the actual circuit would do without doing a simulation, but that's what the math says.

  Are you sure? yes | no

Eric Hertz wrote 12/15/2015 at 04:02 point

One of the "multipurpose/experimental" add-ons was an option to directly-connect potentiometer-voltage-dividers to the inputs... If this works, when the POT's at 50%, the motor shouldn't move, when it's at 0% it should be full-speed reverse, and 100% would be full-speed forward...

In a sense, this amplifier-chip could be used pretty easily for standalone motor speed-control. It also has some feedback pins, which, now that I think about it, could plausibly be wired-up to some sort of speed/position sensor...

It seems almost plausible to create something almost exactly like a high-power R/C servo with little more than this chip, its support-components, and a potentiometer attached to the motor-shaft... Hmmm... The majority of the circuit analog, but the output with the benefits of PWM... interesting.

  Are you sure? yes | no

K.C. Lee wrote 12/15/2015 at 03:50 point

I am pretty sure that the "0" bias point is at the gnd level.  
In fig 3 for the BTL connection, one of the channel has the preamp input connected to ground.  So if the bias point wasn't at gnd, then the offset would be amplified.

  Are you sure? yes | no

Eric Hertz wrote 12/15/2015 at 04:09 point

One would think... but since you've looked that far, maybe you'd be interested in another curiosity of BTL mode... The feedbacks are connected... So, imagine a case where the input signal causes that output to "rail" positive... Logically, if the output is "more positive" than GND (on the second input), then the second output will go negative to compensate, right...? Except there's a voltage-divider in question, and the voltage divided into the second amplifier is *inherently* lower than ground... (52.3k+4.7k up top, but only 52.3k below), so then the second output will go positive again... which means the output won't be centered at ground, but will, in fact, have an offset toward positive...

  Are you sure? yes | no

Eric Hertz wrote 12/17/2015 at 09:57 point

Looks Like!

  Are you sure? yes | no