Shop OBEX P1 Docs P2 Docs Learn Events
Possible loading effect of PWM signal? — Parallax Forums

Possible loading effect of PWM signal?

John A. ZoidbergJohn A. Zoidberg Posts: 514
edited 2011-10-09 23:26 in General Discussion
Hey there,

Been busy with work nowadays, and just have something to do on the empty weekends, which is constructing a WAV player.

So, I actually get the microcontroller-based WAV player working, and all on the breadboard, but with a problem - it works on the PWM frequency of 39.025kHz, and a TDA7052, but the volume is terribly low.

The same configuration on another microcontroller training board (all soldered, SMT), the files played very clearly (and loud). The TDA7052 is still in the breadboard while the input is from the (manufactured) board.

Then, getting back to the breadboard, I cranked up the PWM frequency to 100kHz, and I hear nothing much and it sounded like a constricted rubber tube which desperate to flow out the water. The volume was even much lower than before.

I'm here to confirm this: 100kHz frequency doesn't work with the breadboard? Or, it is a hit-or-miss thing? :)

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-09-25 03:16
    I suspect the breadboard is a bit of a wild card. It may add high resistances and stray capacitances at the connects - one or both would make the results rather bizarre and unpredictable. Consider that fact that the idealized op amp is supposed to be infinity gain and dependent on a solid feedback loop for the desired end result. You may not have anything close to what you think you are getting.

    Elliot Sound Products has some very nice 'universal op amp' boards that you can build off of in any fashion you desire. Take a look at their website.

    http://sound.westhost.com/

    BTW, you may have brought down the frequency response range with your feedback. Again, Elliot Sound Products has info on how this occurs. He writes extremely well and offers a lot of audio info.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2011-09-26 04:56
    I suspect the breadboard is a bit of a wild card. It may add high resistances and stray capacitances at the connects - one or both would make the results rather bizarre and unpredictable. Consider that fact that the idealized op amp is supposed to be infinity gain and dependent on a solid feedback loop for the desired end result. You may not have anything close to what you think you are getting.

    Elliot Sound Products has some very nice 'universal op amp' boards that you can build off of in any fashion you desire. Take a look at their website.

    http://sound.westhost.com/

    BTW, you may have brought now the frequency response range with your feedback. Again, Elliot Sound Products has info on how this occurs. He writes extremely well and offers a lot of audio info.

    I read some of the articles provided. Unfortunately, my analogue electronics knowledge is very, very limited (only one semester), so I had to digest the articles very, very slowly.

    I will set up a stripboard and solder the stuff inside and start playing the music again. :)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-09-26 05:32
    Foremost, you need to have already selected a good low noise op amp for audio use. You might try a TL-072, right? You really are going above the audio range with that TDA7052, which is intended for audio. It just may be the wrong chip at 39Khz and 100Khz. Another problem might be that you are trying to power it with the low end of the voltage range and that may not be enough for you power demands.

    Secondly, your reading should really be focused on op amps and not much else. The way linearity over a large bandwidth is obtained is to limit the gain. You may have just tried to make one stage have too much gain and the results were a more limited bandwidth. I'd consider not going above 12db for any one stage.

    Finally, op amps have a lot ability as active filters. If you are not keeping your circuit simple, you may accidentally create a filter that you don't want.

    There are some very special concerns if you are using the op amps to work on extremely low level signals from a phono cartridge or microphone. At that point one has to concern themselves with noise created by components - particularly in the first stage of gain. But I suspect that is not the case for you. Often a JFET first stage is employed as the noise levels can remain 60db below the signal level by using them. But there are some specialized op amps with JFET front ends now that claim ultra low noise attributes. The Tl-072 is one of them.

    The chip you are using is actually a 1 watt audio amp and considered a 'power amp'. That means it combines amplification of the voltage and amps together in one package. But it can be made to behave somewhat like an op amp with feedback theory.

    As indicated above, if you need more gain - add more stages. If you need more power, a specialized op amp which is called a buffer will provide the final stage with a boost in power. Or you can use devices such as transistors or MOSfets for the final power stage.

    I do realize this may not be the solution you wanted as your chose a one-chip audio amp as a solution, but the 39Khz and 100Khz range are not really suited for generalized audio that cuts off at the 20Khz to 30khz range for performance.

    You just might be able to use a TL-72 as a pre-amp and the TDA-7052 as the power amp. In between the two stages on the TL-72, you would have to smooth the PWM to get audio from 20hz-20khz, without the PWM.

    Or, just maybe you forgot a capacitor coupling on the front end of your TDA-7052 and my suggestions are unnecessary.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-09-26 06:01
    Zoidberg,

    Could you re-phrase your situation?
    It must be something simple.

    Maybe a block diagram?
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2011-09-26 06:25
    PJ Allen wrote: »
    Zoidberg,

    Could you re-phrase your situation?
    It must be something simple.

    Maybe a block diagram?

    Apologies for such confusion.

    Here's the situation:

    1.) I have a breadboarded TDA7052 with own electrical supply.
    2.) A microcontroller (a PIC18F) training board with a wave-player program. +3.3V supply. 100kHz PWM rate.
    3.) Another microcontroller of the similar architecture (another PIC18F), with the same program (of course it's modified to suit the microcontroller), breadboarded. +3.3V supply. 100kHz PWM rate.

    So when (2) connected to (1), it's pretty loud and clear. It is what it should be.

    But when (3) connected to (1), it sounded very faint, and sounded like a water flowing in a constricted rubber tube.

    @Loopy Byteloose - I'll read the opamps again. And, pardon me for the very slow activity - need to have another refresher courses of these op-amps. :)
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2011-09-26 08:31
    What is the output of 2 or 3? It's audio (AF), right out of the PIC18F, either way?

    The only difference is one runs 39K and the other 100K - and the latter (100K) results bad audio?

    Can you re-program the 100K unit to run the 39K?

    Either way, I'd get it on the oscilloscope.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-09-26 09:14
    I suspect PJ is right and that it has to be something simple. At first reading, I thought you were using an op amp, but the IC you are using is power audio amp.

    So the idea of using an op amp could be rather distracting.

    I wonder if you have a capacitor network on the input and if the two are exactly the same. Alternatively, maybe you have one bad TDA7052.

    And it seems that you are driving the TDA7052 with 3.3volts - that is near the bottom line of voltage. It would be happier at 15 volts or near the 18 volt max - likely to have better response and obviously more audio power.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2011-10-09 05:25
    Apologies for the late reply. I could not enter the Parallax forums, it was slowing down and had a hard time replying it.

    By the way, I accidently placed a wrong value in the PWM registers in my microcontroller, hence the bad sound being output. Thanks for the opinions. :)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2011-10-09 07:51
    Thanks for mentioning what you discovered. We all have a certain amount of 'development problems' that tend to confound us. I just built a PockeTerm for bench work and had to spend about 3 days finding out that I forgot to solder the Rx and Tx pins.

    I guess Decapod 10 is far off the grid.

    There has been another audio thread here that came up with a great little op amp that will drive 32 ohm ear phones directly.

    http://forums.parallax.com/showthread.php?134833-Preferred-Audio-Amplifiers-for-Propeller&p=1042093#post1042093

    The above link might introduce you to some alternative chips.
  • John A. ZoidbergJohn A. Zoidberg Posts: 514
    edited 2011-10-09 23:26
    Thanks for mentioning what you discovered. We all have a certain amount of 'development problems' that tend to confound us. I just built a PockeTerm for bench work and had to spend about 3 days finding out that I forgot to solder the Rx and Tx pins.

    I guess Decapod 10 is far off the grid.

    There has been another audio thread here that came up with a great little op amp that will drive 32 ohm ear phones directly.

    http://forums.parallax.com/showthread.php?134833-Preferred-Audio-Amplifiers-for-Propeller&p=1042093#post1042093

    The above link might introduce you to some alternative chips.

    Thanks for the link. My adverse reaction to Caffeine, lack of sleep and a number of postgraduate work has my mind slipped out when I was fixing up the PWM registers in my microcontroller.

    Will take a look at that link provided. :D
Sign In or Register to comment.