• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

ADC Based Feedback

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
I was reading something @Curvature sent me yesterday (very good read thanks again) and came across something I don't quite get. In a presentation by Bruno Putzeys, it depicts what I was told was always a bad idea: using an ADC as feedback. Wouldn't there be a lot of group/phase delay on the line if you did that?


Screenshot (244).png
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,739
Likes
6,080
Location
US East
So then would it be a specific class of controller I'm looking for as opposed to a regular ADC?
When you use digital control (discrete time control), your feedback loop update/sampling frequency needs to be >~15x that of your required system bandwidth for it to behave like a continuous time control system. You'll need to figure out what your hardware/software is capable of doing.

discrete_control.png
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
When you use digital control (discrete time control), your feedback loop update/sampling frequency needs to be >~15x that of your required system bandwidth for it to behave like a continuous time control system. You'll need to figure out what your hardware/software is capable of doing.
Thank you very much this definitely clears up a lot. I was looking into using an ADAU1467 as my DSP for an active crossover, but from what I was always told, servo control for anything above low frequencies was not practical. Bringing it back to the context of the post; so then would the output of the ADC be going directly into the DSP, or would the digital output of the ADC be reapplied to the circuit via feedback (since it's already a pulse)?
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
Also, would the 15x bandwidth be relative to the audible band, the frequency of the class D modulation, or the sample rate at which the audio comes out at?
 

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,739
Likes
6,080
Location
US East
Thank you very much this definitely clears up a lot. I was looking into using an ADAU1467 as my DSP for an active crossover, but from what I was always told, servo control for anything above low frequencies was not practical. Bringing it back to the context of the post; so then would the output of the ADC be going directly into the DSP, or would the digital output of the ADC be reapplied to the circuit via feedback (since it's already a pulse)?
I'd think it is best to separate the DSP processing (e.g. EQ) from the feedback control processing as they do very different things. The feedback controller will take the output from the DSP for it error corrections anyway, i.e. the DSP output is the reference, and the errors that need to be corrected by the feedback controller is the difference between the reference and the ADC measured output.
Also, would the 15x bandwidth be relative to the audible band, the frequency of the class D modulation, or the sample rate at which the audio comes out at?
I don't know enough about how class-D amplifier feedback works to answer your question.
 

Zapper

Addicted to Fun and Learning
Joined
Mar 4, 2023
Messages
608
Likes
842
Thank you very much this definitely clears up a lot. I was looking into using an ADAU1467 as my DSP for an active crossover, but from what I was always told, servo control for anything above low frequencies was not practical.
The frequencies of digital control have increased proportional to digital processing speed. Decades ago, digital servo was suitable only for subwoofers. Now it can be used for the full audio band.
Bringing it back to the context of the post; so then would the output of the ADC be going directly into the DSP, or would the digital output of the ADC be reapplied to the circuit via feedback (since it's already a pulse)?
The ADC goes directly into a DSP, not necessarily the same one that is providing other filtering and EQ functions. All feedback signals need high frequency attenuation and phase control to maintain stability of the feedback loop. There are discrete time (i.e. digital) equivalents of the poles and zeros used in analog feedback loop analysis. These are implemented in the DSP, or some DSP-like hardware in the feedback controller.
 
Last edited:

Zapper

Addicted to Fun and Learning
Joined
Mar 4, 2023
Messages
608
Likes
842
Also, would the 15x bandwidth be relative to the audible band, the frequency of the class D modulation, or the sample rate at which the audio comes out at?
The switching frequency of the Class-D would generally be the same as the sampling and DSP frequency of the feedback, which would be 15 times the maximum audio frequency of the amplifier. E.g. if the amp goes to 20kHz, the sampling and switching freq is 300kHz.
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
The frequencies of digital control have increased proportional to digital processing speed. Decades ago, digital servo was suitable only for subwoofers. Now it can be used for the full audio band.
I guess my next question then would be then is if I can use servo feedback for the full audio spectrum, then does it really matter if I go class D or not?
The ADC goes directly into a DSP, not necessarily the same one that is providing other filtering and EQ functions. All feedback signals need high frequency attenuation and phase control to maintain stability of the feedback loop. There are discrete time (i.e. digital) equivalents of the poles and zeros used in analog feedback loop analysis. These are implemented in the DSP, or some DSP-like hardware in the feedback controller.
So something like a PWM controller? If so, what features then would I look for specifically for those controllers?
The switching frequency of the Class-D would generally be the same as the sampling and DSP frequency of the feedback, which would be 15 times the maximum audio frequency of the amplifier. E.g. if the amp goes to 20kHz, the sampling and switching freq is 300kHz.
From my understanding that can be up into the MHz range (if memory serves somewhere between 6 and 12MHz). That said, high switching speed, so something like a LMG1210?
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
I don't know enough about how class-D amplifier feedback works to answer your question.
You've helped out a lot so far so don't sell yourself short :)
 

Zapper

Addicted to Fun and Learning
Joined
Mar 4, 2023
Messages
608
Likes
842
I guess my next question then would be then is if I can use servo feedback for the full audio spectrum, then does it really matter if I go class D or not?
Normal Class-D amps are actually analog switching circuits. There is an analog error amp that controls an analog PWM, which then drives the analog power switches. The feedback circuit is also analog, consisting of a voltage divider with high freq roll-off and usually some additional phase manipulation.

It is also possible to make a primarily digital Class-D amplifier. The input to the control system is digital. The digital control system generates a digital PWM signal that drives the analog power switches. The output signal (before or after the output filter) is sampled by an ADC. This feedback signal needs further digital processing to roll-off high frequencies and manipulate phase, like the analog case, but this is done with a DSP or a hard-coded digital processor.

It is possible to use a digital servo with a linear amplifier, but I'm not sure what the benefit would be.
So something like a PWM controller? If so, what features then would I look for specifically for those controllers?
I have experience designing digital servo systems (similar to Class-D but not for audio) using TI C2000-series microcontrollers. These have a lot of built in circuitry specialized for PWM control. TI has other controllers more suited for Class-D audio, but I am not familiar with them.
From my understanding that can be up into the MHz range (if memory serves somewhere between 6 and 12MHz). That said, high switching speed, so something like a LMG1210?
Your design problem will get a lot more challenging if you push into the 6-12 MHz range. Device and PCB parasitics will become very important, PCB design becomes difficult, and EMI is a big problem.
 
Last edited:
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
It is possible to use a digital servo with a linear amplifier, but I'm not sure what the benefit would be.
https://www.diyclassd.com/media/fe/01/90/1682341944/A universal grammar of class D.pdf this is the document that was posted to me. Hopefully this should give a little more context than what I can provide.
I have experience designing digital servo systems (similar to Class-D but not for audio) using TI C2000-series microcontrollers. These have a lot of built in circuitry specialized for PWM control. TI has other controllers more suited for Class-D audio, but I am not familiar with them.
I've kind of been trying to avoid coding if I'm being completely honest. Not exactly my favorite thing, but I dabble when I need to. Why i gravitated toward the sigmadsp chips from analog is they can still use the sigmastudio visual programming language while still being simple enough that I don't need to fool around too much with the hard coding aspect like I would if I used something like a sharc processor or one of the microcontrollers you described.
Your design problem will get a lot more challenging if you push into the 6-12 MHz range. Device and PCB parasitics will become very important, PCB design becomes difficult, and EMI is a big problem.
That's some very good insight. I haven't even thought about that. The main thing I'm going for isn't so much class D as much as just a good sounding amp design with decent power efficiency. From what you're saying, in order to do that, a high performing class D wouldn't be practical for someone like me who's just a hobbyist who's trying to make a DIY amp. If that's the case I guess I'm back to the drawing board again.

I was working on a design involving the TPA3255. The problem I ran into there was that there isn't a spice model for it. In it's place I just tried to math out an ideal op amp in LTSpice. I put down the idea when I tried to implement post filter feedback and couldn't get stability. I assume it has something to do with the IC itself or maybe some idiosyncrasy with spice itself because I followed the app note to the letter, but couldn't get a stable waveform out of it. The only alternative I can think of in order to check off both high fidelity and power efficiency is to maybe take a crack at class G or H.
 

NTK

Major Contributor
Forum Donor
Joined
Aug 11, 2019
Messages
2,739
Likes
6,080
Location
US East
I was working on a design involving the TPA3255. The problem I ran into there was that there isn't a spice model for it. In it's place I just tried to math out an ideal op amp in LTSpice. I put down the idea when I tried to implement post filter feedback and couldn't get stability. I assume it has something to do with the IC itself or maybe some idiosyncrasy with spice itself because I followed the app note to the letter, but couldn't get a stable waveform out of it. The only alternative I can think of in order to check off both high fidelity and power efficiency is to maybe take a crack at class G or H.
This is from TI's App Notes regarding TPA3255 PFFB stability testing/analysis. TI recommends square wave testing for all possible loads.
TI PFFB.png



TI PFFB2.png
 

Zapper

Addicted to Fun and Learning
Joined
Mar 4, 2023
Messages
608
Likes
842
https://www.diyclassd.com/media/fe/01/90/1682341944/A universal grammar of class D.pdf this is the document that was posted to me. Hopefully this should give a little more context than what I can provide.

I've kind of been trying to avoid coding if I'm being completely honest. Not exactly my favorite thing, but I dabble when I need to. Why i gravitated toward the sigmadsp chips from analog is they can still use the sigmastudio visual programming language while still being simple enough that I don't need to fool around too much with the hard coding aspect like I would if I used something like a sharc processor or one of the microcontrollers you described.

That's some very good insight. I haven't even thought about that. The main thing I'm going for isn't so much class D as much as just a good sounding amp design with decent power efficiency. From what you're saying, in order to do that, a high performing class D wouldn't be practical for someone like me who's just a hobbyist who's trying to make a DIY amp. If that's the case I guess I'm back to the drawing board again.

I was working on a design involving the TPA3255. The problem I ran into there was that there isn't a spice model for it. In it's place I just tried to math out an ideal op amp in LTSpice. I put down the idea when I tried to implement post filter feedback and couldn't get stability. I assume it has something to do with the IC itself or maybe some idiosyncrasy with spice itself because I followed the app note to the letter, but couldn't get a stable waveform out of it. The only alternative I can think of in order to check off both high fidelity and power efficiency is to maybe take a crack at class G or H.
Regarding the simulation, the TPA3255 seems to have a fixed internal gain of 21.5. So if your ideal model of it has more gain you will get stability problems. Modeling it as a voltage controlled voltage source with that gain might help. The open loop freq response of the TPA3255 also has to be modeled, but I don't see any info on that.

The PFFB wraps a feedback loop around a LC resonator, which is hard to do, especially with no load. That is similar to a buck regulator in the voltage feedback mode. Generally only weak feedback and/or limited bandwidth can be used. For the TPA3255, the internal gain of 21.5 means only a weak PFFB can be implemented.

I see that TI has a version of Pspice you can download. Maybe that has a model for the TPA3255.
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
This is from TI's App Notes regarding TPA3255 PFFB stability testing/analysis. TI recommends square wave testing for all possible loads.
View attachment 337306


View attachment 337308
Good catch! I completely missed that. Although such stringent testing requirements is kind of concerning. I would like to think a good performing circuit would be able to at the very least handle any wave form just as well as any other so long as the gain and frequency are the same.

Regarding the simulation, the TPA3255 seems to have a fixed internal gain of 21.5. So if your ideal model of it has more gain you will get stability problems. Modeling it as a voltage controlled voltage source with that gain might help. The open loop freq response of the TPA3255 also has to be modeled, but I don't see any info on that.
I had it set for 21.5 dB of gain at 7Vp-p (max input voltage) to be able to terminate a maximum of 600 watts at 2 ohms (its max power at 2 ohms).

The PFFB wraps a feedback loop around a LC resonator, which is hard to do, especially with no load. That is similar to a buck regulator in the voltage feedback mode. Generally only weak feedback and/or limited bandwidth can be used. For the TPA3255, the internal gain of 21.5 means only a weak PFFB can be implemented.
Yes so it seems. I tried for a while to get global feedback but to no avail. Guess that explains why.

I see that TI has a version of Pspice you can download. Maybe that has a model for the TPA3255.
I actually took the time to sign up with TI and request a copy of their version of PSpice thinking the exact same thing lol. Unfortunately it does not have the model. From what I've experienced so far TI doesn't have too many encrypted spice models so what you see on their website is what you get (at least from what I have seen).

I guess with all of that said, in your guy's opinion, what would then be the better avenue to pursue: class D or class G/H?
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
Also I guess since we're on the topic: do I have to be worried about parasitics when dealing with DSP circuits in general (like the processing clocks for dacs etc)?
 

Zapper

Addicted to Fun and Learning
Joined
Mar 4, 2023
Messages
608
Likes
842
Good catch! I completely missed that. Although such stringent testing requirements is kind of concerning. I would like to think a good performing circuit would be able to at the very least handle any wave form just as well as any other so long as the gain and frequency are the same.
The square wave is used because you can derive damping and stability from the response. TI does not appear to provide a direct method for evaluating loop stability, nor does it specify it.
I had it set for 21.5 dB of gain at 7Vp-p (max input voltage) to be able to terminate a maximum of 600 watts at 2 ohms (its max power at 2 ohms).
You would need to provide a dominant pole to that 21.5dB gain to get high freq stability.
Yes so it seems. I tried for a while to get global feedback but to no avail. Guess that explains why.


I actually took the time to sign up with TI and request a copy of their version of PSpice thinking the exact same thing lol. Unfortunately it does not have the model. From what I've experienced so far TI doesn't have too many encrypted spice models so what you see on their website is what you get (at least from what I have seen).

I guess with all of that said, in your guy's opinion, what would then be the better avenue to pursue: class D or class G/H?
I suggest you spend some time experimenting with the TPA3255 (analog Class-D) and the AX5689 (digital Class-D) that NTK linked to. Do you have the equipment (signal generators, scopes, PCB design and assembly, etc) necessary for that type of work?
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
The square wave is used because you can derive damping and stability from the response. TI does not appear to provide a direct method for evaluating loop stability, nor does it specify it.
So would that mean in a test scenario it would be better than just using a plain 1khz sine wave?
You would need to provide a dominant pole to that 21.5dB gain to get high freq stability.
I'm very lucky this is a newby section... I'm a little ashamed to ask, but what exactly IS a pole? I'm fairly good with electrical and electronics theory, but I admit my math foundation is a little lacking :facepalm:
I suggest you spend some time experimenting with the TPA3255 (analog Class-D) and the AX5689 (digital Class-D) that NTK linked to. Do you have the equipment (signal generators, scopes, PCB design and assembly, etc) necessary for that type of work?
Unfortunately no :( other than financial of course, it has been my biggest hurdle in all of this. I've mostly been depending on software for testing and simulation. I figure programs like LTSpice are mature enough that they take real world factors into consideration when running simulations so that's what I've been using. I've also got things like sigmastudio, VituixCAD, pspice, fusion360, and kicad among others, but I do not have room for a home lab at the moment. For all intents and purposes, for reasons I would rather not get into on a public forum, I'm kind of in a shoebox lol
 
OP
B

BKr0n

Active Member
Joined
Sep 6, 2023
Messages
206
Likes
64
BTW @NTK I really like this chip you sent. It's interesting that I've never come across something like that before on any parts websites.
 
Top Bottom