Need Equation for PWM

Apr 12, 2005 33 Replies

Then you said:

I assume you are being a hyper-stickler because I did not explicitly include a reference (Vo) voltage in my problem statement. Would you be O.K. if I had said instead:

I think everyone else understood this as a given, which did not need to be explicitly stated.

If this still doesn't satisfy you, then just do a Google search for "voltage as a function of time" +"edu" and you will get a ga-zillion hits showing how voltage can be expressed as a time function. Random example from Bucknell Univ.:

formatting link

No, you're orthogonal.

Rather, I think you need to go back to Kindergarten and learn how not to be a ball-breaker over something that is obvious.

In my original post I clearly indicated that I had done a fair amount of due diligence and wasn't asking without having done some homework already. The assumption in my original post was that there must be a straigtforward answer and since high-powered math-oriented folk frequent such internet groups, it might be a good place to ask....this should be an easy question IF the answer is indeed straightforward.

Also, I did pay attention to the replies and patiently explained why responses were off-target or not what I was looking for. Check out my responses, I paid attention to all the replies and I always explained myself.

Suggest you contact each of the authors (all somehow associated with educational institutions) of the approximately 745 web pages that show up when you Google the terms +"voltage equation" +"edu" and tell them they are "stupider than a joke"....

Google Search:

formatting link

Semi-random example page...this doesn't exactly look "stupider than a joke"...does it?

formatting link

Was trying to get an elegant equation that avoided such things as special EXCEL functions, IF/THEN deals, piecewise deals (like Heaviside) and infinite series.

John Woodgate wrote: Snip

Thanks for the laugh.

-- Tom H

in article snipped-for-privacy@z14g2000cwz.googlegroups.com, jack at snipped-for-privacy@yahoo.com wrote on 4/11/05 10:35 PM:

Life is truly tough. It is made up of a series of trick problems. solve them for yourself. Don't ask others to do it for you, especially if you pay no attention to the replies.

Bill

Jack,

Assuming your square wave oscillates from some voltage V+ to V- at some frequency and duty cycle, here's a simple equation that will work. You *can* implement an IF statement in Excel very easily. Here's the equation:

Given: t = time in seconds f = frequency in Hertz d = duty cycle expessed as a decimal (e.g. 35% = 0.35)

IF = tf - INT(tf) < d/f THEN V(t,f,d) = V+ ELSE V(t,f,d) = V-

The INT function in Excel returns the whole number portion and drops the decimal part.

tf - INT(tf) gives the fraction of the last wave completed after t seconds. d/f gives the fraction of a cycle where the voltage is V+. If the first fraction is less than the second, the voltage is V+. Otherwise it's V-.

Hopes this helps.

Allen

Well- if you know duty D and period T, then at any time t, the function is +1 if FRACT(t/T)D. If you have an offset, to, then use t-to for t in the above. How hard is that? Excel doesn't allow logic coefficients in expressions?

Maybe. Some would say (-1)^(1/3) = (-1/2) + i sqrt(3)/2.

Maybe. Some would say that -- with the exception of integer n , perhaps -- the right definition of X^n is exp( n log(X) ), which forces such people to add "... for positive X only."

Oh, we can fake this too. What you want is the straightforward function f(x) = squarewave(x). You got a problem with that? Most mathematicians would probably accept that answer. (Maybe after a beer or two.)

You could also opt for f(x) = sin(x) / |sin(x)| or f(x) = (-1)^floor(x) . Much depends on what you're trying to accomplish. (You might already have said; I haven't been paying attention, sorry.)

dave

I don't have a formula, but I do have a simple approach: If all you want is to know whether the signal (Vinst) is hi or low at any given instant, it is a simple divide and compare.

From the frequency and duty cycle you compute total time for the cycle, and determine the "on time" from the duty cycle. Assume your pulse is positive going at time Tsubzero: Divide Tsubn by total time. If there is no remainder, the ampltude is at Tsubzero amplitude - high. If there is a remainder, and the remainder is greater than the "on time" the signal is low. If the remainder is less than or equal to the "on time" , the signal is high. If your signal is negative going instead of positive going at Tsubzero, it still works, but you have to invert the highs and lows in the description.

Ed

Jack,

You're welcome. By the way, I noticed that I put an equals sign after the IF. It shouldn't be there.

Allen

Small correction to function parameters (arguments). Period is required, Phase is optional or default to zero. A (V) = f{t (sec), duty cycle (%), Period, Phase(%)}

MG

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required