I'm trying to realize a sawtooth wave generator. The circuit is composed by an op-amp integrator which creates the ramp. Then the integrator output is chained to a comparator with a fixed threshold, which feeds a NPN BJT through a resistor. I want to use the BJT as a switch. When the input signal is below the threshold, the Ib current is 0 and BJT Vce is 'high' and the Ib is null, but when the input signal is over the threshold, the BJT Vce becomes 'low' (saturation condition) while the Ib is greater than zero. I'd like to connect the BJT to the Capacitor in the integrator module so that the capacitor can be discharged, but I don't understand how. Can you help me please? Thank you very much.
Consider this circuit for a minute: -
Other than using a BJT to control the capacitor discharge, it self oscillates and produces a clean triangle waveform and a decent square wave. Now consider what happens when the 2k2 has a diode across it.
This is effectively what you are trying to achieve (saw-tooth) with a transistor - the diode massively reduces the charge time (or discharge time) dependent on the diode direction but think about how this discharge would occur - you need the transistor going to the negative rail and not the earth (mid-rail point) for this to work correctly. It would work in the above circuit (when the diode is added) because the output from the comparator has high negative and positive output voltages with respect to 0V (mid-rail).
Your circuit has the BJT discharging to 0V and this won't cut the mustard.
Here's what my circuit would look like for independent rise and fall ramps using a diode (or two): -
The rise slope is determined by the 100k resistor (R2) and the fall by the 5k6 (R1). You can use a transistor of course but what you end up with is the equivalent of a 555 timer with a constant current source (linear ramp): -
Inside the 555 is the discharge transistor you are trying to implement.
Thank you for your reply! It was enlightening in some way. My schema was modified in this way:
Unfortunately, the C2 Discharge is not sufficient to obtain the desired oscillation...
What I get is a small ripple when threshold voltage is reached. I'd like to obtain a complete discharge so V(U1) returns to 0v.