Circuit to control the pulse width of digital signals

Click For Summary
The discussion focuses on designing circuits to control the pulse width of digital signals, specifically looking for a method to map an input pulse width x to an output pulse width y using a function f(x)=y. Participants discuss using one-shots or monostable multivibrators, but clarify that these typically produce fixed-width outputs rather than variable ones. A proposed solution involves using an op-amp integrator and a comparator to create a triangle wave, allowing for adjustments to the output pulse width based on the input. There is debate over the linearity of the output in relation to the input pulse width, with suggestions to test the circuit with varying pulse widths to assess gain. The conversation concludes with an acknowledgment of the potential for nonlinear behavior in the circuit's output.
  • #61
ok cool!

just a note as dw changes the actual m value will change, this is due to the electronics. remember gain is defined as output over input, so as dw increases, your output will decrease and input stay the same, so your gain will go down. this is why the comparator ground is set at zero or close to it, so dw is zero or close to it.

also if you have to do anything complicated digital is the way to go!11
 
Engineering news on Phys.org
  • #62
I don't know how to do f(something arbitrary?) for a single pulse

but your discussion reminds me of old time-division analog computers from 1950's
where we generated a train of pulses with duty cycle proportional to some function of analog inputs.
We used them to multiply and divide analog DC voltages.

A pulse train has average value of area under the curve, (duty cycle) X height.
For example, a 0 to 10 volt square wave that's high half the time will have average value 5 volts.

