UCD400 or ZAPPulse?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
One thing more about group delay vs delay, especially for you Bruno (I don't think Lars has to go back to school on this one): the term 'group' is only to point out that the delay is about the same for a group of frequencies. Especially Bessel low pass filters with their maximally flat group delay across the passband are used in HF circuitry to act as an analog delay line with constant delay across the passband.

You could easily check with your scope: send 100 Hz through your 2nd order low pass filter and compare the zero crossings of the sine wave. Do the same at 1000 Hz. You will see that in both cases the zero crossings are 3.75 μsec apart (before and after filtering) when loading the 30μH/680nF circuit with 8 ohms.
 
Hallo Jeroen,

jeroen_d said:
Ok, he made a mistake with the phase plot, of course the 30¼H/680nF lowpass network has 90 degrees phase shift at 35000 Hz and only approaches 180 degrees at the highest frequencies, like Bruno said.

BUT, when you have a load varying between 16 and 4 ohms on this network, group delay is between 1.9 and 7.5 ¼sec across the entire audio band.

I suspect that is exactly the delay that lars clausen mentions. NOT the delay at much higher frequencies where the group delay is much lower.

Oh yes, in fact I'm absolutely sure that the delay which LC mentions is group delay at passband frequencies. Point is, the group delay of a system (here the output filter) at frequencies well inside the loop bandwidth is a complete nonissue in control theory. It's phase shift at the unity gain point of the loop that determines whether you can successfully close a loop around a system. Once you get that done, loop gain at lower frequencies will be sufficient to control the system. The end result is that the closed loop can have a much shorter group delay than the open loop system!

The output filter has actually been a red herring in the discussions. A point that has not been highlighted is that any control loop has at least one integrator in it. Typically this will be one with infinite DC gain, also referred to as one pole at DC. The most common example in audio is the op amp. The integrator is formed by the miller capacitance. This means that the loop will have an internal loop phase of 90 degrees. So, any op amp, regardless of how "fast" it is, has a 90º phase shift, open loop, at all frequencies below unity gain, then "group delay" at 20kHz would be 12.5us. I hope you see the absurdity of taking this phase shift for "delay". To speak of "delay" or "group delay" outside the flat portion of a filter response is a good way of becoming very, very confused (see digression at the end). When something happens, the output of the integrator responds immediately. When we close the loop, we find that at frequencies where loop gain is high, closed-loop phase shift is now very small, and so is closed-loop group delay (which is now again a sensible notion because the amplitude response is flat).

What makes an op amp "fast" is how much the gain is at these frequencies, and whether at the same time it can still guarantee a phase shift<<360º (=180 for negative feedback + 180 loop phase) at the unity gain frequency.

How "fast" you can make a class D amplifier? The crucial realisation to make is that it is a sampled system.

And here it is where real delay comes in. When the power stage switches, it makes an error. You can only respond to this error by controlling the next time when it switches again. Therefore, the reaction time is limited to the time between two transitions. Now that IS a delay in the true sense of linear phase shift, and it requires the designer to place the unity gain frequency well below the switching frequency.

(note that the effective delay is further dependent on the modulation. With no modulation, you can effectively respond within a half-cycle, but at maximum modulation it's the longest half cycle that counts).

So now we can understand better what a real delay is. A real delay occurs when a system absolutely does not respond at all to a stimulus until some time later. The time between two switching transitions in a switching power stage is such a thing.

This time span, along with propagation delay between the comparator and the power stage, constitutes the true bandwidth limitation of class D control loops. It shows that all class D amplifiers have this same, basic limitation. Suggesting that some feedback methods are “instantaneous” is mathematically incorrect. You can only correct the error after it is committed, and in a class D amplifier, the switching frequency tells you how long after.

On the other hand, a lowpass filter’s output voltage starts to change immediately after the input voltage changes. This is what is meant by group delay tending to zero at high frequencies. This also means that a differentiator can be used to “magnify” the change in the filter output voltage, so we can see it better. Such a differentiator is often referred to as a zero. A differentiator has a negative phase shift (phase lead) and hence a negative group delay. That simple fact alone should tell you that group delay has nothing to do with actual delay, because you can’t have negative delay. You can have negative group delay though!

It’s only the initial change that we need to “magnify” because a control loop lives from instant to instant, responding to changes as soon as they arrive. If later on the system has some sort of additional delayed response, no problem, you’ll deal with it when it arrives and treat it like just any other error that you correct. It’s only the “here and now” that counts, which is expressed as “loop phase at unity gain shall be <360 degrees”, and this is why group delay at lower frequencies is not an issue.

So, if your system has a total of 2 poles, apply a 1st order differentiator to reduce the total loop order to 1 at the unity point. If the phase shift exceeds 360º at higher frequencies, no prob because the loop gain is below unity. Because of that, a simple RC “lead compensation” network often does a very nice job to improve the loop gain already.

So, you can get rid of the group delay of a lowpass filter for the purpose of closing a loop. If you do it correctly, the output filter does not add to the delay already created by the sampling process. Amplifiers with feedback taken from the power stage are not one picosecond “faster” than those that use the output filter signal for control. They are precisely equally slow :D

What does that look like in real practice? Well, suppose you have a loop containing a 2nd order lowpass filter, add a differentiator (real zero) around the intended unity gain point to get loop phase below 180º. If you run through the maths and look at the control signal arriving before the lowpass filter at low frequencies, it will have a negative group delay compared to the input. Neatly compensating for the group delay of the filter itself. Control theory wins again :)

I'd like to pull out another example, delta-sigma coders. Take a 6th order deltasigma modulator for 1-bit audio conversion. In its entire operating range, phase shift is a constant 6*90º=540 degrees. Only around the unity gain crossover frequency, the 5 zeros in the loop take back the loop order to 1 (=6-5) in order to arrive at around 90º phase shift. Again, let's look at the absurdity of calling this phase shift a delay. 540 degrees at 1kHz corresponds to a "group delay" of 1.5 milliseconds. At 100Hz it's 15 milliseconds. At 10kHz it's 150us. By now you are, hopefully, undaunted, because you know that the system’s ability to respond is only determined by the phase shift at unity gain, well outside the usable bandwidth.

I was wondering what makes the problem of controlling lowpass filters so difficult to understand for many. A digression into psychology:

I believe that what complicates the understanding of this is the fact that lowpass filters have complex poles (no surprise for passive filters), thus making for a phase shift that is not a constant 90º per order. Suppose I gave you a “system” consisting of two full integrators (1/s^2), and asked you to build a control system to stabilise the output. You’d probably quickly realise that the system had a constant 180 degree phase shift, and that all it takes to control it is one differentiator to knock phase shift down to 90º and you’d be set. You’d never even think of translating phase shift into group delay, because that’s not how you analyse such a control problem. Group delay is something one only thinks about if at least the amplitude response is flat, not quite the case with 1/s^2…
Lowpass filters make matters look confusing precisely because gain is constant and phase response is up, to some point below the corner frequency, proportional to frequency. This invites translation to “group delay”. Wrong move of course. Apart from the fact that the poles are not at DC, a 2nd order lowpass filter is hardly different, from a control perspective, from a full double integrator.

Second digression: How to design a class D amplifier without knowledge of control theory.
A class D amplifier can be constructed using a comparator, a power stage and an integrator (e.g. an op amp with grounded + input and a cap between output and - input). Positive feedback is taken from the power stage to produce hysteresis. Negative feedback is also taken from the power stage and applied to the integrator input. When the output stage is “high”, the hysteresis will be “high” as well. The output remains high until the integrated feedback signal catches up with the hysteresis. At that point, the power stage switches to “low” and stay there until the output from the integrator has come all the way down again.
If you inject add to the integrator input a current, the integrator will be “helped” in one direction, but “slowed down” in the other. Thus, the duty cycle of the switching cycle is automatically changed to insure that on average, as much charge leaves the comparator input through the feedback resistor as enters there through the input resistor. Very simple to “understand”, without a Laplace transform in sight. Less obvious is that this is a 1st order integrating loop, with a clearly defined loop gain evolving as -20dB/dec. Determination of the integration constant in function of the switching frequency is left as an exercise to the reader.
 
jeroen_d said:
the term 'group' is only to point out that the delay is about the same for a group of frequencies. Especially Bessel low pass filters with their maximally flat group delay across the passband are used in HF circuitry to act as an analog delay line with constant delay across the passband.

Thus, group delay equals phase shift in radians divided by frequency in radians. You are correct about the term's origin. As in my previous answer, it becomes clear that it is folly to use the notion of "delay" to describe phase shifts outside the flat portion of a system's pass band.

Nevertheless, since "phase shift divided by frequency" is still a defined quantity outside the pass band of the filter, it makes sense to talk about it, especially because Lars is confusing it with actual delay. This is what I'm sending him back to school for.

jeroen_d said:
You could easily check with your scope: send 100 Hz through your 2nd order low pass filter and compare the zero crossings of the sine wave. Do the same at 1000 Hz. You will see that in both cases the zero crossings are 3.75 ¼sec apart (before and after filtering) when loading the 30¼H/680nF circuit with 8 ohms.

You are repeatedly making the same point, namely that group delay is not actual delay, but can be used as an approximation of the phase response of a lowpass filter INSIDE THE PASSBAND.

In other words, we are both making the same point, and a crucial one.
 
Inside the passband, all frequencies are delayed by the same amount. Outside the passband, the delay gets smaller and smaller with rising frequency. But at the same time the amplitude decreases. Ofcourse a step response starts immediately, but has a very small amplitude at the high frequency components that make up the edge. They are fast, have no delay, but no meaning. The lower frequencies do have meaning, have amplitude, but are delayed. Hence you see the edge which is not infinitely steep anymore and the centre of the edge is delayed. You can call it no delay, I still like to call that delay for example in a system where you would want delay in the passband. As in earlier days where analog delay lines were used especially in HF applications, to repeat myself once again:D .

When you talk about the complete system I'm completely with you. Whether the low pass filter is in or out the loop, one way or another you have to achieve 180 degrees phase shift and corresponding group delay at the oscillating frequency to get the oscillator running. And both systems, UcD or ZAP, will have some microseconds delay in the pass band on the feedback loop. When you take the whole system into consideration, there will probably no meaningfull delay difference in the control loop between the two approaches (apart from the difference caused by choosing different oscillating frequencies and filter slopes). In the end, both systems have a clean and fast signal directly at the output of the Mosfet stage. And both systems have a low pass filter between that output and the speaker. And of course ZAP has more carrier residu because the corner frequency of its low pass is set much higher.

I guess you are right, we basically agree:).
 
