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.
  • #31
Seth Cohen said:
Agreed, I can tune RC or I can tune the threshold ob the comparator to adjust m.
no. the equation is not linear.
run a test for me. use a very small pulse width with your compactor setup
then use a very long pulse width with your comparator.
evaluate what the gains are. it will not be linear
make sure with the long pulse width you do not saturate your output voltage.
 
Engineering news on Phys.org
  • #32
donpacino said:
im talking about the comparator......

I am lost with respect to this. All I am trying to do is implement a circuit that:
1) I inject a single pulse of width x
2) the circuit responds by giving me a single pulse of width f(x)

This can be done for f(x) = mx using an opamp integrator circuit and a logic gate. The opamp integrator makes a triangle wave and the logic gate triggers off of it when it crosses the thresholds.
 
  • #33
I realize that. you are misunderstanding the purpose of the comparator. it does not in any way contribute to your pulse with manipulation (if you set the trigger low enough). its purpose is to provide a stable voltage to the logic

donpacino said:
you're talking about the a comparator on the output of the integrator right?
unless your circuit arrangement is different from what i think it is, you won't be linearly changing the pulse width.
the purpose of the comparator is to ensure that the voltage levels are enough to trigger logic.
 
  • #34
Seth Cohen said:
I am lost with respect to this. All I am trying to do is implement a circuit that:
1) I inject a single pulse of width x
2) the circuit responds by giving me a single pulse of width f(x)

This can be done for f(x) = mx using an opamp integrator circuit and a logic gate. The opamp integrator makes a triangle wave and the logic gate triggers off of it when it crosses the thresholds.
you have a circuit that does the correct thing, but completely misunderstood my comment about the comparator
 
  • #35
donpacino said:
no. the equation is not linear.
run a test for me. use a very small pulse width with your compactor setup
then use a very long pulse width with your comparator.
evaluate what the gains are. it will not be linear
make sure with the long pulse width you do not saturate your output voltage.

What do you mean by "the equation is not linear"

This seems like geometry.
donpacino said:
I realize that. you are misunderstanding the purpose of the comparator. it does not in any way contribute to your pulse with manipulation (if you set the trigger low enough). its purpose is to provide a stable voltage to the logic
I think there is a big misunderstanding. You guys are making me feel like I am taking crazy pills. See attached.
 

Attachments

  • flowRoot3817.png
    flowRoot3817.png
    9.2 KB · Views: 461
  • #36
Seth Cohen said:
What do you mean by "the equation is not linear"

This seems like geometry.
I think there is a big misunderstanding. You guys are making me feel like I am taking crazy pills. See attached.

The output pulse width is m times the input pulse width. m is a constant multiplicative factor. No?
 
  • #37
Seth Cohen said:
What do you mean by "the equation is not linear"

This seems like geometry.
I think there is a big misunderstanding. You guys are making me feel like I am taking crazy pills. See attached.
ok. so if there is a very small pulse at the input (say 5 ms), the peak integrator output barely touches the comparator threshold, the comparator will never output anything, so the gain is zero.
so we know it takes a 5 ms pulse to go over the threshold for this comparator setting
if there is a pulse, say 6 ms, and the integrator barely goes over the comparator output, the output of the comparator would be 2 ms. or a gain of 0.33
7 ms pulse, the output would be 4 ms, or a gain of 0.57
8 ms pulse the output would be 6 ms, or a gain of 0.75

eventually it would come close to being linear (until the integrator saturates).

So if you are ok with nonlinear data in a certain range, then go for it (note by the time you approach a linear range you will be close to saturation).

The output of the integrator where the pulse should be active will be close to zero. the purpose of the comparator is to increase this voltage, basicly any voltage aboze ground will become 3.3 V, 5V, or whatever the comparator supply is at.
does that make sense.

dont worry about the crazy pills thing, it happens to everyone!
 
  • #38
I do not know of any other analog pulse width multipliers.
 
  • #39
you could use digital methods as well
 
  • #40
donpacino said:
you could use digital methods as well

What kind of digital method?
 
  • #41
you can either use a microprocessor (software), or digital logic (asics or fpgas).
basically you run a counter starting on the rising edge of the input, multiply the value of the counter by 2, or whatever value you want, then have the output stay high until the counter runs out.
 
  • #42
donpacino said:
ok. so if there is a very small pulse at the input (say 5 ms), the peak integrator output barely touches the comparator threshold, the comparator will never output anything, so the gain is zero.
so we know it takes a 5 ms pulse to go over the threshold for this comparator setting
if there is a pulse, say 6 ms, and the integrator barely goes over the comparator output, the output of the comparator would be 2 ms. or a gain of 0.33
7 ms pulse, the output would be 4 ms, or a gain of 0.57
8 ms pulse the output would be 6 ms, or a gain of 0.75

eventually it would come close to being linear (until the integrator saturates).

So if you are ok with nonlinear data in a certain range, then go for it (note by the time you approach a linear range you will be close to saturation).

The output of the integrator where the pulse should be active will be close to zero. the purpose of the comparator is to increase this voltage, basicly any voltage aboze ground will become 3.3 V, 5V, or whatever the comparator supply is at.
does that make sense.

dont worry about the crazy pills thing, it happens to everyone!
donpacino said:
you can either use a microprocessor (software), or digital logic (asics or fpgas).
basically you run a counter starting on the rising edge of the input, multiply the value of the counter by 2, or whatever value you want, then have the output stay high until the counter runs out.
This is a device that will be discretized to the clock rate - not a continuous function f(x).
 
  • #43
