Author Topic: Square wave signal to a fixed pulse width signal  (Read 1089 times)

0 Members and 1 Guest are viewing this topic.

Offline pman92Topic starter

  • Contributor
  • Posts: 29
  • Country: au
Square wave signal to a fixed pulse width signal
« on: February 23, 2022, 08:55:38 am »
Hey guys,

I have a working circuit that uses a MOSFET and an inductor that is "charged up" (if that's the correct terminology) / saturated and then switched off. The resulting voltage spike from the inductor is used as a signal to drive an older style automotive tachometer. The circuit receives a square wave input that is always 50% duty cycle (but varies frequency from a few hertz to probably no more than 1 or 2 kHz).

At lower frequency's the inductor spends most of its time switched on pointlessly. It is already fully saturated, but current continues to flow through it until the next edge of the square wave, pointlessly wasting current and generating heat.

I would like to be able to use the square wave signal to generate another square wave signal, which has the same frequency, but a fixed / shorter time when it is high. Essentially a signal with a variable duty cycle to only remain high for long enough to saturate the inductor and then switch low. I could use that signal to drive the MOSFET gate and eliminate the inductor being switched on for the excessive amount of time.

I'm figuring I'll use some resistor/capacitor arrangement (with correct values for the desired amount of on/high time) along with a comparator or logic gate to compare that "slow changing" voltage to some other fixed voltage and produce the required output. However I'm not exactly sure how to approach it.

It is not important if the new signal is out of phase (it can be high when the old signal is low). It also doesn't matter if its triggered on the rising or falling edge. However it is important that the new signal doesn't bounce between off/on at the transitions. A simple solution with the fewest number of components would also be preferred.

Thanks in advance for any advice.
Cheers
 

Offline Terry Bites

  • Super Contributor
  • ***
  • Posts: 2393
  • Country: gb
  • Recovering Electrical Engineer
Re: Square wave signal to a fixed pulse width signal
« Reply #1 on: February 23, 2022, 10:13:33 am »
What you need is a (non retriggerable) monostable- it gives a fixed pulse width output independently of the input pulse width. A 555 (related to the 666) will work here.
Replace the switch in this circuit with your mosfet. https://www.electronics-tutorials.ws/wp-content/uploads/2018/05/waveforms-tim38.gif
 

Online Benta

  • Super Contributor
  • ***
  • Posts: 5877
  • Country: de
Re: Square wave signal to a fixed pulse width signal
« Reply #2 on: February 23, 2022, 11:23:48 am »
A better choice would be MC14538.
But yes, an edge-triggered, non-retriggerable monostable is the way to go.
 

Offline Damianos

  • Frequent Contributor
  • **
  • Posts: 268
  • Country: gr
Re: Square wave signal to a fixed pulse width signal
« Reply #3 on: February 23, 2022, 11:10:03 pm »
If the main goal is the minimum number of components, then just put a capacitor in series with the square wave signal. Assuming that there is a resistor, between gate and source of the MOSFET, it will make a differentiator, that produces short pulses at each edge of the input signal. This may increase the heating of the transistor due to the slow falling of the voltage. This can be solved by using a Schmitt trigger circuit to make the pulse orthogonal.
A differentiator is also needed at the input of the proposed "555" circuit. [EDIT: because the trigger signal must be of shorter duration than the output]

A proper solution (I think so) will be a circuit that detects the current limit and resets the operation, waiting for the next pulse. But this may be a little more complicated.
« Last Edit: February 23, 2022, 11:20:08 pm by Damianos »
 

Offline pman92Topic starter

  • Contributor
  • Posts: 29
  • Country: au
Re: Square wave signal to a fixed pulse width signal
« Reply #4 on: February 24, 2022, 09:07:26 am »
Thanks guys.
I've decided I'll go with the series capacitor option to reduce the number of components and limit complexity.
I've calculated (and checked with the scope) that the inductor only takes 200uS to saturate, so even at the fastest frequency I think I'll ever need its much faster than required.
I'm already using an inverter gate/schmitt trigger elsewhere, so if I can use another one of them the same that would mean I don't need any new types of components.

I've come up with a proposed circuit (see picture). I decided I need to add a series resistor before the capacitor to limit the current in/out of the microcontroller (which is supplying the square wave). I decided on 470R as I'm already using one elsewhere and it seemed like an appropriate value (approx 10mA current at 5v).

I have found the switching threshold voltages for positive/negative going transitions in the Schmitt trigger/inverter gate datasheet. Obviously there will be a bit of pulse length variation depending on how the schmitt trigger performs (temperature etc.), but working with the min/max values specified I'm sure I can find something that works (it doesn't matter if its on too long as I have plenty of time to work with).