jeroen_d said:
Inside the passband, all frequencies are delayed by the same amount. Outside the passband, the delay gets smaller and smaller with rising frequency. But at the same time the amplitude decreases. Ofcourse a step response starts immediately, but has a very small amplitude at the high frequency components that make up the edge. They are fast, have no delay, but no meaning.

You could say that the fast-arriving but greatly attenuated HF has little meaning when the filter is used as such. For a control system it's the bit that arrives fast, albeit small, that matters. Because of the high loop gain at frequencies inside the passband, phase shift there is of no meaning. What's meaningful for a control loop and for a filter is precisely the opposite, in other words.

You can see it illustrated thus: depending on load resistance, the filter can take on any shape like bessel (thomson) or butterworth etc, so group delay of the physical output filter as measured inside its passband can vary substantially. Yet, with the loop closed, we see none of this. Instead, it's the loop that sets the final frequency/phase response, and it's fully independent of the load. To do this, I'm relying on the fact that the phase/attenuation of the output filter is nearly independent of load at frequencies well above cut-off. This neatly illustrates the point: the loop cares not a yip about what the filter does at LF, as long as its HF behaviour is predictable, which it is. The small variation for different loads is reflected in slight changes in DC loop gain and switching frequencies when load impedance is changed.

Well, to say the loop doesn't care is a bit simple. Let's put it this way: the filter's cutoff frequency is well inside the loop bandwidth, so suppose you remove the load and it makes a huge resonant peak. This peak adds to loop gain, but disappears from the closed-loop response because it compensates itself.

jeroen_d said:
In the end, both systems have a clean and fast signal directly at the output of the Mosfet stage. And both systems have a low pass filter between that output and the speaker.

Yes. The main difference is that since the loop takeoff point in UcD is the speaker output, the response at the switching power stage is the mirror image of the output filter's response (well actually it's the difference between the closed-loop response and the output filter's response).

Suppose you have a 4 ohm load. With such a load, the UcD output filter has a group delay of 8kHz at audio frequencies. The closed loop response has If, for example, at 1kHz the output filter has a group delay of 8.2us, whereas the closed loop response has only 4.8us. Well... the response found before the output filter has a group delay of -3.4us (yes, MINUS, therefore it has phase lead).

Now, clearly the view of the output filter as a simple delay is insufficient to understand what's happening here, because as seen within the audio bandwidth the audio signal seems to arrive at the filter even "before" it's arrived at the amplifier input and just in time to make up for the "delay" of the output filter. :eek:
This is clearly an absurdity. Good news: the absurdity goes away once it is realised this effect only happens inside a limited bandwidth. The "negative group delay" tapers to zero as the system response drops. No mystery there. We're not dealing with prediction, but with extrapolation. Extrapolation works perfectly with band-limited signals, and is, for instance, the basis of loss-less digital audio data compression.

