Math problem for the math junkies

Started by Transmogrifox, December 08, 2004, 11:06:42 PM

Previous topic - Next topic

Transmogrifox

In relation to determining how to modulate a filter with a pulse-width modulation scheme,
here's a potential calculus requiring excercise:

derive an expression for the average impedance of a pulse-width modulated switch that includes the nonlinear effects of propagation delay, rise time and fall time.

This is an easy problem if attempted for the ideal case (in fact, no calculus necessary since you're integrating a square pulse), but it's hairy when you get to the narrow pulse case with a finite rise time and fall time that over lap at the beginning and end of each period, or are interrupted at the center of the pulse.

I spent 3 hours on this problem one evening and determined that the response is just as linear as the ideal case up to the point where the pulse-width becomes as narrow as the rise and fall times.  At this point, there is a discontinuous break, and I didn't get as far as setting the problem up correctly to deal with this.  On the practical aspect, I did discover why filters modulated this way have a limited "linear" sweep range, and how to determine what resistance change ratio is available from a given IC switch from the rise and fall time data.  I determined this is an excellent way to modulate a filter if one uses very high-speed comparators and JFET choppers.  I am determined to make this work, as it would greatly simplify the world of modulating multiple-order filters with precise desired responses.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

puretube

Paul Frostwave will be very interested in your results! (IIRC).

Paul Perry (Frostwave)

If I try PWM again, I'm going to have a PIC micro doing the work. Because, to get a useful range, the pulse has to be very narrow, and I find when the pulse is very narrow, that any noise in the circuit is catastrophic.
The reason I am interested in PWM, is that it makes it easy to have as many 'matched' variable resistors as you want. And when you are building a batch of something, the last thing you need is hand selecting stuff. So far, the only thing I see PWM working for, is phasers.

Transmogrifox

I'm sure you're aware of this, Paul--but for the other's sakes:

The reason I have started to develop a particular interest in PWM filter control, and I will credit Paul probably has observed the same, is the transfer characteristic from the control voltage to the filter frequency change.

Within the operating range (before noise and finite rise times become an issue), the transfer characteristic of Req/PW can be classified by this expression:

Req = T* (Rseries)/PW
for PW<=T  (ideal)
for PW<=(T- trise - tfall)   (non-ideal)

where T is the period, Rseries is self explanatory, and PW is pulse-width, trise and tfall are the pulse rise time and fall time respectively.

Almost all common biquadratic active filters have a resonant frequency defined by

fo = 1/(2*pi*R*C)

So fo(PW) = 1/(2*pi*Req*C)

= 1/(2*pi*C*T*Rseries/PW)

= (PW/T) * 1/(2*pi*Rseries*C)

= (%DutyCycle)/(2*pi*Rseries*C)

Rseries and C are constants defined by the filter designer. If a control voltage that linearly changes the pulse width is generated, then the filter resonant frequency is a linearly scaled unit of the control voltage.

The downfall, as both Paul and I have fought with, is that physical properties of devices used to generate this average variable resistance limit the bounds for which the above expression is true.

One topic where I would like to add detail, Paul, is on the topic that noise becomes more of an issue at narrow pulse widths:

From the ideal case, you can see that dfo/dPW, or dfo/dVcontrol, is uniform (a constant) for all PW, since it is a linear function, so any noise has an equally catastrophic effect at any pulse width.

The reason you would observe noise being particularly catastrophic at narrow pulse-widths is that the "gain" on fo from the control voltage increases as you exceed the pulse-width, PW = trise + tfall, or mathematically stated, dfo/dVcontrol is not uniform for all Vcontrol.  My math did reveal that the gain increases exponentially, however I have not yet been able to determine that particular function for that condition.  This is why this method has both limited useable range, and high noise sensitivity at narrow pulses.

Therefore, a higher speed switch and a higher speed modulator would "cure" the problem, and a microcontroller without a high speed switch would not be much better than the all analog version.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

idlefaction

would you be able to negate the effects of the finite slew rates by using a lower amplitude signal?  that way for a given slew rate your 'window' would be larger.  if you were only using a 1.2V signal instead of 5V or 9V...

i've been interested in PWM lately too - as a way of implementing a voltage controlled pot.  my idea was to replace all the controls in my pedals with a voltage controlled pot and convert the panel controls to control voltages.  throw a virtual ground mixer in front of the CV input and that should allow external CV control of anything.

the extra cool bit was to get Atmel's ZigBee/uP chip (when they release it) and use ZigBee low-power wireless networking to swap control voltages between gadgets.  Paul, you'd prolly be perking your ears up at that  :P

if anyone has already done some work with PWM-driven pots, or had a better idea, i'm all ears too.  I've just shifted house and my workshop is in storage, so all my ideas are staying theoretical atm  :(  *frustrating!*
Darren
NZ

Transmogrifox

You really coulnd't make much improvement that way.  Usually an analog chopper switch is triggered at the same level, so you need at least that voltage to trigger it.  The rise rate is constant regardless of the voltage, so lowering the voltage somewhat would only improve the amount of delay from on/off, off/on, which is not an issue in this case.

It's the switch's rise to fully "on" and fully "off".  If you lower the voltage on your switches to help reduce total rise and fall times, you begin to have distortion problems.

I think we just need to spend the extra bucks and get high-speed choppers.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

runmikeyrun

Quote from: TransmogrifoxI'm sure you're aware of this, Paul--but for the other's sakes:

The reason I have started to develop a particular interest in PWM filter control, and I will credit Paul probably has observed the same, is the transfer characteristic from the control voltage to the filter frequency change.

Within the operating range (before noise and finite rise times become an issue), the transfer characteristic of Req/PW can be classified by this expression:

Req = T* (Rseries)/PW
for PW<=T  (ideal)
for PW<=(T- trise - tfall)   (non-ideal)

where T is the period, Rseries is self explanatory, and PW is pulse-width, trise and tfall are the pulse rise time and fall time respectively.

Almost all common biquadratic active filters have a resonant frequency defined by

fo = 1/(2*pi*R*C)

So fo(PW) = 1/(2*pi*Req*C)

= 1/(2*pi*C*T*Rseries/PW)

= (PW/T) * 1/(2*pi*Rseries*C)

= (%DutyCycle)/(2*pi*Rseries*C)

Rseries and C are constants defined by the filter designer. If a control voltage that linearly changes the pulse width is generated, then the filter resonant frequency is a linearly scaled unit of the control voltage.

The downfall, as both Paul and I have fought with, is that physical properties of devices used to generate this average variable resistance limit the bounds for which the above expression is true.

One topic where I would like to add detail, Paul, is on the topic that noise becomes more of an issue at narrow pulse widths:

From the ideal case, you can see that dfo/dPW, or dfo/dVcontrol, is uniform (a constant) for all PW, since it is a linear function, so any noise has an equally catastrophic effect at any pulse width.

The reason you would observe noise being particularly catastrophic at narrow pulse-widths is that the "gain" on fo from the control voltage increases as you exceed the pulse-width, PW = trise + tfall, or mathematically stated, dfo/dVcontrol is not uniform for all Vcontrol.  My math did reveal that the gain increases exponentially, however I have not yet been able to determine that particular function for that condition.  This is why this method has both limited useable range, and high noise sensitivity at narrow pulses.

Therefore, a higher speed switch and a higher speed modulator would "cure" the problem, and a microcontroller without a high speed switch would not be much better than the all analog version.

That's what I was thinking!!   :lol:
Bassist for Foul Spirits
Head tinkerer at Torch Effects
Instagram: @torcheffects

Likes: old motorcycles, old music
Dislikes: old women

Johnny G

mkay sry to be the real noob here but can someone just explain to me how a pulse width modulated filter works? im right in thinking that the basis is a voltage controlled switch thats being turned on and off by an oscillator that has a a variable duty cycle. so can someone explain how that can be used

cheers

edit. hang about, rereading the first sentence of the first post i think i have it.

by sending a signal of varying duty cycle to said electronic switch you would get an average resistance impedance dependant on the dutycycle. this average impedance being worked out via the calculas that transmografix was talking about.

so once you have a variable resistor like this you use it in exactlly the same way as any other variable resistor ye?

edit again (wow this is useful)

im understanding alot more however im unsure as to the actual structure of these filters.

the fo = (%DutyCycle)/(2*pi*Rseries*C)  equation makes sense to me but i dont get where in the filter the switch would be. i origionally assumed that it would be in place of the resistor however it now seems there is Rseries, the capacitor AND the switch. if one of you guys could just explain how a simple lowpass filter for example would look with this then id be most apreciative
LET US INSTIGATE THE REVOLT,DOWN WITH THE SYSTEM!

Transmogrifox

http://www.geocities.com/transmogrifox/RFPWM.JPG

Here's a practical circuit for how to do this.

If you're familiar with the "Neutron" filter, you would know it is modulated by LDRs.  Just take each LDR out and replace it with a CMOS switch (like the one in the schematic above).  Modulate it accordingly, in the Neutron case, you would be connecting the comparator output to 2 switch control terminals.

As far as the "Rseries" and "C" go:

Rseries you would add in series with the switch to set a minimum resistance.  You could add no external resistor, and rely on the switch internal resistance, but this is not a good idea since it varies so much from switch to switch.

The "C" is just the time-constant setting C in the particular filter.

Basically, all you have to do in any filter, say a morley filter that has an LDR, or the DR. Q that has a BJT, simply replace the LDR or BJT with this CMOS switch in series with some small resistor (say 1k or so) and you have implemented as much change as you need to modulate the filter this way.

Does that help bring things together more?
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.

Johnny G

aaahhh i get it now. it all makes sense now. so it can be used in in place of LDRs or FETs that would be normally used as voltage controlled resistors and its alot better because you can set the min resistance (with rseries) and sweep range more easilly.

ok yeah thats pretty damn cool lol
LET US INSTIGATE THE REVOLT,DOWN WITH THE SYSTEM!

idlefaction

Yeah it is pretty cool huh!

If your circuit's got a constant potential across two terminals that's above about 0.2V i *think* you'd be able to just use a fast MOSFET instead of a CMOS switch.  I'd need to try it out tho...  and my workshop's packed away *dammit*

my pot idea was to use an inverter to provide two out-of-phase signals to a totem pole of two mosfets; that way your duty cycle should give you a pretty good approximation of a pot's action.  I was going to see if putting each MOSFET in parallel with a fixed resistance would approximate to any degree varying the average resistance varying between nothing (MOSFET always on, 100% duty cycle) and the value of the parallel resistance (MOSFET always off, 0% duty cycle).

here:
http://lucidtone.com/misc/pwm_idea.png

heh.
Darren
NZ


Transmogrifox

Thanks for the link puretube--

looks like this device would make a good stand-alone audio amplifier.  It's an interesting fuzz distortion you get from overdriving the input of these pwm's.
trans·mog·ri·fy
tr.v. trans·mog·ri·fied, trans·mog·ri·fy·ing, trans·mog·ri·fies To change into a different shape or form, especially one that is fantastic or bizarre.