I'm at a bit of a loss on how to calculate the capacitor and resistor values connected the inverter gate input, so as to create the desired pulse length. I'm familiar with calculating the RC time constant, but the additional 470 ohm current limiting resistor on the other side of the capacitor confuses me. How do you calculate the time constant when you have resistors on both sides of the capacitor? I'll probably just try a heap of different values until I find something that works, but it would be nice to know how to calculate it as well.

Cheers
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Re: Square wave signal to a fixed pulse width signal
« Reply #5 on: February 25, 2022, 03:56:20 am »

I'm already using an inverter gate/schmitt trigger elsewhere, so if I can use another one of them the same that would mean I don't need any new types of components.

I've come up with a proposed circuit (see picture). I decided I need to add a series resistor before the capacitor to limit the current in/out of the microcontroller (which is supplying the square wave). I decided on 470R as I'm already using one elsewhere and it seemed like an appropriate value (approx 10mA current at 5v).
...

I'm at a bit of a loss on how to calculate the capacitor and resistor values connected the inverter gate input, so as to create the desired pulse length.

I presume the 470R is to prevent excess current from entering/draining through the mcu pin. But I don't think you have to worry about it in this case because the R connected to the 5V rail will limit both charging and discharging current.

In any case, I think you could swamp out the effect of the 470R if you use a large enough resistor value. The basic formula is 0.7RC or 0.8RC depending on who you ask -- so there's already a fudge factor involved. Then using the chart below you can quickly assess your RC options. My feeling is that if you pick an R in the 100's of K then the 470R isn't really going to affect the timing.

http://www.n5dux.com/ham/files/pdf/Working%20With%20Monostable%20Multivibrators.pdf

 

Offline Damianos

  • Frequent Contributor
  • **
  • Posts: 268
  • Country: gr
Re: Square wave signal to a fixed pulse width signal
« Reply #6 on: February 26, 2022, 01:34:44 am »
When the input is in low state the capacitor is charged to 5V, then, when the input rises, the two voltages add up (Vc+Vpulse)! To protect the input of the IC put also a diode from it's input to the 5V and keep your proposed series resistor.

EDIT: Check also if the Schmitt trigger can drive the transistor fast enough (both data sheets are needed).
« Last Edit: February 26, 2022, 03:56:03 am by Damianos »
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3036
  • Country: us
Re: Square wave signal to a fixed pulse width signal
« Reply #7 on: February 27, 2022, 12:41:16 am »
When the input is in low state the capacitor is charged to 5V, then, when the input rises, the two voltages add up (Vc+Vpulse)! To protect the input of the IC put also a diode from it's input to the 5V and keep your proposed series resistor.

That's a good point especially since the inverter is an AHC device.

In researching this issue I learned that unlike other CMOS logic families the AHC family does not have a positive clamp diode on its inputs. In fact, there is this specific warning in the AHC Designer's Guide (page 14):

Quote
Input voltages greater than 7 V must be avoided to preclude damage to the gate oxide of the input stage. This damage is not
necessarily permanent, but will adversely affect the expected lifetime of the circuit. The gate oxide of AHC devices is only
200 Å thick. An input voltage of 7 V corresponds to a field strength over the gate oxide of 350 kV/cm. Although breakdown
of the oxide is expected only at input voltages above 10 V, electrons tunnel increasingly into the gate oxide at field strengths
greater than 350 kV/cm, influencing characteristics of the transistors and causing failure.

In an app note Maxim suggests using a Schmitt-trigger buffer from the LVC family:

1425715-0

I suppose an LVC inverter could also be used.

Given that the microcontroller is essentially irreplaceable, it might be a good idea to further isolate its output from the edge detector circuit with another buffer/inverter.

AHC/AHCT Designer’s Guide - September 1998
https://www.ti.com/lit/ml/scla013d/scla013d.pdf

Adding Edge-Sensitive Transition Detection to GPIO Devices - Maxim App Note 4634
https://pdfserv.maximintegrated.com/en/an/AN4634.pdf
« Last Edit: February 27, 2022, 12:49:42 am by ledtester »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf