Author Topic: Design of a 1MHz phase detector circuit  (Read 518 times)

0 Members and 1 Guest are viewing this topic.

Offline snoozy

  • Contributor
  • Posts: 9
  • Country: de
Design of a 1MHz phase detector circuit
« on: October 15, 2020, 03:35:45 pm »
Hey guys and girls,  :)

I try to design a circuit that can detect the phase difference in a oscillating circuit. In the final application there will be an inductance that is variable (L2). The circuit should give out a PWM signal depending on the change of the inductance of L2.

What I did is creating a 1 MHz clapp oszillator that stimulates the oscillator consisting of C4,C7,C8,C9 and L2.
I give that on two comperators and than on an XOR.

In the simulation it works, but I think it is not perfect and there will be problems with the real circuit.
The problems I see now:

1. The voltage at the oszillator is very low, because of the voltage devider R6 and L2/C4. A high amplifing is necessary (U3,U4).

2. The slew rate of U2 and U5 might not be high enogh.

3. I'm not sure about, which op-amps and what XOR to use

4. There is probably a better circuit for this job, that I couldn't find in my books. Phase detector ICs are two expensive in my case.

5. The clapp oszillator might need optimazation, too. :-[

Thaks for helping me out and kicking me in the right direction.   :box:
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3368
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Design of a 1MHz phase detector circuit
« Reply #1 on: October 15, 2020, 03:52:22 pm »
Since when is a HC4046 or equivalent an expensive IC?
 
The following users thanked this post: snoozy

Offline snoozy

  • Contributor
  • Posts: 9
  • Country: de
Re: Design of a 1MHz phase detector circuit
« Reply #2 on: October 15, 2020, 04:10:41 pm »
 :o true, I checked on mouser before and found IC in the range of 8 €.
I will have a look at this one  :-*


Edit: I had a look and the HC4046 could replace / is an XOR.

I still need to  prepare the signals to TTL level, which left me again with my problems 1,2,4 and 5 :D
« Last Edit: October 15, 2020, 04:46:57 pm by snoozy »
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3368
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Design of a 1MHz phase detector circuit
« Reply #3 on: October 15, 2020, 05:22:45 pm »
Read the datasheet again, carefully. 

There are several phase detectors available and you do not need TTL levels.

//EDIT: Added what you have likely missed and is easy to overlook.
« Last Edit: October 15, 2020, 05:31:03 pm by Yansi »
 
The following users thanked this post: snoozy

Offline snoozy

  • Contributor
  • Posts: 9
  • Country: de
Re: Design of a 1MHz phase detector circuit
« Reply #4 on: October 17, 2020, 01:19:27 pm »
Thanks for the tipp. I might come back to the IC, it seems to be available for LTspice, but needs a bit of effort to include it in the simulation (at least for me).

I changed the circuit a bit, to get higher voltage at the oscillator (sensor circuit).
Now I want to compare the sensor circuit C4 and L2 with the Clapp oszillator.

But now I have problems to get the simulation running. It is super slow and there seems to be something wrong (the log says: Direct Newton iteration failed to find .op point.  (Use ".option noopiter" to skip.)).

It would be great, if somebody could have a look. The problems started, when I added the comparators.


EDIT: I tried to add the 74HC4046 to my circuit from the LTSpicePlus library.  It works on its own, but as soon as I combine my circuit with it I get this Error:
Fatal Error: Analysis:  Time step too small; initial timepoint: trouble with u1:dzslewp-instance d:u1:zslewp

I don't know, but this drives me crazy  |O
« Last Edit: October 17, 2020, 03:11:33 pm by snoozy »
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3368
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Design of a 1MHz phase detector circuit
« Reply #5 on: October 17, 2020, 03:19:17 pm »
Why don't you breadboard it?  It is a simple 10-piece circuit and you would get some real world "simulation". That way you would also easily find your 6 uF - 3.8 nH craziness would not be even remotely possible to do. (4nH is the inductance of about 4 mm (1/8th of an inch) of wire).

ADA4981 is not a comparator to begin with. Also, in real world, those 5x inverting amplifiers it would not really work well at 1 MHz, due to the rather large impedances used. Downsize them at least 10 times. (1k, 5k6). ... again, breadboard it and test it! Block by block.  Sims won't tell you everything.
Also, U4 and U5 is missing a path for input bias current to flow (at their inverting input). You can't just capacitively couple into an opamp input. The node is high impedance, sure, but its bias current (however small it is) must still flow somewhere. (note your R11 for U1, same way you need one for U4, U5. So for example remove C8 and add an resistor for U4 inverting input).

Sims can be very confusing for beginners due to giving false results. Sims are as good as are their input data. Breadboarding is I'd say still the preferred method to learn the real stuff.

 
The following users thanked this post: snoozy

Offline snoozy

  • Contributor
  • Posts: 9
  • Country: de
Re: Design of a 1MHz phase detector circuit
« Reply #6 on: October 17, 2020, 04:33:09 pm »
Thanks a lot for helping. I don't have the parts yet and I can't order so often. Therefore I simulate and try to get the concept working.

The 3 nF inductance is a  2 winding high current coil actually. Probably not the best choise, but is given by the task right now. But that is probably something that needs to be changed to a range of 10uH to 50uH as I saw in other applications.

I had some troubles to find an Op amp in the list of available ones in LTspice. I will try to find one with a high slew rate later.

I changed the resistor size and added a path for the bias current. The simulation is still not really working (very slow). I tried to bypass the couple C's with a 1Meg resistor, but it doesn't help. There must be a numeric problem.

So, I could order some parts to figure out how to get it working, but I also need the simulation for analysis reasons later.  :-/
The task says to compare simulations with the real circuit.

Well I keed trying for now.
« Last Edit: October 17, 2020, 04:42:37 pm by snoozy »
 

Offline Yansi

  • Super Contributor
  • ***
  • Posts: 3368
  • Country: 00
  • STM32, STM8, AVR, 8051
Re: Design of a 1MHz phase detector circuit
« Reply #7 on: October 17, 2020, 05:37:52 pm »
Well, another obvious issue you have there is trying to drive a 6uF load at 1MHz. As an exercise, calculate the required current to do so, for example at any sensible amplitude (say 100 mV across it).  Not to mention, that opamps do not like capacitive loading, unless special precautions taken.
 
The following users thanked this post: snoozy

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 4220
  • Country: us
  • $
Re: Design of a 1MHz phase detector circuit
« Reply #8 on: October 17, 2020, 07:38:15 pm »
I have breadboard a phase detector out of transistors to a high frequency, if I recall when you swept the frequency it worked to 10+MHz. The waveforms start to look bad but it does work. Don't be too scared of the breadboard here. Make the wires neat and optimize it for length. This was a discrete XOR based one IIRC, but it was more then 5 years ago.. Still tells you something though because if XOR IC expanded to transistors all over a breadboard worked to 10MHz (limits of equipment), breadboards are not that bad. I mean it looked nasty but you can figure out what it was doing despite all the ringing. But I did fold the wires nicely and trim them down a bit and lifted everything off the board to rewire it when I saw the thing I made was not really positioned the best.

I also got good performance on a 16bit SAR adc on a breadboard with alot of precision op amps and stuff. You don't need to go strait to a prototype PCB alot of the time, or even use solder, thankfully, for the first step. But you do need a breadboard that is not fucked up from putting TO220 parts in it (they are the biggest breadboard killers I know because it almost feels right to put one in there). 

I also do wonder if spraying a breadboard down with deoxit is a good idea, I used them before deoxit became an affordable commodity for me. Now I don't want to use the breadboards I have because I messed them up being lazy with TO220 and they have problems.

The other problem you might have is cheap resistors that have leads which are too thin, they will trick you into thinking you have signal rate problems but infact its just crappy connections. And be careful to wipe the leads down with alcohol if you remove them from glue-paper strip packaging, it soils the breadboard. You kind of need fine scotch brite also if you use old components.


Actually I am curious enough to maybe try to put a old breadboard into the ultrasonic cleaner with clean water and see how much gunk comes out of it lol. 10 year old breadboard should say it all.

1 trap I see in your testing is the coils, if you wind them yourself you need to make sure the wire you leave touching the breadboard is the right diameter and stiff enough, you might need to solder it to a PCB with proper 'pins' on it.
« Last Edit: October 17, 2020, 07:54:10 pm by coppercone2 »
 
The following users thanked this post: snoozy

Offline bob91343

  • Super Contributor
  • ***
  • Posts: 1074
  • Country: us
Re: Design of a 1MHz phase detector circuit
« Reply #9 on: October 17, 2020, 10:13:22 pm »
It takes a lot of nerve and faith to specify an inductance to five figures.  And the batch of parallel capacitors implies very close tolerances as well.

All well and good theoretically but totally impractical.  And with so much gain, the oscillator frequency stability will most certainly make the detector fly through its window.

What is the purpose of this circuit?
 
The following users thanked this post: snoozy

Online coppercone2

  • Super Contributor
  • ***
  • Posts: 4220
  • Country: us
  • $
Re: Design of a 1MHz phase detector circuit
« Reply #10 on: October 17, 2020, 11:00:54 pm »
I think you would need an air capacitor trim bank to get that kind of resolution
 
The following users thanked this post: snoozy

Offline snoozy

  • Contributor
  • Posts: 9
  • Country: de
Re: Design of a 1MHz phase detector circuit
« Reply #11 on: October 18, 2020, 05:58:18 am »
Thanks guys for your words. I will go to everything in detail.

The circuit should be for inductive distance measurement. There are different coils, that were chosen by a group that worked before on the project. As well as the basic idea of the circuit.
Actually a change of the inductance should lead to a phase change and this should be detected and transformed into a 0...10V signal.

As I mentioned before, I need a point to start. If I don't know what components and what circuit could work, I can't order them for trying on a breadboard. I would prefer to have at least a concept that makes sense in the simulations, than create a protoype PCB and test. These PCBs are cheap today and I can use SMD components, that will be in the final application, too.
Or, I could solder it together on these other kind of breadboards for soldering. Thats what I usually do.
But anyway. I could make a list of components and order them, to do the breadboard. I will try that today.

@Yansi current seems to be super high: Xc = 1 / (2*pi*f*C) = 1 / (2*pi*1MHz*6uF) = 0,027 Ohm
I = 100 mV / 0,027 Ohm = 3,7 A


As you maybe see, I'm a bit lost trying to find a working and realistic concept for this task. My electronic experience comes more from the digital world of microcontrollers. But I try my best to understand and solve the problems.
I would start over with a total new concept, if there is any more popular, or easy and stable for a task like that. I saw also, that some people use a analog switch driven by a microcontroller to create a rectangle to drive the oszillator. But this should be a circuit without uC.
« Last Edit: October 18, 2020, 06:27:05 am by snoozy »
 

Offline snoozy

  • Contributor
  • Posts: 9
  • Country: de
Re: Design of a 1MHz phase detector circuit
« Reply #12 on: October 18, 2020, 05:48:24 pm »
I just wanted to give a little update:
The problem is called Bias currents, as mentioned before. By adding a resistor between the inputs, I could get the simulation running again!
Also, by using a propper op amp, I could get the comparator function running!

Thanks so much  :phew:

Next step is the XOR, and then I will try to order parts to proceed.

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf