Delta sigma modulator help

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
Hi all,

I was hoping someone on this forum could help me out with a circuit I'm working on, it's a delta sigma modulator for a class D guitar amp.

I've started by doing some rough spice simulations (my usual process) but i cant seem to get a decent square wave out of it, I'm thinking the issue is with the integrator, my only reason for that is because this is the first time I've used one :p.

heres the schematic I have so far:

deltasigma.png


and here is the plots i'm getting

deltasigmaplot.png


red: input signal
green: integrator output
Blue: Square wave output from that last comparator - looks identical to output from the flip flop just at 24vpp instead of 1vpp

Any chance someone with more experience then could jump in with a suggestion?

cheers,
Isaac
 
First of all remove C2. DS looops must be DC coupled !

Then what is the output swing of the second comparator ? You might need some offset correction if this is not symmetrical to ground.

If you get this running the real problems will start: You will need to use a higher loop order if you want some reasonable signal quality.

Regards

Charles
 
more changes...

previous poster had good advice...to this, I would add a few things:
You don't need the comparator before the flip flop. In the real world, it would probably just cause havoc, assuming the +/-12 volt outputs drove into a 5 volt supplied flip flop...please correct me if I'm assuming too much about the parts.
The integrator has enough gain that the slicing of the flop at the 2.4 volt logic level won't create significant offset. Just connect your integrator straight into your flop.

Next, your time constants are kind of long, and your clock freq kind of low for audio.

Last, you might want to append a filter on the output of the final comparator to look at you results with the high freq hash removed...it will give you an idea of the fidelity at a glance.

good luck.
 
Wow, didn't respect a reply so quickly, I can see why this forums so popular. I'll have to make sure to check back more regularly.

Oops your right about the cap, i put it there while testing that integrator and forgot to pull it out, funnily enough though removing it had little effect :S (clue maybe?)

The output from the second comparator swings from -12 to 12V unloaded following the square wave out of the latch, but when i close the loop it swings from -12 to 0.8V. Increasing R3 and R8 makes it swing closer to the rails but it takes quite large values (~1Meg) to make an appreciable difference, but then the output from the integrator becomes tiny (~100mv swing) any theories?

sorry probably sounding ignorant at this point, just trying to get my head around the 1st order loop first then i should be able to troubleshoot for myself - or at least that's how most of my projects seem to go :p

Thanks for you help this far,
Isaac
 
If that's a 74HC74 from 74HC.lib it doesn't act like it has input clamp diodes like a real part. Unless you arrange for a maximum of 6 volts drive and a 6 volt supply on the flip flop, a real part will either mess everything up or get messed up. For noise reasons I'd stay well below 5 volts at the logic part unless you must have the speed. 12 volt logic is usually slow anyway.
 
Last edited:
You don't need the comparator before the flip flop. In the real world, it would probably just cause havoc, assuming the +/-12 volt outputs drove into a 5 volt supplied flip flop...please correct me if I'm assuming too much about the parts.
good point I'll give that a go :)

Next, your time constants are kind of long, and your clock freq kind of low for audio.
yeah, that was an attempt to more accurately see what was going on, but i'll fiddle and see if it has an effect. (i'm thinking that as long as the clock rate and input frequency are the same order of magnitude apart it should work? I have been wrong before though :p)

Last, you might want to append a filter on the output of the final comparator to look at you results with the high freq hash removed...it will give you an idea of the fidelity at a glance.
yeah good idea, although at this point its just a reminder that the circuits not working :p should be a nice moment when it starts to resemble a sine wave though.

@Andrew, Adman and Phase accurate
I was using the generic 'behavioural flip flop provided by ltspice; maybe a bad idea by the sounds of it? in any case the sample and hold followed by a comparator swinging between 0 and 5v sounds like an easier fix than trying to figure out how to add a new part to ltspice (another project for another time i think)

thanks again everyone for your help, ill try all of the above and post how it goes.

cheers,
Isaac
 
Here's a snippet in LTSpice

I just threw something together that works, at least for simulation.
100uH and 1 uF is filter for 8 Ohm load. I grabbed some likely FETs to drive
the load. It's kind of unrealistic in that a real flop wouldn't drive the FETs
nicely without some buffering...the floating 5 volt supply as a level shifter
is also unrealistic, but the idea was to get you into the ballpark.

It has a gain of 5, and doesn't take too horribly long to simulate...the output looks a bit noisy, but about what you'd expect given the OSR and the low order (first) modulator.

Note...sigma_delta.txt is really an LT spice .asc file. Just rename it to be sigma_delta.asc, and you can simulate in LT Spice.
 