This clearly shows that the "analysis" offered by a contributor to the thread saying that the error can't be corrected "before it's made its way through the output filter" is flawed, precisely because of the confusion between a straight delay (wideband) and group delay (passband only).

I've added a plot showing the amplitude response ,top, and the phase response (shown as phase, centre and scaled to group delay, bottom) of the output filter only (green curve), the response before the output filter (red curve) and the closed loop response (blue curve). The load impedance is 4 ohms.
 

Attachments

  • ucd loop variables 4ohms.gif
    ucd loop variables 4ohms.gif
    28.3 KB · Views: 531
The next plot is what you get with a 16 ohms load. The filter is now seriously underdamped, and resonates clearly. But, hurrah, the response before the filter now has a dip neatly cancelling the hump. Nothing shocking there, just control theory doing its work.

(I hope this also makes clear the difference in scientific usage of the word "theory" and common usage. The latter meaning "a conjecture", the former "a logical framework proven to model and explain reality reliably").

Interesting is that the group delay of the output filter has now become considerably shorter. As a result, the pre-filter response now has a positive group delay. The sum (=closed loop group delay) has remained virtually unchanged compared to what we had at 4 ohms.

I can already hear some contributors jump in saying "look but at 16 ohms you're actually making "delay" longer than without feedback.

Hmm. Possibly. However, absolute delay in audio is undeterminate. When I play some of my favourite CD's, the absolute delay of the whole chain is on the order of 25 years. Those 3us are not going to make much difference. What matters (and here is where the proper historic usage of the notion "group delay" comes into its right) is that you want all frequencies to arrive at the same time. In other words, you want the difference between longest and shortest group delay across the passband to be minimal.

At 4 ohms, and inside the 20kHz band, the output filter has a maximum deviation from linear phase of 0.18us, the closed loop response 0.17us.