donpacino said:
ok. so if there is a very small pulse at the input (say 5 ms), the peak integrator output barely touches the comparator threshold, the comparator will never output anything, so the gain is zero.
so we know it takes a 5 ms pulse to go over the threshold for this comparator setting
if there is a pulse, say 6 ms, and the integrator barely goes over the comparator output, the output of the comparator would be 2 ms. or a gain of 0.33
7 ms pulse, the output would be 4 ms, or a gain of 0.57
8 ms pulse the output would be 6 ms, or a gain of 0.75

eventually it would come close to being linear (until the integrator saturates).

So if you are ok with nonlinear data in a certain range, then go for it (note by the time you approach a linear range you will be close to saturation).

The output of the integrator where the pulse should be active will be close to zero. the purpose of the comparator is to increase this voltage, basicly any voltage aboze ground will become 3.3 V, 5V, or whatever the comparator supply is at.
does that make sense.

dont worry about the crazy pills thing, it happens to everyone!
I still disagree - if the integrator is created the tent-like shape, and you choose a threshold like in the figure I attached, then the output will be linearly related to this input. Granted, like you said, there will be a range of short pulse widths < dw where the output will be nothing. BUT, beyond dw, the output width y = m*(x-dw) for x > dw and y = 0 for x < dw. This model also assumes that m < 2 and that x is shorter than the saturation time of the integrator.
 
  • #44
Seth Cohen said:
This is a device that will be discretized to the clock rate - not a continuous function f(x).
yup, like all digital devices its clock needs to be fast enough.
 
  • #45
Seth Cohen said:
I still disagree - if the integrator is created the tent-like shape, and you choose a threshold like in the figure I attached, then the output will be linearly related to this input. Granted, like you said, there will be a range of short pulse widths < dw where the output will be nothing. BUT, beyond dw, the output width y = m*(x-dw) for x > dw and y = 0 for x < dw. This model also assumes that m < 2 and that x is shorter than the saturation time of the integrator.

You can believe what you want. The higher your threshold, the more non-linear it becomes, it's a fact, not an opinion.
 
Last edited:
  • #46
donpacino said:
You can believe what you want. The higher your threshold, the more non-linear it becomes, it's a fact, not an opinion.

Can you at least tell me why the attached is wrong?
 

Attachments

  • flowRoot3872.png
    flowRoot3872.png
    14.4 KB · Views: 457
  • #47
its not wrong. that's what I am trying to tell you.
You will get a gain out of it. you will be able to control it with the threshold.
It will be non linear
 
  • #48
Maybe our definition of "linear" is the confusion. To me, linear is that the output y only depends on the input x, not something like x^2 or log(x). It is y LINEARLY related to x.
 
  • #49
ok let's try this. the value of "m" (which is the gain) will change as X changes.
 
  • #50
why? isn't it just dependent on the RC?
 
  • #51
donpacino said:
ok. so if there is a very small pulse at the input (say 5 ms), the peak integrator output barely touches the comparator threshold, the comparator will never output anything, so the gain is zero.
so we know it takes a 5 ms pulse to go over the threshold for this comparator setting
if there is a pulse, say 6 ms, and the integrator barely goes over the comparator output, the output of the comparator would be 2 ms. or a gain of 0.33
7 ms pulse, the output would be 4 ms, or a gain of 0.57
8 ms pulse the output would be 6 ms, or a gain of 0.75

eventually it would come close to being linear (until the integrator saturates).

So if you are ok with nonlinear data in a certain range, then go for it (note by the time you approach a linear range you will be close to saturation).

The output of the integrator where the pulse should be active will be close to zero. the purpose of the comparator is to increase this voltage, basicly any voltage aboze ground will become 3.3 V, 5V, or whatever the comparator supply is at.
does that make sense.

dont worry about the crazy pills thing, it happens to everyone!

see above. the gain is the value of m. it will change as x changes
 
  • #52
ahaaa! I understand what you are saying, and I still think I am correct - we are just calculating m differently.

Based on your argument 5 ms = dw (see my picture). dw is fixed and does not change because the slope is fixed and the threshold is fixed.

2*(6 ms - dw) = 2;
2*(7 ms - dw) = 4;
2*(8 ms - dw) = 6;

m=2;
 
  • #53
dw remains constant, so your equations don't make sense. in this case dw is allways 5.

that means your m for each data point will be different, it can't be 2 every time.
 
  • #54
we are just labeling m differently.

in my equation, m is what multiplies the input width.
output width = m*((input width) - dw)

m*(6 ms - dw) = 2;
m*(7 ms - dw) = 4;
m*(8 ms - dw) = 6;

You are correct that the ratio of output/input, which some may call the gain, is not fixed. But the multiplicative factor of the input value, which is what I call m=2 or gain is fixed. The linear gain to me is the first derivative of the above formula.

Also, now that I look at this, it can ONLY have a linear multiplicative of 2, no matter what the threshold. Thoughts?
 
  • #55
how are you setting your m?
 
  • #56
donpacino said:
how are you setting your m?
I am not, the m is fixed at 2. This technique seems it will always double the time that the integrator is about the threshold while the input is in a high state.
 
  • #57
you were arguing the case for a variable m by using a comparator...
also your value of m, which is set by the integrator circuit, is dependant on dw being 0 or very close to it.
 
  • #58
Seth Cohen said:
For the case of a linear integrator, I can put a comparator on the output and raise and lower the threshold of the comparator to get different output width functions f(x) = m*x, where m is a constant multiplicative factor.
 
  • #59
I think I was wrong about having a variable m. I thought that by adjusting the threshold, it would change the multiplicative factor. Instead, I now believe that the multiplicative factor of the formula m*((input width) - dw) is always 2. dw is what gets adjusted,
 
  • #60
this has been helpful. I think in the end, this is very limited method of controlling pulse-widths. It cannot give an arbitrary function of widths f(input) = output.
 

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