So consider the following circuit, with following prerequisites:
Capacitor C is charged by E1 through R when S1 is up
and is discharged by -E2 through equal R when S1 is down
Frequency of switching is fast compared to time constant RC.
PWM is basically a zero comparator controlling ratio of switch S1's up and down times,
so as to maintain zero volts on capacitor C. Therefore Ecap remains very nearly zero.
(In the 1950's precise zero detectors were fairly easy but precision opamps were difficult.)Let fraction of time S1 is UP = DC for Duty Cycle
and fraction of time S1 is DOWN = (1-DC)
So current into C is E1/R X DC
and current out of C is -E2/R X(1-DC) which equals E2/R X (DC-1)
TmeDivision_zpsufyjcp2o.jpg


It is apparent that to maintain Ecap = zero, the charge and discharge currents must be equal
so E1/R X DC = -E2/R X (1-DC)
E1 X DC = E2 X (DC-1)
E1/E2 = 1 - 1/DC

Output switch S2 will have same duty cycle
so Eout will have average value E3 X E1/E2
and a simple low pass filter at Eout will deliver a clean analog voltage equal to E3 X E1/E2.

Now we can use that analog computing element to derive products, quotients, squares and square roots as follows

BIG TEN-OOPS HERE, good buddies...

delete the next image and use instead one following
my drafting mistake old jim

TDMcomputer_zps1gxqpbi5.jpg
USE THIS IMAGE instead (i'd delete previous one but it's already been quoted)
TDMcorrected_zpsidpt04ia.jpg


Of course it's slow, two quadrants at best because E1 and E2 must have opposite polarity, and unstable at division by very near zero just like any divider.

but it's very handy for computing things like steam flow with density compensation from dp across an orifice as E1 and density (ρ of pressure) as E2, Eout tied back into E3 for square root of (dp X ρ) .
And absolutely impervious to Stuxnet.Hope you don't mind this digression.
But that's one way you could make pulses with ratio of ontime / offtime in proportion to f(?) = √(a product) which i think was an earlier question..

All we ever used was the analog voltages. This circuit is called "Time Division Multiplier" and is capable of extreme precision, for analog stuff. A testament to the tenacity of those 1950's circuit designers.
Modern ones use 555 timers and opamps and are still running in nuke plants. One even used a TL494 PWM.

old jim

ps it's late and something feels uncomfortable about my duty cycle derivation

will correct in the morning if needed...
 
Last edited:
  • #63
Digital is the way to go, I agree. But not clocked digital, as I want a continuous input output function
jim hardy said:
I don't know how to do f(something arbitrary?) for a single pulse

but your discussion reminds me of old time-division analog computers from 1950's
where we generated a train of pulses with duty cycle proportional to some function of analog inputs.
We used them to multiply and divide analog DC voltages.

A pulse train has average value of area under the curve, (duty cycle) X height.
For example, a 0 to 10 volt square wave that's high half the time will have average value 5 volts.

So consider the following circuit, with following prerequisites:
Capacitor C is charged by E1 through R when S1 is up
and is discharged by -E2 through equal R when S1 is down
Frequency of switching is fast compared to time constant RC.
PWM is basically a zero comparator controlling ratio of switch S1's up and down times,
so as to maintain zero volts on capacitor C. Therefore Ecap remains very nearly zero.
(In the 1950's precise zero detectors were fairly easy but precision opamps were difficult.)


Let fraction of time S1 is UP = DC for Duty Cycle
and fraction of time S1 is DOWN = (1-DC)
So current into C is E1/R X DC
and current out of C is -E2/R X(1-DC) which equals E2/R X (DC-1)


TmeDivision_zpsufyjcp2o.jpg


It is apparent that to maintain Ecap = zero, the charge and discharge currents must be equal
so E1/R X DC = -E2/R X (1-DC)
E1 X DC = E2 X (DC-1)
E1/E2 = 1 - 1/DC

Output switch S2 will have same duty cycle
so Eout will have average value E3 X E1/E2
and a simple low pass filter at Eout will deliver a clean analog voltage equal to E3 X E1/E2.

Now we can use that analog computing element to derive products, quotients, squares and square roots as follows

TDMcomputer_zps1gxqpbi5.jpg


Of course it's slow, two quadrants at best because E1 and E2 must have opposite polarity, and unstable at division by very near zero just like any divider.

but it's very handy for computing things like steam flow with density compensation from dp across an orifice as E1 and density (ρ of pressure) as E2, Eout tied back into E3 for square root of (dp X ρ) .
And absolutely impervious to Stuxnet.


Hope you don't mind this digression.
But that's one way you could make pulses with ratio of ontime / offtime in proportion to f(?) = √(a product) which i think was an earlier question..

All we ever used was the analog voltages. This circuit is called "Time Division Multiplier" and is capable of extreme precision, for analog stuff. A testament to the tenacity of those 1950's circuit designers.
Modern ones use 555 timers and opamps and are still running in nuke plants. One even used a TL494 PWM.

old jim

ps it's late and something feels uncomfortable about my duty cycle derivation

will correct in the morning if needed...

Hi Jim,

Thanks for contributing to the conversation. I will look at your derivation some time today/this weekend. PWM is definitely something I have been looking into because it relates to my problem. The idea of having a single input pulse of width x and a single output pulse of y = f(x), for arbitrary x is a problem that I do not think anyone has solved in some general way. I imagine a lot of optics applications could use this. What do you think?

I can also imagine clocking the input pulse and doing some processing can give me an approximation, but this is not a continuous function and may have discretization issues for optical ranging, etc.

Lastly, if you have published any papers from the 1950's and onward, I would definitely like to take a look.
 
  • #64
wow jim that's awesome!

seth. what is the min pulse width you are expecting. in optical applications you can get pulses as short as ten picoseconds.
 
  • #65
donpacino said:
wow jim that's awesome!

seth. what is the min pulse width you are expecting. in optical applications you can get pulses as short as ten picoseconds.
Any range - ns,us, ms
 
  • #66
you should be able to capture anything down to hundreds or tens of ns easily. all you need is a frequency that matches the smallest pulse width you expect to receive. (ideally it would be much more)
 
  • #67
Drat today it's obvious why i was uncomfortable

stupid drafting error

second image should be replaced with this one:

TDMcorrected_zpsidpt04ia.jpg


i'll go back and add it to above post

apologies to you guys

the derivation is okay i think , but it's more obvious why it works if one used just up-time and down-time instead of duty cycle.

old jim
 
  • #68
Seth Cohen said:
Aren't one-shots and monostable multivibrators used for outputing pulses of fixed widths, so that the function above would be y = f(x) = c, where c is constant. What about something that doubles every input pulse width like y = f(x) = 2x?

Seth, I don't know if they can be called monostable or not, but circuits using the ubiquitous 555 chip in many of its disguises will output a pulse train of constant frequency but variable duty cycle (the fraction of the period of oscillation in which the pulse is "on"). Such circuits are called Pulse Width Modulators and are used to deliver controlled power at constant voltage and frequency to an external device. DC motor speeds and LED brightness can be controlled this way. If the frequency is high enough, the time constant of the external device smooths its input waveform. In the case of a motor, the inertia of the rotor carries it through the off periods of each cycle. In the case of LEDs, they are fast enough to flash on and off with each cycle, but our eyes have long time constants in their response to light, so they experience brighter or dimmer yet smooth light.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
Replies
20
Views
2K
Replies
11
Views
2K
  • · Replies 32 ·
2
Replies
32
Views
5K
Replies
3
Views
341
  • · Replies 16 ·
Replies
16
Views
537
  • · Replies 19 ·
Replies
19
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
Replies
7
Views
4K