At 16 ohms, the filter deviates 0.96us from linear, while the deviation from linear phase of the closed loop response has hardly shifted, standing at 0.13us (that it does shift is unavoidable, since I haven't got infinite loop gain)

Well you'll understand I could even make the deviation from linear phase zero if I wanted. All it would take is a single component change to set the closed loop response to a full Bessel response. This is the everlasting dilemma, also found in analogue post-filters for audio converters. Do we go for absolute linear phase, but allow in-band droop, or do we prefer a flat passband, and accept some deviation from linear phase? Both are audible (on electrostatics at least). I decided to cut it somewhere down the middle.
 

Attachments

  • ucd loop variables 16ohm.gif
    ucd loop variables 16ohm.gif
    29.4 KB · Views: 512
jeroen_d said:
Really nice explanation Bruno! It shows that you know exactly what you're doing! Hope that it is not too technical for most readers.

Best Regards, Jeroen


Yes, very nice that Bruno takes his time to explain all this. I fear however that some students just don't want to learn it.

Bruno, after all these explanations, I think you better spend your time on other great sounding and good engineered products.

Best regards

Gertjan
 
Bruno Putzeys said:
And on a FAQ! :D Should save lots of time otherwise spent answering how to wire a differential input, what transformer to choose etc :xeye:
[/B]

Can I recommend something based on a wiki? The software used for http://www.wikipedia.com is quite popular and for example I use it on my DSP site here:

http://www.duffroomcorrection.com

It should mean that the FAQ becomes a little more "self" updating and even that people can post interesting pictures of their creation. I'm sure if you stuck a site up tomorrow it would have the FAQ entered for you by the afternoon...

Good luck
 
ewildgoose said:
Can I recommend something based on a wiki? The software used for http://www.wikipedia.com is quite popular and for example I use it on my DSP site here:

http://www.duffroomcorrection.com

It should mean that the FAQ becomes a little more "self" updating and even that people can post interesting pictures of their creation. I'm sure if you stuck a site up tomorrow it would have the FAQ entered for you by the afternoon...

Good idea! Will consider very seriously.
 
Bruno Putzeys said:

If you tell me what to measure I can do so and post the results.

If you would be so kind :cool:

Inputsignal 9kHz and 10kHz ( sinus, low THD ), total outputvoltage ~50Vp-p would be more then plenty. Feel free to take a 4ohm or 8ohm load. What i am interested in is the spectral content between 20Hz and 20kHz.

If for any reason the source already creates any form off distortion, please post a picture of that contents to, so we can compare the input vs output.

Thx in advance

Rudy
 
Rudy said:
Inputsignal 9kHz and 10kHz ( sinus, low THD ), total outputvoltage ~50Vp-p would be more then plenty. Feel free to take a 4ohm or 8ohm load. What i am interested in is the spectral content between 20Hz and 20kHz.

If for any reason the source already creates any form off distortion, please post a picture of that contents to, so we can compare the input vs output.


OK, will do in the coming days. The source is an AP2.
 
Jan-Peter: I have been working on replicating these measurements, that you posted here

Using the factory setting of your module, i can never get so low THD reading on the UCD's. It's from 0.01 to 0.03% from 20 - 7.500 Hz - where the AES17 filter sets in. (at 4 Ohms 10 Wrms). Ca. 0.02% is still very nice compared to what you have measured on my product. :xeye:

However if i 'tune' your module, for lowest dead-time distortion, i can replicate your measurement, with the same low THD. But the problem is, the module gets incredibly hot. (The same thing happens with both modules).

So my question to you is: Is there any chance you 'tuned' your own modules for this particular match? ;) Or is there something wrong with my UCD's?
 
Differential tone Distortion.

Here are the results with 9 + 10 kHz, 4 Ohms load, and 10W power.

UCD400AD:
An externally hosted image should be here but it was not working when we last tested it.


ZAPpulse 2.3SE:
An externally hosted image should be here but it was not working when we last tested it.


ZAPpulse 2.3SE with simple THD optimization:
An externally hosted image should be here but it was not working when we last tested it.


As you can see the standard ZAPpulse 2.3SE has very high differential tone distortion compared to the neat results from UCD. However a small and simple modification will tune the amplifier towards lower distortion, and the result is a very low differential tone distortion. This optimizing is not the one proposed by Phase Accurate, it is a small change in the existing circuit.

We will test the mod for sound quality, and let you know if it also makes for a better sound. (never know ... ?) :)
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.