# Understanding a relaxation oscillator

Discussion in 'Homework Help' started by tomsalden, May 26, 2016.

1. ### tomsalden Thread Starter New Member

May 25, 2016
1
0
Hello everyone,

For a project for my study, I have to design a mine detector, which can detect a metal object. I therefore have to create a sensor, which sends its readings to an FPGA, which will tell if there is a mine or not.

After thinking about it for a while, an assistant told me to have a look at this circuit:

Oscillator.pdf

This oscillator will generate a square wave, and using an op-amp, it will not be damped. How to implement this circuit is clear to me, when a metal object comes near to the inductor, the inductance changes, and therefore, the frequency at which the circuit operates changes. The code I will write on the FPGA will check if the 'standard' frequency set for the circuit has been changed, and give results depending on it.

Implementing is not really the problem, but what I would like to know is how this circuit really behaves. I understand that the op-amp outputs, due to hysteresis, either the maximum voltage or the minimum voltage, and that this is swiched when the + pole of the op-amp is larger than the - pole, and the other way around.
Therefore, I tried to look up other oscillators which output a square wave, and came across a very standard oscillator:

I understand how this circuit works, since the capacitor wants to charge or discharge to the level of Vout, but the voltage division of the two resistors will let the value of V+ always be higher or lower than Vout. When the capacitor charges or discharges, V- will pass V+, and the opamp will switch.

In the circuit given to me, there is no feedback, only a ground connecting to the + pole, making it harder to think of the circuit in this way. I therefore tried to simplify the circuit, by interchanging the op-amp with a square voltage source, and setting it at the right frequency.

other circuit.pdf

Although this gave me the right result, I did not come any closer to finding how the circuit really works. Lastly, I thought about how an RLC circuit behaves when there is an AC going through it, at its resonance frequency, but since I am only a first-grader, I am not really an expert on these subjects yet, though I understand that the capacitor lacks behind just as much as the inductor is ahead.

One last problem with the circuit, is that I don't know how to calculate the frequency it is operating at. Since the typical resonance frequency of a RLC circuit is equal to $$f=\frac{1}{2\pi \sqrt{LC}}$$. When I try to apply this to my simulated values (those will not be the real values though), $$\frac{1}{2\pi \sqrt{1*100\times10^-6}}=15.92 Hz$$ is definitely not the same as the 194.92 Hz the simulation shows me.

Where do I go wrong, and what is the best idea to view this circuit..

Thank you all very much for trying to help me! (sorry for the long text though!)
Tom

File size:
6.2 KB
Views:
10
File size:
4.1 KB
Views:
8
2. ### dannyf Well-Known Member

Sep 13, 2015
2,196
421
The circuit is a comparator: if V- ss greater than V+, the output swings to Vss; otherwise, it swings to Vdd.

The tricky part is that V+ (=Vout / 2) varies with Vout, causing a level of "stickiness".

3. ### MrAl Distinguished Member

Jun 17, 2014
3,721
789
Hi,

Which circuit are you having trouble with?

If it is the RLC circuit, then you have to simulate the current to see the resonant point. The resonant point should be w=1/sqrt(L*C) as you thought.

If it is the op amp circuit, you have to calcualte the charge and discharge times of the capacitor. It's similar to doing the 555 astable. For equal resistors on the non inverting terminal, the charge point is 2/3 of Vcc and the discharge point is 1/3 of Vcc. BTW that circuit is missing the third equal resistor that goes from the non inverting terminal to +Vcc, which keeps that network biased at 1/3 and 2/3 of Vcc.

So you know the following charge equation is:
Vcc*2/3=(Vcc-Vcc/3)*(1-e^(-t/RC))+Vcc/3

and discharge equation:
Vcc/3=Vcc*2/3*e^(-t/RC)

where R is the resistor connected to the cap C and RC=R*C.
If you calculate t in each of these and then add them, then take the reciprocal, you get the frequency of oscillation. It's not too hard to do. Note the equations can be simplified before we even start.

If the three resistors connected to the non inverting terminal are not equal then the ratios of 1/3 and 2/3 of Vcc change, but the new ratios are not hard to calculate either if you just consider that the output only goes either completely high or completely low. If the op amp can not reach these points then we have to include those voltage drops into the equations, but the basic idea is to just know how the theoretical circuit works given ideal components.

Last edited: May 26, 2016