Circuit to control the pulse width of digital signals

Join the discussion
Registration is free. Start your own thread to ask a follow-up.
67 replies · 7K views
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
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.
 
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.
 
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
 
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: 496
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?
 
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, basically 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 could use digital methods as well

What kind of digital method?
 
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.
 
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, basically 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).
 
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, basically 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.
 
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.
 
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:
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: 494
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
 
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.
 
ok let's try this. the value of "m" (which is the gain) will change as X changes.
 
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, basically 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
 
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;
 
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.
 
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?
 
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.
 
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 dependent on dw being 0 or very close to it.
 
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.
 
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,
 
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.