I sent something similar to a friend who gave me two audio amplifier boards:-
I've failed with the PAM8403 audio boards. Removing the 22nF capacitors seems to tie output to supply Voltage. This may be due my poor unsoldering or the 22nF capacitors having oscillator functionality in addition to blocking DC drift from audio input. It may be possible to connect the 22nF capacitors to ground (for the purpose of oscillation?) and connect signal behind the capacitors (for the purpose of permitting DC drift for motor control).
People at my makerspace are quite amused that a turtle or tank robot could be controlled with stereo audio output and an 80 cent audio amplifier. Four or more PAM8403 chips multiplexed with a 4052 chip or suchlike and controlled with two or more GPIO pins would be particularly cheap but effective.
After a technical argument at the makerspace about Lego motor specifications, it was determined that approximately all Lego motors (from 3V to 9V, excluding servo motors) may be compatible with a PAM8403. This applies much more generally - if a PAM8403 chip can be made to work with a DC offset.
Also, two of the amateur radio enthusiasts and electronics experts at the makerspace were particularly impressed by the size and cost of PAM8403 boards. However, they confirmed that D-Class amplifiers cannot be ganged.
If anyone can get this working then you'll be *very* popular.
(Score: 2) by LoRdTAW on Thursday June 08 2017, @09:15PM (6 children)
Before going any further, why use audio amps to drive a motor? Cost? Novelty? Proof of concept? (From your post I gather proof of concept)
While they look like they can drive a motor, they are designed to operate at audio frequencies and the fixed impedance of the speaker coil. The non uniform impedance and noise of the motor due to brush bounce along with back emf might wreak havoc on any feedback control internal to the chip.
Why not use modern motor driver like the MAX14870 [maximintegrated.com]? All it wants is, power, a PWM signal, and direction signal via a digital pin. It even has a fault feedback pin. Code is kept simple and you don't have the problem of trying to get an analog signal out of the arduino using a DAC or PWM->Analog with filters or chip. A breakout board isn't as cheap as the PAM but it will do the job right the first time: https://www.pololu.com/product/2961 [pololu.com] Cheap compared to the time wasted trying to pound the square peg into the round hole.
(Score: 2) by cafebabe on Thursday June 08 2017, @11:45PM (5 children)
The friend who gave me two PAM8403 boards also had the most recent two issues of MagPi [raspberrypi.org]. (Issue 57 [raspberrypi.org] and Issue 57 [raspberrypi.org], although all previous issues are freely available plus bonus content [raspberrypi.org].) From Issue 58, several people are shocked that a 13 year old kid has been working on a Scratch to Python migration path for 15 months. That means the kid was 11 or 12 when he started.
Anyhow, I wanted to get into the mindset of doing stuff at pocket-money prices and mis-using cheap hardware; much like hackers at the Homebrew Computer Club who used televisions for computer monitors and cassette tape for storage. Now we've got a generation of makers who buy Bluetooth modules for US$4 and stereo amplifiers for US$0.80. The correct implementation would be to use a motor driver but the "worse is better" implementation provides eight channels at less cost.
If you get something like this working then geeks (who, in a previous era would have made a hot-rod, a hi-fi or an eight bit computer) will think nothing of making an eight motor robot and controlling it with a scripting language.
1702845791×2
(Score: 2) by LoRdTAW on Saturday June 10 2017, @03:29AM (1 child)
A simple test I can think of is to leave the board as is (leave the input caps alone), get a function generator, and see if a 1V peak unipolar signal using a square, or sine wave can cause motion. Experiment with different frequencies starting low. You also want an oscilloscope to watch the motor. Just be sure you know how to connect it. Don't put the ground of the probe to the motors negative, hook it to the boards power negative.
Now for some commentary.
(Score: 2) by LoRdTAW on Saturday June 10 2017, @03:31AM
Dammit.....copy pasta.
(Score: 2) by LoRdTAW on Saturday June 10 2017, @03:31AM (2 children)
Lets try this again:
A simple test I can think of is to leave the board as is (leave the input caps alone), get a function generator, and see if a 1V peak unipolar signal using a square, or sine wave can cause motion. Experiment with different frequencies starting low. You also want an oscilloscope to watch the motor. Just be sure you know how to connect it. Don't put the ground of the probe to the motors negative, hook it to the boards power negative.
Now for some commentary.
Misusing only works when it able to do what you want it to do. The bargain bin geeks don't purposefully misuse hardware, they recycle hardware. Usually they pick through trash and cannibalize parts from things like printers, DVD/CD players and so forth.
That's because the computers of old did use televisions as their monitors. My first PC, a Franklin Ace 1200, used a standard NTSC video monitor. If you wanted, any TV with a video input would work. Only those weren't common in the 70-'s/80's. By the 90's just about any TV you bought had a composite video input. I later used that monitor later on to watch TV and movies using a VCR, and hooked our Nintendo to it. And yes, cassette tapes were used to store programs in the 8 bit era. That wasn't a hacker thing, it was commercially available. There wasn't anything special about either of those two. The real geeks were building 8 bit computers from kits or on breadboards.
That's progress. Back in ye olde days, you could bread board or wire wrap your own analog or digital circuits for a few bucks. Things were less integrated and everything was pretty discreet. Back then you could build video frame grabbers, control relays, motors, read inputs, analogue control, etc. It was just more difficult and required a lot of knowledge because you pretty much had to build things from scratch. Now you have entire computers including ram and rom on a tiny chip with a boat load of peripherals for only a few cents. Even the PWM circuits in them can generate two and three phase outputs with dead-time control for motor control and even inverters. That level of integration was unheard of (and impossible given the technology of the era). The internet also played a huge role in bringing that knowledge to the masses much easier.
You have it backwards. Worse means "less functionality", functionality as in features. The idea is applied to software where adding more functionality doesn't necessarily make the software better. It just makes it more complicated. Worse is better simply means to build something with less features so you can focus on quality and simplicity. In your case, you are increasing the complexity and using components in applications they were not intended for which could decrease reliability. The "worse" route in your case would be to purchase motor drivers and build a robot the right way :p. There are other driver chips that are cheaper but they require you know how to do proper high/low PWM driving.
I see what your intentions are. I suppose the super cheap route is a motivator since money is limited. But I cant help but feel that this is more for getting geek cred or feeding an ego. To me, that's unfair to the other geeks because you're more concerned about this little endeavor than actually getting people motivated to build a cool robot. Focus on the robot, that's the important part. No disrespect in that statement. Only an observation. I see many maker types seemingly more interested in feeding their ego and trying to be the king of geeks at their maker space than being a good geek and getting the project done.
(Score: 2) by cafebabe on Monday June 12 2017, @11:26AM (1 child)
Will write more when able. After starting with two stereo amplifiers, I'm currently down to half of a stereo amplifier. Apologies for the lack of test equipment but placing an LED across the blown output is curious. By varying supply Voltage, the LED either blinks steadily, blinks chaotically or is visually continuous. I now presume that apparently steady output indicates that there may or may not be oscillation.
Anyhow, I got a PAM8403 to drive a motor via a chain of two 4052 multiplexer chips. In principle, this permits any of 16 pairs of motors to be controlled with stereo audio and four GPIO pins. The process is as follows:-
1702845791×2
(Score: 2, Interesting) by xyz on Tuesday July 04 2017, @12:54AM
3W RMS will get you around 1A and 3VRMS of course (given a 5V supply rail as is the case here).
Class D single ended is basically a totem pole (push / pull, half bridge) driving a ground referenced LC.
But for bridge tied load connections as the PAM8403 data sheet shows (speaker tied between Left_Out+, Left_Out-) that'd translate to a half bridge output on each of the two BTL output drive pins, so a full H bridge being driven in something which may be anti-phase or may be a bit more complicated than than.
The "more complicated" could be taken in the direction of something like a phase-shifted full bridge topology (used in DCDC power conversion) or some multi-phase power conversion topology.
Anyway I just happened to be reminded of the topological similarities of a class-D half-bridge output stage with a synchronous buck converter, which is also a push-pull half bridge output stage driving an inductive (actually LC filtered, just like a speaker) output when it comes right down to it (and with an analog input controlling the output by a control loop -- the feedback pin). And there are some $0.10 price class (albeit only in full reel volumes) synchronous buck converters that run off of 5V and which can produce say 2A at 0.6V...5V output ranges and which are capable of 100% duty cycles and run at ~1 MHz rates (though the control loop / soft start stuff probably limits it in TBD ways). Granted those seem to be the single vs. dual / quad channel ones, and they'd have either too few or too many (depending on your perspective) built in "op amps" / amplifier / PWM loops to work just like an analog in to PWM Class-D out converter though the basic error feedback amplifier / triangle wave PWM generator / ... internal loop as the datasheets will depict is analogous and interesting. You could probably abuse the "feedback pin" maybe with resistive negative feedback from the output mixed with an external analog input to servo the output or something...maybe.
Keep in mind that a voltage source needs an inductive or resistive impedance and can't be connected to another voltage source and so the "Class D" totem pole outputs derived from the PVDD/GND rail voltage sources can't mix directly because they're just switched voltage sources. But just like in a multi-phase buck converter you can parallel voltage sources through an L or R or such.
So between Class-D (E, F, ...) , sigma delta modulators (see below), single/multi-phase buck converters, hysteretic converters, and on into even more exotic things there's plenty of fun to be had at low cost using "switching techniques" and low cost drivers. Which is a pet-peeve of mine why more devkits like mid-range Arduinos or something don't have at least one or more H-bridges / op-amps / comparators / FET drivers or what not or at least PCB footprints for "add it yourself" ones. A banner feature of most MCUs are the ever popular PWM outputs but they make it all but impossible to use them for anything interesting (3W "audio", motor control, ...) external to the MCU without another $0.25 of discrete analog/power components.
https://en.wikipedia.org/wiki/Class-D_amplifier [wikipedia.org]
https://www.digikey.com/products/en/integrated-circuits-ics/pmic-voltage-regulators-dc-dc-switching-regulators/739?FV=1c0001%2C1c0011%2C1c00c5%2C1c0109%2C1c0003%2C1c0004%2C1c0006%2C1f140000%2Cffe002e3%2C1bcc0069%2C1bcc006c%2C1bcc006d%2C1bcc006e%2C1bcc006f%2C1bcc0070%2C1bcc0071%2C1bcc0073%2C1bcc0074%2C1bcc0075%2C1bcc0076%2C1bcc0077%2C1bcc0078%2C1bcc0079%2C1bcc007a%2C1bcc007b%2C1bcc007c%2C1bcc007d%2C1bcc007e%2C1bcc007f%2C1bcc0084%2C1bcc0085%2C1bcc0086%2C1bcc0087%2C1bcc0088%2C1bcc0089%2C1bcc00fc%2C1bcc0003%2C1bcc0004%2C1bcc01db%2C1bcc01dc%2C1bcc01dd%2C1bcc01e5%2C1bcc01e7%2C1bcc01e8%2C1bcc01e9%2C1bcc01ea%2C1bcc01eb%2C1bcc01f6%2C1bcc01fc%2C1bcc0202%2C1bcc020b%2C1bcc020f%2C1bcc0210%2C1bcc0006&mnonly=0&ColumnSort=1000011&page=1&stock=0&pbfree=0&rohs=0&cad=0&datasheet=0&nstock=0&photo=0&nonrohs=0&newproducts=0&quantity=&ptm=0&fid=0&pageSize=100 [digikey.com]
https://www.digikey.com/product-detail/en/diodes-incorporated/AP3429KTTR-G1/AP3429KTTR-G1DITR-ND/5359835 [digikey.com]
https://www.diodes.com/assets/Datasheets/AP3429.pdf [diodes.com]
Anyway some things may be of interest also depending on how much you want to go down the rabbit hole of analyzing / simulating / modeling / repurposing / designing such things:
http://personal.strath.ac.uk/barry.williams/book.htm [strath.ac.uk]
https://www.scilab.org/scilab/features/xcos [scilab.org]
http://www.cppsim.com/ [cppsim.com]
http://www.linear.com/solutions/ltspice [linear.com]
http://www.electronicdesign.com/analog/signal-processing-density-domain-part-i [electronicdesign.com]
http://www.electronicdesign.com/analog/signal-processing-density-domain-part-ii [electronicdesign.com]
http://www.electronicdesign.com/analog/signal-processing-density-domain-part-iii [electronicdesign.com]
http://www.electronicdesign.com/analog/signal-processing-density-domain-part-iv [electronicdesign.com]
http://www.electronicdesign.com/analog/signal-processing-density-domain-part-v [electronicdesign.com]
http://www.electronicdesign.com/analog/my-favorite-modulator-only-needs-leftover-components [electronicdesign.com]
http://www.electronicdesign.com/analog/integrate-your-signals-digitizing-them [electronicdesign.com]
http://www.ti.com/lit/sg/sluw001f/sluw001f.pdf [ti.com]
http://ww1.microchip.com/downloads/en/AppNotes/01114A.pdf [microchip.com]
https://www.onsemi.com/pub/Collateral/SMPSRM-D.PDF [onsemi.com]
http://www.linear.com/product/LTC3861 [linear.com]