Attachments

  • sigma_delta.GIF
    sigma_delta.GIF
    30.4 KB · Views: 465
  • sigma_delta.txt
    3 KB · Views: 132
Thank you djoffe :) Just what I needed :)
turns out my original problem seemed to be the integrator clipping due to the signal from the first op amp - oh well at least its an easy fix, hopefully someone with the same issue as me will stumble across this and save themselves some frustration.
thanks for the help everyone, ill keep working away on a higher order loop and post here. If all goes well a prototype should be next... I have no idea how people just start building these things and have them work, oh well experience I guess, maybe one day I'll get there :p

Thanks again,
Isaac
 
ok, I think I'm starting to get the hang of this. I've managed to put together a second order loop which is slow and pretty temperamental with regards to changing components - especially the caps and resisters controlling the integrators, but its progress nevertheless :)
here's the schematic
deltasigmaso.png

and here's the output
deltasigmasoplot.png


The next step is to fiddle with component values and opamps/comparators to get a sense of which bits affect what, the goal being to make it a little more stable and of course faster, any suggestions as to where to start?

oh and one other thing, I've read that opamp integrators cant be used in loops above second order, so I suppose i really have two questions. First how would you implement an integrator without an opamp? (i'm guessing it'd be some kind of rc filter) and second is it worthwhile for a guitar amp that is likely to have distortion dialled in, one way or another regardless?

cheers,
Isaac
 
Sure, like this?
deltasigmasoschem2.png

actually looking at it now, i can see it why it should be there, so thankyou for preventing future headaches :) (or am i wrong - should it be in series with R6?)
noise transfer function sound interesting, I look forward to it. until then I'll keep fiddeling, still having trouble getting the speed up, but it seems like a much smaller problem problem compared to where I was two days ago :p

thanks again,
Isaac
 
oh and one other thing, I've read that opamp integrators cant be used in loops above second order,

Not at all. People have managed easily going upto 3rd and 4th order. Above that, compensating becomes a nightmare. If you refer the IEEE or elsevier journals you can very frequently see people using 3rd and 4th order loops.
As far as sigma delta modulation is concerned, it is better to go for higher order loops to increase the randomness of the quantizer. It is always easy and reliable (stability-wise) to extract the coefficients from the Richard-Shreier's toolbox(MATLAB).

so I suppose i really have two questions. First how would you implement an integrator without an opamp? (i'm guessing it'd be some kind of rc filter) and second is it worthwhile for a guitar amp that is likely to have distortion dialled in, one way or another regardless?
cheers,
Isaac

1) Impossible. Integrators can never be realized without an active element. (passive filters can never have a pole at the origin of the s-plane)
2) could you rephrase please.
 
Not at all. People have managed easily going upto 3rd and 4th order. Above that, compensating becomes a nightmare. If you refer the IEEE or elsevier journals you can very frequently see people using 3rd and 4th order loops.
As far as sigma delta modulation is concerned, it is better to go for higher order loops to increase the randomness of the quantizer. It is always easy and reliable (stability-wise) to extract the coefficients from the Richard-Shreier's toolbox(MATLAB).

unfortunately I don't have access to any of the above, i subscription to IEEE might be worthwhile though provided its not stupidly expensive...

1) Impossible. Integrators can never be realized without an active element. (passive filters can never have a pole at the origin of the s-plane)
sorry must have been late when I was replying I had this in mind:
RC circuit - Wikipedia, the free encyclopedia I realise now that would only work with a single time constant - not a varying signal - Fourier analysis never was my strong point :p.
2) could you rephrase please.
again I blame tiredness :p my question was, is it worth going to all this trouble to reduce distortion and noise for a guitar amp that is going to have at least a little distortion added intentionally? I haven't had an opportunity to listen to the kind of distortion produced by a low order delta sigma loop, so I don't really know how it sounds.

thank you everyone for your patience I'm trying to learn all this as I go.
Isaac
 
Just did another simulation, up to third order now, using opamp integrators so in conclusion Terminator12, your right and I'm wrong as to be expected :p
anyway here's the schematic:
schemsods.png

and the output:
outputsods.png

if your wondering about why its such a small voltage, its because its taken through a high impedance tap from the output of the flip-flop to avoid effecting the circuit. Looks nice and clean though :)
 
Just a general note: for orders greater than two, you really need to check what happens during recovery from excessive input signals. If integrator clipping effectively reduces the order to two or one while the sigma-delta is overdriven, it will usually recover just fine. If not, it may burst into huge oscillations as soon as you drive it into clipping without recovering when you remove the input signal.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.