Author Topic: Stable and fast measurement of variable capacitor  (Read 2456 times)

0 Members and 1 Guest are viewing this topic.

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Stable and fast measurement of variable capacitor
« on: October 17, 2020, 10:30:11 am »
I am working on rebuilding an old radio (Sony CF-420L) with completely new modern digital electronics inside. The plan for this abomination is to use an Arduino with an TEA5767 and a Bluetooth module, combined with reusing the existing switches and knobs as controls.

The frequency dial of the radio is connected to a variable air capacitor (14-680pF) as well as a frequency indicator. I now want the Arduino to read the setting of the capacitor to then set the frequency of the radio module accordingly. The exact capacitance is not relevant, and it does not necessarily have to be linear, but it needs to be stable with relatively low noise. I want to map the measurement to the regular 87.5—108.0 MHz range accurately to the first decimal place. So roughly <0.1% noise is needed, unless I screwed up the estimate. Additionally, for reasonable responsiveness, the measurement needs to be performed at least with say 10Hz rate.

I have breadboarded two circuits to measure the capacitance, neither of which has worked satisfactory:

A. A cd40106 oscillator feeding a Cd4046 PLL, out of which I tap the CV to the PLL VCO. The CV is then low passed and then read with analogRead. With the components I chose, I get frequencies in the range 1.6kHz - 8 kHz. However, the frequency of the cd40106 oscillator seems to have a variation of at least 1% which makes the rest of the circuit kind of hopeless.

B. A 555 timer set up as a linear ramp using a constant current source:



With this, I can send in trigger pulses at the "trigger" pin, and then measure the length of the pulse coming out at "output". With the component values in the schematic, I get pulse lengths of 80us - 1100us. However, using my oscilloscope to check the pulse lengths at a given capacitance shows that the variation is a bit too high. At maximum capacitance I get 1.100ms-1.112ms, and at minimum capacitance 79.2us-80.2us, i.e. roughly 1%.

Does anyone have a clue what I can do to improve on the accuracy on either solution, or perhaps you have an idea of another solution?
« Last Edit: October 17, 2020, 10:33:55 am by kalj »
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1526
  • Country: gb
Re: Stable and fast measurement of variable capacitor
« Reply #1 on: October 17, 2020, 10:39:11 am »
It sounds/looks like you are trying to measure rise time to measure capacitance.
Inherently unstable.

Try measuring the impeadance.
You using Arduino which has  timers on board which can be set up to create 1MHz (or even 10MHz) freq.
This can then be fed ito the cap. You can then use the same technique the $25 component tester uses to measure the impeadance and capacitance.
 

Online Twoflower

  • Frequent Contributor
  • **
  • Posts: 604
  • Country: de
Re: Stable and fast measurement of variable capacitor
« Reply #2 on: October 17, 2020, 10:40:37 am »
Since you remove the guts of that radio, why not replace the variable cap by a potentiometer? Or mechanically add a potentiometer in parallel? Just thinking.
 

Offline coromonadalix

  • Super Contributor
  • ***
  • Posts: 2904
  • Country: ca
Re: Stable and fast measurement of variable capacitor
« Reply #3 on: October 17, 2020, 11:12:07 am »
the problem, in a radio you have more circuitry like a pll   "phase lock loop"  and other stabilisation circuitry

your small ne555 circuit  will never be stable, i doesnt have any frequency or pulse feedback ...   use a dds  as a generator insrtead ?

And  you have many arduinos  AM-FM applications out there to suit your needs   why complicate things ?

BUT

Do i understand  :

you want to read the capacitance to have a frequency readout of somekind of selection ??  to keep the look and feel of the radio ?
you want to match the dial cord tunning assembly and give it a digital tunning version ?

Like this

https://vintageautoradio.com/index.php?option=com_content&view=article&id=54&Itemid=64
https://www.tech-retro.com/aurora-design/home.html

But its done at an huge pricing ...
« Last Edit: October 17, 2020, 11:26:30 am by coromonadalix »
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 16031
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Stable and fast measurement of variable capacitor
« Reply #4 on: October 17, 2020, 11:29:38 am »
CMOS 555 is better (LMC555, 7555..).  Your CCS is so weak, the pin leakage (input bias current) is probably dominant.  Propagation delay (at the smallest C values) will also dominate, so that you end up measuring a combination of delay plus capacitance, not capacitance by itself, nice and proportional.

You can do the same thing with an MCU pin: set the pin output-low, then input-high (passive pullup).  Start timer at the same instant, and stop timer when pin crosses threshold (use an input capture pin, or pin-change interrupt to sample CNT, or get the analog comparator involved (if available), etc.).

Probably won't be very sensitive to small changes in capacitance, but you can repeat measurements to average out noise, and you can get arbitrarily long periods with an external pullup resistor rather than the internal pullup (which will also be more stable vs. temperature).

Better still than measuring single periods: measure frequency.  Small changes in timing are imperceptible from cycle to cycle, but accumulate over time.  Measuring frequency using the timer is more complicated, but there are numerous sketches showing how to do it.

To get frequency, you need an astable oscillator, which the 555 can still do, or the MCU can do to a certain extent, depending on available hardware.  (MEGA might not be able to do this with low latency, but XMEGA I think can pull it off, using events and analog comparator?  STM can probably do it as well.)

And yeah, consider replacing the varicap with a potentiometer.  What could be easier than using an ADC to measure a static voltage? :)

Speaking of ADC, and impedance as mentioned above -- you can set up a crude impedance divider, using GPIO pins, series resistors or capacitors, and the varicap.  By sampling the voltage on the varicap, at a reliable time delay, you'll sample some point along the RC (or other) discharge curve that the capacitance will go through when pulsed by those GPIOs.  I say GPIOs plural, because you may want to use several in parallel, with a range of series impedances (R or C), to cover that wide of a range.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #5 on: October 17, 2020, 11:40:28 am »
How about using an LC oscillator, rather than an RC? It's much more stable at higher frequencies and lower capacitance values. The 74HC4060 could be used if you want a lower frequency the MCU can handle.
« Last Edit: October 17, 2020, 05:54:09 pm by Zero999 »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 12045
  • Country: us
  • DavidH
Re: Stable and fast measurement of variable capacitor
« Reply #6 on: October 17, 2020, 05:48:13 pm »
Why not keep the original local oscillator and measure the output frequency?
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #7 on: October 17, 2020, 06:38:04 pm »
Or put the capacitor as feedback on op-amp and then give it charge packets (pulses from the arduino through a resistor).  Voltage out is then proportional to number of charge packets and inversely proportional to capacitance value.  You can either use a comparator to detect a known voltage or use a fixed number of packets and measure the voltage.   There are details like a discharge circuit to reset capacitor to known voltage, dealing with input offsets (voltage and current) on the op-amp but there is lots of material out on how to do this.  Search integrating A to D circuits.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #8 on: October 17, 2020, 09:52:17 pm »
Since you remove the guts of that radio, why not replace the variable cap by a potentiometer? Or mechanically add a potentiometer in parallel? Just thinking.

I would really like to avoid that since the frequency since it is a quite complicated mechanical mechanism with strings, wheels, and springs. Also, I really prefer solving electronics problems rather than mechanical ones.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #9 on: October 17, 2020, 09:56:23 pm »
It sounds/looks like you are trying to measure rise time to measure capacitance.
Inherently unstable.

Try measuring the impeadance.
You using Arduino which has  timers on board which can be set up to create 1MHz (or even 10MHz) freq.
This can then be fed ito the cap. You can then use the same technique the $25 component tester uses to measure the impeadance and capacitance.

Interesting. How come rise time is "inherently unstable"?

Could you elaborate a little on how to go about measuring the capacitance/impedance using the 1MHz square wave?
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #10 on: October 17, 2020, 09:57:48 pm »
Why not keep the original local oscillator and measure the output frequency?
That would probably have been easiest, but it is a little too late for that now. Unfortunately, I don't have much more of the original components than this variable capacitor.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #11 on: October 17, 2020, 10:00:36 pm »
How about using an LC oscillator, rather than an RC? It's much more stable at higher frequencies and lower capacitance values. The 74HC4060 could be used if you want a lower frequency the MCU can handle.

Interesting, could you describe how such a circuit would function? Perhaps you have a link? I really don't know what to search for...
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #12 on: October 17, 2020, 10:32:53 pm »
How about using an LC oscillator, rather than an RC? It's much more stable at higher frequencies and lower capacitance values. The 74HC4060 could be used if you want a lower frequency the MCU can handle.

Interesting, could you describe how such a circuit would function? Perhaps you have a link? I really don't know what to search for...
https://wiki.analog.com/university/courses/electronics/electronics-lab-21
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #13 on: October 17, 2020, 10:42:56 pm »
I like David's suggestion.
Sony CF-420L has a separate Hartley one transistor ( Q3) FM oscillator I suppose running from 97.8 to 118.7 MHz.
Re-use the Hartley coil to make an oscillator closely based on the existing one, nelecting AFC ( 6pF coupling)

Assuming station separation is in 200 kHz steps ( as in USA) starting at 87.5 MHz ( Sweden ?) , you will need a frequency counter of sufficient accuracy to create 100 entries in LUT.

Assuming the frequency counter is >> more accurate than the free running Hartley, the Hartley will need to have a drift < 100 kHz approx after warmup.
Well, I have an old tube FM receiver here that has 6DT8 FM osc,  stays close to the quadrature detector centre for long periods  even with the AFC off,
so would expect a transistor oscillator to be at least as stable as that.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #14 on: October 18, 2020, 12:03:25 pm »
I like David's suggestion.
Sony CF-420L has a separate Hartley one transistor ( Q3) FM oscillator I suppose running from 97.8 to 118.7 MHz.
Re-use the Hartley coil to make an oscillator closely based on the existing one, nelecting AFC ( 6pF coupling)

Assuming station separation is in 200 kHz steps ( as in USA) starting at 87.5 MHz ( Sweden ?) , you will need a frequency counter of sufficient accuracy to create 100 entries in LUT.

Assuming the frequency counter is >> more accurate than the free running Hartley, the Hartley will need to have a drift < 100 kHz approx after warmup.
Well, I have an old tube FM receiver here that has 6DT8 FM osc,  stays close to the quadrature detector centre for long periods  even with the AFC off,
so would expect a transistor oscillator to be at least as stable as that.

I do in fact have most of the components left, so perhaps I can go this path. The problem is however that I have no experience at all with analog radio circuits like this, so I need all help I can get with understanding how to go about this. I have found this schematic of the radio:



Can you explain what part of the circuit I need to recreate, and how I could I go about measuring the frequency  of the oscillator?
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #15 on: October 18, 2020, 12:18:45 pm »
If we are talking about L2 and/or L4, I believe I might have lost them unfortunately. As I said previously, I was completely set on replacing the whole analog circuit with stuff that I understand. Do you think there is a way of replacing those coils?
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #16 on: October 18, 2020, 12:50:15 pm »
As and aside, I've had some suggestions that I should try the simplest and most obvious solution: Charging the capacitor from an Arduino pin, and using the internal comparator to trigger the timing. I did try such a circuit now, with mixed results. It does seem to produce decent accuracy in the time measurement. However, the charge time measured seems quite sensitive to external disturbances. By just touching some of the jumper wires, I was able to get the measured time to vary by around 10%.

Anyways, I still feel a bit lost, this circuit should be very similar to the 555-based one, so perhaps any difference in results are just from random differences in the wiring of my bread board design. I feel that I really need to solder something up on perf board to really evaluate how good a method really is.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #17 on: October 18, 2020, 02:09:35 pm »
As and aside, I've had some suggestions that I should try the simplest and most obvious solution: Charging the capacitor from an Arduino pin, and using the internal comparator to trigger the timing. I did try such a circuit now, with mixed results. It does seem to produce decent accuracy in the time measurement. However, the charge time measured seems quite sensitive to external disturbances. By just touching some of the jumper wires, I was able to get the measured time to vary by around 10%.

Anyways, I still feel a bit lost, this circuit should be very similar to the 555-based one, so perhaps any difference in results are just from random differences in the wiring of my bread board design. I feel that I really need to solder something up on perf board to really evaluate how good a method really is.
Did you try the LC oscillator I suggested? It's much more stable than an RC time constant, irrespective of whether it's an oscillator, or charging the capacitor from an MCU output.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #18 on: October 18, 2020, 02:49:54 pm »
Or put the capacitor as feedback on op-amp and then give it charge packets (pulses from the arduino through a resistor).  Voltage out is then proportional to number of charge packets and inversely proportional to capacitance value.  You can either use a comparator to detect a known voltage or use a fixed number of packets and measure the voltage.   There are details like a discharge circuit to reset capacitor to known voltage, dealing with input offsets (voltage and current) on the op-amp but there is lots of material out on how to do this.  Search integrating A to D circuits.
Wow that is a cool idea. I tried breadboarding up something, and I see how it could work in theory, but I am too inexperienced with this to have a clue of how to design a half decent circuit. If you have time to make a draft of something I could try I would be super grateful, but I perfectly understand if you don't have the time.
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #19 on: October 18, 2020, 02:51:10 pm »
You would have to recreate the circuit around Q3 out to and including L4
The temperature grades of C14 and C13 would have been selected to offset ( tend to null)  thermal drift in Q3 and L4.
So they are not necessarily NPO.

But if L4 has been discarded, it might be a job to do another stable oscillator.
"Synthetic Rock" comes to mind but you can search it for VHF versions, or otherwise look for 2 metre VFO circuits.

Perhaps someone on here versed in the statistics of it, can explain why a high Q oscillator is perhaps the best way to accurately measure L & C.

I like your original idea for restoration. I have some old vacuum tube receivers I restored, in good condition.
A very early 1940's Philco FM, here woodwork looks good, but is too far gone to receive FM properly, maybe a candidate for your idea.
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #20 on: October 18, 2020, 05:22:13 pm »
Or put the capacitor as feedback on op-amp and then give it charge packets (pulses from the arduino through a resistor).  Voltage out is then proportional to number of charge packets and inversely proportional to capacitance value.  You can either use a comparator to detect a known voltage or use a fixed number of packets and measure the voltage.   There are details like a discharge circuit to reset capacitor to known voltage, dealing with input offsets (voltage and current) on the op-amp but there is lots of material out on how to do this.  Search integrating A to D circuits.
Wow that is a cool idea. I tried breadboarding up something, and I see how it could work in theory, but I am too inexperienced with this to have a clue of how to design a half decent circuit. If you have time to make a draft of something I could try I would be super grateful, but I perfectly understand if you don't have the time.

I've got other things going on so won't try to detail a design for you, but google will be your friend here.  I will also mention that you can eliminate several sources of error by adding a known reference capacitor (presumably about mid range in your variable cap) and switching between them.  Then the unknown capacitance is just the ratio of the pulses in to charge the reference capacitor to a known voltage (or the delta voltage achieved with a fixed number of pulses).
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #21 on: October 19, 2020, 12:03:46 am »
As and aside, I've had some suggestions that I should try the simplest and most obvious solution: Charging the capacitor from an Arduino pin, and using the internal comparator to trigger the timing. I did try such a circuit now, with mixed results. It does seem to produce decent accuracy in the time measurement. However, the charge time measured seems quite sensitive to external disturbances. By just touching some of the jumper wires, I was able to get the measured time to vary by around 10%.

Or put the capacitor as feedback on op-amp and then give it charge packets (pulses from the arduino through a resistor).  Voltage out is then proportional to number of charge packets and inversely proportional to capacitance value.  You can either use a comparator to detect a known voltage or use a fixed number of packets and measure the voltage.   There are details like a discharge circuit to reset capacitor to known voltage, dealing with input offsets (voltage and current) on the op-amp but there is lots of material out on how to do this.  Search integrating A to D circuits.

I think you can improve a lot the accuracy using the LTC1043 precision switched-capacitor block :  use it to charge a much bigger capacitor and count the number of cycles it needs to reach a reference voltage being a fixed fraction of the charging voltage.  This should be much easier to be made very accurate as it won't depend on the exact voltage value. The LTC1043 leakage currents are in the pA range therefore it shouldn't have problems even with very small capacitance values. The Arduino comparator will only see the big capacitor, and you can set the switching frequency high enough to make any errors due to the comparator input bias current negligible (the maximum usable frequency will be limited by the RC time constant but should still be high enough, it's getting too late here to try any calculations  :)).  To minimize external disturbances the switch and the big capacitor should be placed close to the variable capacitor being measured.
« Last Edit: October 19, 2020, 12:24:05 am by pwlps »
 

Offline MosherIV

  • Super Contributor
  • ***
  • Posts: 1526
  • Country: gb
Re: Stable and fast measurement of variable capacitor
« Reply #22 on: October 19, 2020, 08:05:50 am »
Quote
   I still feel a bit lost, this circuit should be very similar to the 555-based one, so perhaps any difference in results are just from random differences in the wiring

This is why it is unstable!

Regarding using square wave to measure capacitance  it actually measures AC impeadance.
I am not 100% certain how that us then converted into capacitance.
Need to go look up how the $20 component tester works or look up how lcr bridge works.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #23 on: October 19, 2020, 09:48:19 am »
Here is the idea of my previous post.
SW1 is a switch (any reasonably fast high isolation SPST switch, didn't have time to look what is available in my LTSpice library) to reset the measurement (discharging C2) just before starting counting.  R1,R2,R4 set the ratio charging voltage/comparator voltage, C3 is to filter power voltage fluctuations during a measurement cycle.
There is of course a tradeoff between the resolution and the measureement time (depending on the values of C2 and R4) but you can easily get a 4-digit resolution. Anyway I bet this will be orders of magnitude more accurate than any 555 crap (I hate 555s  ;D)

NB. The simulation won't work with a generic SW1, should be removed or replaced by a real one.

Edit: One question not to overlook is how the resolution of each measurement technique varies across the capacitance range.  Since the radio frequency varies like 1/sqrt(C)  the resolution on C should vary like 1/C^3/2 to get a constant resolution over the radio frequency range. In my circuit the resolution varies like 1/C but in time-constant measurements it would vary the wrong way (roughly proportional to C) making it difficult for small  capacitances.  With a 555 we should measure the frequency rather than the time constant (roughly equivalent to averaging many measurements).

Update : Today I did some simulations, see below (simulations are done with the last version capmeter2.asc, just removing the switch). The charging time even in the upper range of capacitance (I took 700pF) is below 2us so the max frequency is of order of 500kHz.
The topology of the first version wasn't optimal because the Vcomp+ reference voltage was taken from the supply of the charging pin (S1A) and was subject to spikes from the current pulses.  In the new version I just added a separate voltage divider for Vcomp+.   Even then the charging input S1A-S3A will have to be heavily decoupled  to keep Vcomp+ clean (here C5; some spikes are also present on Vss which should be decoupled too).
« Last Edit: October 23, 2020, 07:56:55 am by pwlps »
 
The following users thanked this post: kalj

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1043
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #24 on: October 19, 2020, 03:20:28 pm »
At first I thought the OP wanted to do this primarily with the hardware on an Arduino, but since the OP included fresh hardware involving 4000 family parts and the 555 I presume it's OK to suggest other new hardware.

Take a good look at the Charge Time Measurement Unit (CTMU) included in a bunch of Microchip PIC MCU's. I've used that in several designs and it's literally tailor made to do exactly what you want to do here: Measure capacitance. Everything you need in both the analog and digital domains is already on the chip, and this approach will give you the flexibility of firmware control over the entire process. It will also unburden the Arduino from requiring time-specific operations to measure C... just let the MCU handle it like it was specifically designed to do.

Once you're measuring C with the CTMU, having the MCU gives you lots of options to communicate the results to your Arduino. SPI, UART, roll your own, whatever you like.

I have successfully measured capacitance down into the low double digit picofarad range, and on the other end you can scale (dynamically in your firmware if necessary) to almost any upper value. Obviously you'll need to pay attention to layout but that's true of any method when measuring C down to ~14pF as mentioned in the first post.

In addition to the spec sheets for the MCU's that include the CTMU, there are at least two Microchip appnotes that focus specifically on it. Do a Google search. Lots of reading material and example applications to get you started. This is a one-chip answer to your question with nearly infinite flexibility.
 
The following users thanked this post: pwlps, kalj

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #25 on: October 20, 2020, 08:26:45 pm »
The circuit on the left is a Colpitts oscillator and the one on the right Hartley. U1 is an unbuffered CMOS inverter IC, i.e. pins 9 & 10 on the '4060.
https://assets.nexperia.com/documents/data-sheet/74HC_HCT4060.pdf


In the Hartley oscillator, vary C1 and make C2 much greater, than the minimum value of C1.

In the Colpitts oscillator either C1 or C2 can variable.

« Last Edit: October 20, 2020, 08:28:16 pm by Zero999 »
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #26 on: October 20, 2020, 08:31:26 pm »
https://wiki.analog.com/university/courses/electronics/electronics-lab-21
Did you try the LC oscillator I suggested? It's much more stable than an RC time constant, irrespective of whether it's an oscillator, or charging the capacitor from an MCU output.

I did start playing around with a simple LC resonance circuit, and it does look like the resonance frequency is very stable, so this method looks promising. I have ordered the CD4069UB part that is used in the page you linked.

You would have to recreate the circuit around Q3 out to and including L4
The temperature grades of C14 and C13 would have been selected to offset ( tend to null)  thermal drift in Q3 and L4.
So they are not necessarily NPO.

But if L4 has been discarded, it might be a job to do another stable oscillator.
"Synthetic Rock" comes to mind but you can search it for VHF versions, or otherwise look for 2 metre VFO circuits.

Perhaps someone on here versed in the statistics of it, can explain why a high Q oscillator is perhaps the best way to accurately measure L & C.

I like your original idea for restoration. I have some old vacuum tube receivers I restored, in good condition.
A very early 1940's Philco FM, here woodwork looks good, but is too far gone to receive FM properly, maybe a candidate for your idea.
Looked around for some of the oscillator circuits you mention, but felt that those old pieces of analog art are a bit above my understanding. Hand-winding coils and stuff seem like a very daunting task!

Yeah it feels good to give old devices new life. In this case, the radio belonged to my father in law who bought it as his first radio in his youth. Now the plan is to fix it and give it back as a Christmas present.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #27 on: October 20, 2020, 08:44:31 pm »
Here is the idea of my previous post.
SW1 is a switch (any reasonably fast high isolation SPST switch, didn't have time to look what is available in my LTSpice library) to reset the measurement (discharging C2) just before starting counting.  R1,R2,R4 set the ratio charging voltage/comparator voltage, C3 is to filter power voltage fluctuations during a measurement cycle.
There is of course a tradeoff between the resolution and the measureement time (depending on the values of C2 and R4) but you can easily get a 4-digit resolution. Anyway I bet this will be orders of magnitude more accurate than any 555 crap (I hate 555s  ;D)

NB. The simulation won't work with a generic SW1, should be removed or replaced by a real one.

Edit: One question not to overlook is how the resolution of each measurement technique varies across the capacitance range.  Since the radio frequency varies like 1/sqrt(C)  the resolution on C should vary like 1/C^3/2 to get a constant resolution over the radio frequency range. In my circuit the resolution varies like 1/C but in time-constant measurements it would vary the wrong way (roughly proportional to C) making it difficult for small  capacitances.  With a 555 we should measure the frequency rather than the time constant (roughly equivalent to averaging many measurements).

That looks very interesting. Let me see if I understand this: The LTC1043 charges the varcap, then switches over so that the varcap charges the 1µF capacitor, then switches back, etc. This process repeats until the reset switch is flipped and the 1µF cap is discharged. I can sense Vcomp- and Vcomp+ and measure the number of cycles needed to charge the big cap. Correct?

I am curious why this would be more stable than the other charge-time methods I have tried. Any idea?

Anyways, I have ordered the LTC1043 and will have a shot at your suggested circuit when it arrives.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #28 on: October 20, 2020, 08:49:45 pm »
At first I thought the OP wanted to do this primarily with the hardware on an Arduino, but since the OP included fresh hardware involving 4000 family parts and the 555 I presume it's OK to suggest other new hardware.

Take a good look at the Charge Time Measurement Unit (CTMU) included in a bunch of Microchip PIC MCU's. I've used that in several designs and it's literally tailor made to do exactly what you want to do here: Measure capacitance. Everything you need in both the analog and digital domains is already on the chip, and this approach will give you the flexibility of firmware control over the entire process. It will also unburden the Arduino from requiring time-specific operations to measure C... just let the MCU handle it like it was specifically designed to do.

Once you're measuring C with the CTMU, having the MCU gives you lots of options to communicate the results to your Arduino. SPI, UART, roll your own, whatever you like.

I have successfully measured capacitance down into the low double digit picofarad range, and on the other end you can scale (dynamically in your firmware if necessary) to almost any upper value. Obviously you'll need to pay attention to layout but that's true of any method when measuring C down to ~14pF as mentioned in the first post.

In addition to the spec sheets for the MCU's that include the CTMU, there are at least two Microchip appnotes that focus specifically on it. Do a Google search. Lots of reading material and example applications to get you started. This is a one-chip answer to your question with nearly infinite flexibility.

Thanks for the tip! It is amazing how many approaches there are to solving such a seemingly simple problem.

I am quite inexperienced with PIC MCUs though. Have always found them more complicated to work with than say the Arduino. Do you have a suggestion for a suitable - preferably cheap - PIC if I want to try out the CTMU for this simple task?
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #29 on: October 20, 2020, 09:12:34 pm »
The circuit on the left is a Colpitts oscillator and the one on the right Hartley. U1 is an unbuffered CMOS inverter IC, i.e. pins 9 & 10 on the '4060.
https://assets.nexperia.com/documents/data-sheet/74HC_HCT4060.pdf


In the Hartley oscillator, vary C1 and make C2 much greater, than the minimum value of C1.

In the Colpitts oscillator either C1 or C2 can variable.

Thanks! That looks similar to the oscillator based on CD4069 linked by Zero999 (https://wiki.analog.com/university/courses/electronics/electronics-lab-21). I have ordered the CD74HCT4060 now so I will try your circuit out once it arrives.

Anyways, what inductor type and value do you suggest for combining with my 14-680pF varcap? And are regular old ceramic caps okay, or are any other type preferable?
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1043
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #30 on: October 20, 2020, 09:55:58 pm »
I am quite inexperienced with PIC MCUs though. Have always found them more complicated to work with than say the Arduino. Do you have a suggestion for a suitable - preferably cheap - PIC if I want to try out the CTMU for this simple task?
First, be prepared for naysayers who will speak poorly of the PIC family. But they're like every other MCU out there - you select the one that is best suited for the specific application. In this case, what you're buying is the CTMU and it happens to come wrapped in a PIC. We're not focused on the purity of some CPU architecture, we're trying to get a job done!

There are quite a few PIC's with the CTMU. You can pick one using Microchip's website selectors, but take a look at the PIC18F23K22. You don't need much code space nor memory, it's available in a 28 pin PDIP package which will make breadboarding easy, etc. To get started debugging you can use their cheap PICkit3 debugger which costs like $50. That, their free compiler, and a laptop and you're ready to go. You could be testing this in a couple of hours.

EDIT: The PIC's aren't any more complex than anything else. You'll program in C, just like the Arduino, and you control the on-chip peripherals via hardware registers that have handy mnemonic names. Not hard at all.

EDIT2: Here's the link to the spec sheet: http://ww1.microchip.com/downloads/en/DeviceDoc/40001412G.pdf . The CTMU starts on page 311.
« Last Edit: October 20, 2020, 10:02:31 pm by IDEngineer »
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #31 on: October 20, 2020, 11:53:39 pm »
That looks very interesting. Let me see if I understand this: The LTC1043 charges the varcap, then switches over so that the varcap charges the 1µF capacitor, then switches back, etc. This process repeats until the reset switch is flipped and the 1µF cap is discharged. I can sense Vcomp- and Vcomp+ and measure the number of cycles needed to charge the big cap. Correct?

Yes, the process repeats until you detect that the comparator tripped, then you save the counter value and programatically close the switch to discharge the 1µF capacitor. To start a new measurement you reset the counter and reopen the switch at the same time.

I don't know the electrical and timing characteristics of arduino pins but in a first approximation you might possibly simulate the switch action (if you don't have a switch already) toggling a pin between the input (high impedance-switch open) and output (low state-switch closed) configurations.

Note that you can also provide your own clock from an arduino pin (overriding the LTC1043 internal clock, see datasheet), this gives more flexibility (e.g. the exact timing and speed of the switch will be irrelevant if you drive the clock programatically).  From my estimations you can use a clock frequency up to at least 200-300kHz (taking roughly 5 RC time constants for charging/discharging the varcap, with R being the on-state resistance of LTC1043, but double-check my estimations).


Quote
I am curious why this would be more stable than the other charge-time methods I have tried. Any idea?

I would say the most relevant difference is that the total amount of charge involved is thousands times bigger, the process is effectively averaging the measurement of charge on the varcap. However note that this is not exactly the same as averaging many charge-time measurements because there is no averaging of errors due to jitter (mathematically speaking and leaving aside the clock speed, the jitter error here scales like 1/N whereas for averaged charge-time measurements it would scale like 1/sqrt(N) (*); this "1/sqrt" behavior of jitter contribution is also found in RC-discharge based frequency generators, cf. 555 style generators).  Maybe there are other subtle points, I'm open to a discussion on this interesting question.

(*) for the math see https://en.wikipedia.org/wiki/Random_walk#Gaussian_random_walk; the total excursion varies like sqrt(N) therefore the average over N samples varies like 1/sqrt(N)
« Last Edit: October 21, 2020, 01:14:27 am by pwlps »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 12045
  • Country: us
  • DavidH
Re: Stable and fast measurement of variable capacitor
« Reply #32 on: October 21, 2020, 08:52:54 am »
An easier and more accurate way to use the LTC1043 is to configure it as a voltage-to-frequency converter, which is very simple, but with a fixed voltage so the frequency varies with the capacitance instead of voltage.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #33 on: October 21, 2020, 09:17:47 am »
An easier and more accurate way to use the LTC1043 is to configure it as a voltage-to-frequency converter, which is very simple, but with a fixed voltage so the frequency varies with the capacitance instead of voltage.

I saw this application in the datasheet and thought of it too but it's not necessarily more accurate because it is directly related to the voltage stability, you would need to add a precision voltage regulation stage. I actually preferred a circuit where the measurement result is determined by the values of passive components only and does not depend on any voltage, at least in first order.

Edit: and I don't find it easier at all, at least the circuit proposed in the datasheet is more complicated.  But it certainly depends on our personal experience with various approaches.
« Last Edit: October 21, 2020, 09:23:05 am by pwlps »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 12045
  • Country: us
  • DavidH
Re: Stable and fast measurement of variable capacitor
« Reply #34 on: October 22, 2020, 09:20:30 am »
That is right; the frequency is proportional to the capacitance *and* the voltage so a voltage reference is required and that voltage reference limits accuracy.  In practice however the variable film capacitor has a larger temperature coefficient than even an inexpensive voltage reference so the voltage reference does not limit accuracy.  Indeed, accuracy could be improved considerably by including a thermister or diode to deliberately vary the voltage slightly with temperature.

The advantage of this circuit is extreme linearity without any additional effort.  For instance there are no effects from having to periodically reset including dielectric absorption.  An LC oscillator would have the same advantage.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #35 on: October 22, 2020, 01:24:47 pm »
That is right; the frequency is proportional to the capacitance *and* the voltage so a voltage reference is required and that voltage reference limits accuracy.  In practice however the variable film capacitor has a larger temperature coefficient than even an inexpensive voltage reference so the voltage reference does not limit accuracy.  Indeed, accuracy could be improved considerably by including a thermister or diode to deliberately vary the voltage slightly with temperature.

The advantage of this circuit is extreme linearity without any additional effort.  For instance there are no effects from having to periodically reset including dielectric absorption.  An LC oscillator would have the same advantage.

I must agree with your point on the temperature drift and possibly on the effects of dielectric absorption (although I have no idea at which level of accuracy the dielectric absorption and related memory effects may become a concern, I'm curious to know if you have experience with such problems).
I also agree that an LC oscillator might be the simplest solution. Still I'm curious what the performance of my circuit would be compared to others, and apparently the OP ordered an LTC1043 already... :) 

PS. Just an additional info not related to this discussion: I updated the schematic and added some simulations in my post of oct 19.
« Last Edit: October 22, 2020, 07:18:03 pm by pwlps »
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #36 on: October 22, 2020, 01:49:33 pm »
Thanks for adding the sim traces.
As I see it, the Cvariable carries back its residual charge to S1a, so next charge is to the difference Q_c5 - Q_c2 and the staircase has smaller steps toward the end.
So accuracy might be better if V_C2 is not charged too  close to V_C5.

Why did you move reference Vcomp+ away from R3? I thought it was in a good place for overall error cancellation in your first revision.
« Last Edit: October 22, 2020, 03:01:55 pm by mag_therm »
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 12045
  • Country: us
  • DavidH
Re: Stable and fast measurement of variable capacitor
« Reply #37 on: October 22, 2020, 04:41:27 pm »
I must agree with your point on the temperature drift and possibly of the effects of dielectric absorption (although I have no idea at which level of accuracy the dielectric absorption and related memory effects may become a concern, I'm curious to know if you have experience with such problems).

Designs which continuously integrate their input have at least an order of magnitude more accuracy, but that probably does not matter here because of the limited accuracy of the variable capacitor unless its temperature coefficient is compensated.  1 part in 100,000 is possible while reset based designs have trouble even below 1 part in 10,000.

Multi-slope integrating analog-to-digital converters get around this by using "run-up" and "run-down" designs which make the integrating capacitor effectively much much larger so that its error contribution from dielectric absorption is smaller.

Quote
I also agree that an LC oscillator might be the simplest solution.

The only disadvantage of the LC oscillator is the temperature coefficient of the inductor.  Extra accuracy is available by selecting an inductor which has the opposite temperature coefficient of the variable capacitor but this can be difficult.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #38 on: October 22, 2020, 05:43:01 pm »
Why did you move reference Vcomp+ away from R3? I thought it was in a good place for overall error cancellation in your first revision.

As I explain in the update notes this is to easier and better decouple the reference comparator voltage from spikes at S1A. (I had overlooked this little potential problem and changed the circuit after I saw spikes on Vcomp+ in my simulations of the first version). There shouldn't be any difference in the error cancellation (at least as long as all resistances have the same temperature coefficient), in fact the only difference is that the current through the R1/R4 divider does not flow through R2. 
« Last Edit: October 22, 2020, 05:49:52 pm by pwlps »
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #39 on: October 22, 2020, 05:52:58 pm »
Old type shortwave receiver with a variable capacitor VFO  ( warmed up)  might typically drift by +/- 100 Hz over 24 hours when tuned to WWV @ 10 MHz.
That is "accuracy, free run /day " of +/- 1e-5

A TCXO might be spec'ed at +/- 1e-7

Usually the old coils were air cored litz wound solenoids with a  diameter of 25 to 50 mm. Larger diameter has higher Q factor.
Look at photos and circuits ( Colpitts)  of the Geloso 104 VFO which was well respected 70 years ago.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #40 on: October 22, 2020, 06:27:02 pm »
Multi-slope integrating analog-to-digital converters get around this by using "run-up" and "run-down" designs which make the integrating capacitor effectively much much larger so that its error contribution from dielectric absorption is smaller.

So it would take two more SPDT (reference and charging voltages) to implement multi-slope here.   If the OP has enough courage...  :)
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #41 on: October 22, 2020, 07:49:03 pm »
Interesting discussions on the LTC1043-based approach! I will try out some of your suggestions once I get a hold of the the chip.

Meanwhile, I have started to play around with the LC oscillator using CD4069 / 74HCT4060. I tried both the Hartley and the Colpitts types and managed to get something that seems to oscillate very solidly. I used some random 100µH coils and a 470pF ceramic capacitor, and got oscillations in the 380kHz - 1.6MHz range. However, I notice that at higher frequencies, the waveforms look less and less sine shaped, if that is a problem. Also, there seems to be an amplitude dependence on the frequency (higher frequency -> smaller amplitude). With the 74HCT4060, the damping was strong enough to not yield oscillations for the smallest capacitances.

I really feel lost concerning the ideal choice of coils and capacitors for the oscillator. If anyone has any insight and suggestions that would be very appreciated!

To determine the frequency using the Arduino, I guess I can either measure pulse lengths (accuracy decreases with frequency), or pulse counts per time unit (accuracy increases with frequency). It is an interesting question what combination of frequency range of the oscillator and measurement method produces the overall smallest noise. What do you guys think?
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #42 on: October 22, 2020, 07:55:09 pm »
To determine the frequency using the Arduino, ... or pulse counts per time unit (accuracy increases with frequency).

I just realized that if I can get the oscillator working using the 74HCT4060, I will essentially get a pulse counter for free. I.e., arduino resets 4060 counter, waits say a millisecond, then reads of the value of the counter, and then F=count/1ms. Perhaps I need to add a register to latch the counter to not get race conditions in the readings.

How about that solution?
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #43 on: October 22, 2020, 08:17:33 pm »
To determine the frequency using the Arduino, I guess I can either measure pulse lengths (accuracy decreases with frequency), or pulse counts per time unit (accuracy increases with frequency). It is an interesting question what combination of frequency range of the oscillator and measurement method produces the overall smallest noise. What do you guys think?

The standard high-resolution frequency measurement technique working at either low or high frequencies combines both counting and period measurements and is known as "reciprocal frequency counting", see eg.
https://www.instructables.com/High-Resolution-Frequency-Counter/
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #44 on: October 22, 2020, 08:41:29 pm »
There are not many hits for cmos gate LC oscillators!
In 74HC4060 data sheet ( Nexperia) Fig 13, the crystal oscillator feedback is via a 2k2 limiting resistor, which might be OK for a crystal,
but I think will reduce the Q factor (and hence accuracy) of an LC, unless C2 can be increased to be >> C_variable.
I would add a jfet and make a standard colpitts of which there are lots of examples.
The aim is to get it oscillating in the linear range without too much over-drive,
across the C_Variable's range, with a pure fundamental
by adjusting the feedback side capacitor C2 (maybe the cause of the distortion you mention)

Looks '4060  need to be safely below 20MHZ.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #45 on: October 22, 2020, 08:52:20 pm »
There are not many hits for cmos gate LC oscillators!
In 74HC4060 data sheet ( Nexperia) Fig 13, the crystal oscillator feedback is via a 2k2 limiting resistor, which might be OK for a crystal,
but I think will reduce the Q factor (and hence accuracy) of an LC, unless C2 can be increased to be >> C_variable.
I would add a jfet and make a standard colpitts of which there are lots of examples.
The aim is to get it oscillating in the linear range without too much over-drive,
across the C_Variable's range, with a pure fundamental
by adjusting the feedback side capacitor C2 (maybe the cause of the distortion you mention)

Looks '4060  need to be safely below 20MHZ.
The 74HC4060 should work as an LC oscillator. The link I posted above shows the crusty old CD4007/4069 working fine as an LC oscillator. It's not on the data sheet because it isn't something one would normally do, because an inductor is no cheaper than a crystal, or ceramic resonator, which will have far superior stability and accuracy.
https://wiki.analog.com/university/courses/electronics/electronics-lab-21

Overdrive is only an issue for a fragile crystal, which can easily be damaged by too much power. The 74HC4060 can whack an LC circuit as hard as it can without any damage. In this case a squarewave is the desired outcome so it's no problem if it goes into clipping, which is good and to be expected. The only potential issue I can see is high current draw. If the 74HC4060 draws more than 10mA or so, add a resistor between the output and LC circuit, try 100R to 1k first, to dial down the drive a little.


Try a discrete JFET if you like, but I don't see anything wrong with the MOSFETs inside the 74HC4060.

The circuit on the left is a Colpitts oscillator and the one on the right Hartley. U1 is an unbuffered CMOS inverter IC, i.e. pins 9 & 10 on the '4060.
https://assets.nexperia.com/documents/data-sheet/74HC_HCT4060.pdf


In the Hartley oscillator, vary C1 and make C2 much greater, than the minimum value of C1.

In the Colpitts oscillator either C1 or C2 can variable.

Thanks! That looks similar to the oscillator based on CD4069 linked by Zero999 (https://wiki.analog.com/university/courses/electronics/electronics-lab-21). I have ordered the CD74HCT4060 now so I will try your circuit out once it arrives.

Anyways, what inductor type and value do you suggest for combining with my 14-680pF varcap? And are regular old ceramic caps okay, or are any other type preferable?
The inductance depends on what output frequency you desire and will be divided by the counter inside the 74HC4060 (you've got the choice of 2n, where n can be from 4 to 10, or 12 to 14)  which is only guaranteed to work up to 25MHz at 5V, over the full temperature range. The inductor can't be too higher value because the resistance will be too high and its parasitic capacitance will dominate too much. You could try a common more choke, in which case the inductors will be coupled, so can be smaller, but it might be too lossy over a few MHz.

The formula to calculate the frequency for the Colpitts and Hartley oscillators can be found on Wikipedia:
https://en.wikipedia.org/wiki/Colpitts_oscillator
https://en.wikipedia.org/wiki/Hartley_oscillator

For the Colpitts oscillator, the variable capacitor can be either C1 or C2, with the fixed capacitor being around 330pF, around the middle value of the variable capacitor.

As I said, for the Hartley oscillator, C1 is the variable capacitor and C2 much greater, than the maximum value of C1, so 10nF will do, as it's much higher than 10nF.

I think the Hartley oscillator might be the better option, for this application, but try both.
« Last Edit: October 22, 2020, 09:00:24 pm by Zero999 »
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #46 on: October 22, 2020, 10:58:45 pm »
Hi Zero, Agreed, mostly.
But for an accurate LCR oscillator, the limiting condition for maintenance of oscillation, is R = 0
The active device effectively puts a negative R.
If R < 0 as you "wack a circuit as hard as it can" the LCR oscillator will drive up to a rail and will become non-linear and clip, reducing accuracy.
If R > 0 damped, the oscillation will die out , moreover before that the frequency will skew, as the DE solutions show.
There is a "oscillator maintenance equation" that allows gain selection, and allows best accuracy.

If you put a probe on a well designed oscillator, you will see the ouput level within the linear range of the active device.
« Last Edit: October 22, 2020, 11:00:27 pm by mag_therm »
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #47 on: October 22, 2020, 11:33:03 pm »
Hi Zero, Agreed, mostly.
But for an accurate LCR oscillator, the limiting condition for maintenance of oscillation, is R = 0
The active device effectively puts a negative R.
If R < 0 as you "wack a circuit as hard as it can" the LCR oscillator will drive up to a rail and will become non-linear and clip, reducing accuracy.
If R > 0 damped, the oscillation will die out , moreover before that the frequency will skew, as the DE solutions show.
There is a "oscillator maintenance equation" that allows gain selection, and allows best accuracy.

If you put a probe on a well designed oscillator, you will see the ouput level within the linear range of the active device.

R identically equal to zero is impossible to maintain in a real linear circuit (and causes an interesting startup problem if you think about it).  The gain will change slightly with temperature, aging, supply voltages and a myriad of other things.  Real and well design oscillators either have a feedback loop controlling gain, or are slightly non-linear so that effective gain is reduced as amplitude increases.
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 5582
  • Country: au
Re: Stable and fast measurement of variable capacitor
« Reply #48 on: October 23, 2020, 01:48:01 am »
If we are talking about L2 and/or L4, I believe I might have lost them unfortunately. As I said previously, I was completely set on replacing the whole analog circuit with stuff that I understand. Do you think there is a way of replacing those coils?

So  when in doubt, instead of spending a bit of time learning about analog circuitry, replace a perfectly good design with one which probably won't work as well?------Bravo!

OK, I've had my rant, here's a possible solution:-
Make or modify a rotary encoder, mount it on the capacitor shaft, read the angle it has moved through, program the Arduino to display that in frequency & all is well.
OK it entails a bit of mechanical work, but it gives you nice, clean, repeatable pulses to look at.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #49 on: October 23, 2020, 09:28:13 pm »
Hi Zero, Agreed, mostly.
But for an accurate LCR oscillator, the limiting condition for maintenance of oscillation, is R = 0
The active device effectively puts a negative R.
If R < 0 as you "wack a circuit as hard as it can" the LCR oscillator will drive up to a rail and will become non-linear and clip, reducing accuracy.
If R > 0 damped, the oscillation will die out , moreover before that the frequency will skew, as the DE solutions show.
There is a "oscillator maintenance equation" that allows gain selection, and allows best accuracy.

If you put a probe on a well designed oscillator, you will see the ouput level within the linear range of the active device.
I don't think I've every seen a nice sine wave from an oscillator made with a CMOS inverter, irrespective of the topology.

Real and well design oscillators either have a feedback loop controlling gain, or are slightly non-linear so that effective gain is reduced as amplitude increases.
Like a CMOS inverter, which has a lower gain, when the output voltage approaches either supply rail.

I plugged it into LTSpice using the HEF4007 model for the inverter with a 12V power supply and works over the 14pF to 680pF range. The Colpitts oscillator seems to require a lower ESR, than the Hartley, but it produces a better waveform, over the entire frequency range, not that it really matters.

 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #50 on: October 23, 2020, 09:39:49 pm »
So  when in doubt, instead of spending a bit of time learning about analog circuitry, replace a perfectly good design with one which probably won't work as well?------Bravo!

You can rant away all you want. I'm the first one to admit it was a great mistake to strip the original circuit. But it was many months ago and it really did look impossibly complicated to figure out what was wrong in the original circuit to me as a simple software guy. However, with all I've learned since, I would definitely have proceeded differently today.

I might look into a mechanical solution if the other approaches fail. At this point I see it as a fun project to see if I can solve it using the varcap. Besides, the stringed varcap - knob - indication display mechanism is quite complex and does definitely not seem like something which lends itself well for customization.
 

Offline vk6zgo

  • Super Contributor
  • ***
  • Posts: 5582
  • Country: au
Re: Stable and fast measurement of variable capacitor
« Reply #51 on: October 24, 2020, 02:48:25 am »
So  when in doubt, instead of spending a bit of time learning about analog circuitry, replace a perfectly good design with one which probably won't work as well?------Bravo!

You can rant away all you want. I'm the first one to admit it was a great mistake to strip the original circuit. But it was many months ago and it really did look impossibly complicated to figure out what was wrong in the original circuit to me as a simple software guy. However, with all I've learned since, I would definitely have proceeded differently today.

I might look into a mechanical solution if the other approaches fail. At this point I see it as a fun project to see if I can solve it using the varcap. Besides, the stringed varcap - knob - indication display mechanism is quite complex and does definitely not seem like something which lends itself well for customization.

If you just need the dial reading to control the completely new  radio tuning, you could still use a rotary encoder & only need to retain the shaft & bearings in the capacitor, so the dial will work.

It would, perhaps be possble to remove some of the plates of the cap, somehow fit the rotary encoder to the shaft in their place & be good to go.
This sounds fiddly, but it may, be possible, depending upon the capacitor's construction, to partially dismantle it without detaching it from the  dial cord, so you can fit the encoder directly on the shaft.
(If it is one of the sealed "polyvaricons", you may be able to do something similar, but they are quite flimsy.)

It seems to me that all the really effective ways to do what you want would end up with a substantial component of mechanical work.

One semi-electronic way, if it is possible to remove plates from the cap, would be to reduce its capacitance range, use it to "pull" a crystal oscillator, then measure the resultant frequency.
This may be more stable than a self excited oscillator, or just trying to read the capacitance.



 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1043
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #52 on: October 24, 2020, 03:19:09 am »
This is a very interesting and educational thread. But if the OP's actual goal is to measure the capacitance, why not just do so the most straightforward way: Charge with a constant current source for a known amount of time and measure the resulting voltage.

Wouldn't it be nice if there were a single chip, fully configurable solution that implemented that? Oh yeah, I already recommended it: The CTMU. And if you need more accuracy than your voltage regulator provides, add a dedicated voltage reference - another inexpensive single chip solution.

I seriously love all of the various schemes discussed herein, but it feels like we're getting rather esoteric and far afield from what the OP originally wanted to do. If his goal has changed, my apologies.
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 12045
  • Country: us
  • DavidH
Re: Stable and fast measurement of variable capacitor
« Reply #53 on: October 24, 2020, 06:43:59 am »
This is a very interesting and educational thread. But if the OP's actual goal is to measure the capacitance, why not just do so the most straightforward way: Charge with a constant current source for a known amount of time and measure the resulting voltage.

The low capacitance involved makes that more difficult than some of the alternatives.  For instance a frequency output is more easily measured than a voltage output.

Even using a current and time is not required.  Charge up a reference capacitor, which is how the charge balancing designs we have discussed work, and then redistribute charge between the reference capacitor and variable capacitor and measure the resulting voltage.  This also allows temperature compensation if the temperature coefficients of the two capacitors are matched which could be relatively easy to do.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #54 on: October 24, 2020, 01:54:18 pm »
I'm posting below the third version of my LTC1043-based capacitance meter.
This iteration follows recent discussions with David Hess, let me first shortly recall the background.
NB. I started working on this yesterday evening and I see now there have been new posts since, I apologize for not taking them into account yet.

As David Hess pointed out there is an issue regarding the stability of the reference capacitor (C2).  I looked into this and it is not easy indeed to find relatively big (1uf) capacitors having low temperature coefficients. With 500 ppm/°C or more it would be difficult to keep the required 0.1% stability over a reasonable temperature range.

 The temperature drift could in principle be compensated using a PTC /NTC combination as suggested e.g. here :
https://www.tdk-electronics.tdk.com/download/530754/480aeb04c789e45ef5bb9681513474ba/pdf-generaltechnicalinformation.pdf
but there is also a huge humidity dependence so I'm not sure it would be reliable.

On the other hand David Hess recalled that 1) voltage references are much more stable than capacitors and are cheap today, 2) integrating designs can achieve high stability.  I have built on that for my new design.

There was also a suggestion of adapting a V/F converter.  Now I found some time to look more closely at the V/F converter example in the LTC1043 datasheet, this circuit is analyzed in the AD application note

https://www.analog.com/media/en/technical-documentation/application-notes/an03f.pdf

However I'm not sure it would still be good for capacitances as low as 15pF.
If I understand it correctly, it is basically a 555-like RC-discharge design albeit using precision components.  But like with all RC designs the weak point is in the comparator (here the comparator is hidden in the LTC1043 clock circuitry). A comparator is a high-gain device and as such it highly amplifies noise and produces jitter (I already mentioned the jitter problem of RC based oscillators in my post of Oct 20).  And we can reasonably guess that the smaller the available charge to drive the comparator inputs the bigger jitter will be (*). Finally the least frequently we have to compare anything the better the performance hence the idea of accumulating charge packets in a bigger capacitor.
(*) Here the charge is amplified by the LF356 opamp but I don't think it changes the problem fundamentally, I'm open to discussion though.

With a 10pF range capacitor even a high performance V/F converter like the one suggested in the appnotes will suffer,  we either need a very high switching frequency or very large resistances and ridicously small currents.   I strongly suspect that for 10pF range the performance would drop dramatically.

For these reasons I stick to the idea of accumulating charge packets in a bigger capacitor.
Now the problem is the big capacitor is varying - no problem, just measure it!  :)  In fact it is simpler to think in terms of charge measurement.   Charge can be measured using a stable voltage reference like in integrating ADCs: set a constant current using a voltage reference and a stable resistance and measure the time to charge it to a given voltage, the integral of the current will give the charge. (Of course we still need a stable resistance but here it seems much easier than for stable capacitors).

There are two phases in the measurement.  In fact three if I count the cold startup : before the first measurement the software would discharge C2 by connecting Vcomp+ to ground and then setting S1 in the right direction depending on the sign of Vcomp- until zero-crossing on the comparator input is detected.

The first phase is the same as in the previous version:  connect the opamp input to S2A and Vcomp+ to Vref+ , then wait until comparator trips counting the number of charge packets.
In the second phase Vcomp+ is connected to ground and the opamp input to Vref- through R2, the software then measures the time to discharge C2 at a constant current Vref-/R2.
Then S1, S2 are immediately set as in the first phase and the process repeats for the next measurement.

I think using two SPDTs with a single comparator should also bring the benefit of compensating for the comparator offset, although I did not attempt to study it more deeply.
 
If N is the number of packets and T the time to discharge the capacitor then we have :
Q(C2)=N * Q(Cvariable)
Q(C2)=|Vref-| * T / R2
Q(Cvariable)=Cvariable * Vref+

giving
Cvariable=|Vref-| * T / (N * Vref+ * R2)

(NB. If Arduino has differential analog inputs the formula can be made more precise measuring the residual voltage Vcomp- - Vref+, this would improve resolution for the highest capacitance values when N is relatively small)

I'm certainly reinventing the wheel here, there are apparently dozens of patents on capacitance measurement techniques, unfortunately reading patent texts is beyond my skills  :)

I'm eager to know your opinions about this new design.
« Last Edit: October 24, 2020, 11:34:33 pm by pwlps »
 

Offline CatalinaWOW

  • Super Contributor
  • ***
  • Posts: 3823
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #55 on: October 24, 2020, 02:13:44 pm »
You might want to think about how much accuracy you need.  In the era of this radio frequency markings were a general indication where to tune, and you searched around that area until you got the station you wanted.  Easy in areas with lots of stations, sometimes a problem in large urban areas.  Today's method of entering a three or four digit number and getting the station you want was not conceivable.
 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1043
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #56 on: October 24, 2020, 02:35:51 pm »
The low capacitance involved makes that more difficult than some of the alternatives.  For instance a frequency output is more easily measured than a voltage output.

Changes in value in the single digit picofarads can be discerned with the CTMU. Even one of its appnotes openly discusses measuring changes of 10pF. The smaller the absolute value, the higher the current you select from the constant current source to yield a larger measurable charge. And you can lengthen the charge time period, too.

One of the products where I use the CTMU involves a capacitance range of ~100-300pF. That has been in continuous production for several years with many thousands of units in the field. While I don't have memorized values from my own work, one of the appnote examples describes a 500mV change from a ~10pF shift. Presuming a 10+ bit A/D, 500mV should be easily discerned.

'Nuff said. The option is available if anyone is interested.
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #57 on: October 24, 2020, 02:43:25 pm »
In post 13 I made a note about the accuracy required assuming 100 stations on Sweden.
Fortunately the frequencies are invariant.
I assume kalj will make a look up table containing the exact frequency, usually at every odd first decimal place across the band.

The capacitor read-out only has to give a pointer to select the record in the LUT.

And after this thread, I have the old radio with a free running oscillator ( AFC switched off) tuned to WKUF low power for 5 days . The frequency stay on the discriminator within a few hundred Hz all week, ( compared to the 100 kHz needed accuracy)  with the radio switched off and on every day.
So accuracy with a free running analog oscillator is not a problem.

I expect pwlps instrument will also be more than adequate.
Frequency goes by the sqrt(C), what does that do the the required error in C?
« Last Edit: October 24, 2020, 02:50:30 pm by mag_therm »
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #58 on: October 24, 2020, 04:05:46 pm »
Frequency goes by the sqrt(C), what does that do the the required error in C?

I have mentioned it in one of my previous posts, as frequency goes by 1/sqrt(C) the absolute error on C goes by 1/C^3/2 (it's just a derivative of 1/sqrt) and accordingly the relative error by sqrt(C) to have a constant error on frequency (NB. for a radio it is the absolute frequency error and not its relative error which is relevant).
The smaller is C the better the relative resolution in C is needed to keep a constant resolution in f.  This is the main problem here.

Quote
I expect pwlps instrument will also be more than adequate.

I don't expect it to be that much more adequate for the lowest capacitance range.  My estimations remain qualitative, I prefer to wait until experimental results are available  :)
« Last Edit: October 24, 2020, 05:02:53 pm by pwlps »
 

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #59 on: October 24, 2020, 06:00:16 pm »
I am re-using an old variable capacitor from FM radio ,
 on an active antenna tuner with high Q ferrites for shortwave listening ( 3 ~20 MHz.)
I noticed quite a change in minimum capacitance between prototyping on a wood breadboard, and then into the metal case.
I had to pull turns off the  medium and high freq range  inductors which is not ideal.
Next time I take it apart I will try varicap diodes.

There is a capacitance between the moving blades and nearby metal.
This increases as the blades un-mesh toward  minimum capacitance.
Here, the resonant frequency actually reduces after about 80 degrees rotation, meaning there are 2 settings that give the same resonant frequency.

I think in the real FM radios that would have been compensated by customising the dial graduations,  and  by not using the last 20 degrees or so.

Anyway, I was thinking about spin -offs of kalj's smart idea, to old radio restoration,  on the bike ride this morning.
That is, for those who still like the smooth tuning dials on the old boat anchors.
I suppose there are not many left, as the serious amateurs were going to digital frequency "appliances", more than 30 years ago.
The first digitally tuned radio I saw was the USA Navy (and NATO?) an/urt-23 which was also used by the Australian Navy from about 1969 on.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #60 on: October 25, 2020, 08:32:02 pm »
I plugged it into LTSpice using the HEF4007 model for the inverter with a 12V power supply and works over the 14pF to 680pF range. The Colpitts oscillator seems to require a lower ESR, than the Hartley, but it produces a better waveform, over the entire frequency range, not that it really matters.


Thanks for those simulation setups. I hadn't really played around with LT Spice until now, but boy was that a great tool. I tried simulating your circuit and it seems to be working great for the whole range 14pF-680pF, producing oscillations in the range 2-13Mhz which I suppose should be okay for the 74HC4060. However, as you say, it seems the Hartley one is sensitive to Rser in the inductors. In fact, using the 5V supply that I am targeting, the Hartley one needs around 9ms to get started, unless I lower the Rser of the inductors.

Speaking of the inductors, I am looking through the available ones at Mouser, and get a bit overwhelmed by all the types. I know now that DC resistance is crucial in this case. However, what else should I consider? I have heard that the Q factor (Q minimum) is of importance in oscillation circuits. For instance, how about this one with Qmin=140 and Rser=15mOhm?
 

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 16031
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Stable and fast measurement of variable capacitor
« Reply #61 on: October 25, 2020, 08:45:47 pm »
That's quite a nice Q, and it's measured at a nearby frequency (2.52MHz) so should be nice.  Is rather big though.

Shouldn't the inductors be coupled, for Hartley?

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 
The following users thanked this post: kalj

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #62 on: October 25, 2020, 09:21:34 pm »
I plugged it into LTSpice using the HEF4007 model for the inverter with a 12V power supply and works over the 14pF to 680pF range. The Colpitts oscillator seems to require a lower ESR, than the Hartley, but it produces a better waveform, over the entire frequency range, not that it really matters.


Thanks for those simulation setups. I hadn't really played around with LT Spice until now, but boy was that a great tool. I tried simulating your circuit and it seems to be working great for the whole range 14pF-680pF, producing oscillations in the range 2-13Mhz which I suppose should be okay for the 74HC4060. However, as you say, it seems the Hartley one is sensitive to Rser in the inductors. In fact, using the 5V supply that I am targeting, the Hartley one needs around 9ms to get started, unless I lower the Rser of the inductors.

Speaking of the inductors, I am looking through the available ones at Mouser, and get a bit overwhelmed by all the types. I know now that DC resistance is crucial in this case. However, what else should I consider? I have heard that the Q factor (Q minimum) is of importance in oscillation circuits. For instance, how about this one with Qmin=140 and Rser=15mOhm?
Don't take the simulation too seriously. The 74HC4060 has a much wider bandwidth than the HEF4007, so should work with a higher ESR inductor. The one you've found on Mouser appears to be suitable.

That's quite a nice Q, and it's measured at a nearby frequency (2.52MHz) so should be nice.  Is rather big though.

Shouldn't the inductors be coupled, for Hartley?

Tim
It will work with non-coupled inductors.
https://en.wikipedia.org/wiki/Hartley_oscillator
 
The following users thanked this post: kalj

Offline T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 16031
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Stable and fast measurement of variable capacitor
« Reply #63 on: October 25, 2020, 11:54:17 pm »
That's quite a nice Q, and it's measured at a nearby frequency (2.52MHz) so should be nice.  Is rather big though.

Shouldn't the inductors be coupled, for Hartley?

Tim
It will work with non-coupled inductors.
https://en.wikipedia.org/wiki/Hartley_oscillator

I know it works without.  It might work over a wider range with.

Tim
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 12045
  • Country: us
  • DavidH
Re: Stable and fast measurement of variable capacitor
« Reply #64 on: October 25, 2020, 11:56:52 pm »
Changes in value in the single digit picofarads can be discerned with the CTMU. Even one of its appnotes openly discusses measuring changes of 10pF. The smaller the absolute value, the higher the current you select from the constant current source to yield a larger measurable charge. And you can lengthen the charge time period, too.

One of the products where I use the CTMU involves a capacitance range of ~100-300pF. That has been in continuous production for several years with many thousands of units in the field. While I don't have memorized values from my own work, one of the appnote examples describes a 500mV change from a ~10pF shift. Presuming a 10+ bit A/D, 500mV should be easily discerned.

LTC1043 charge balancing voltage-to-frequency converters can easily achieve a resolution (not accuracy) of 18 bits and higher.  The best voltage-to-frequency designs perform comparably with 20 to 24 bit delta-sigma converters but the later are much less expensive now.  With a 1000 picofarad pumping capacitor, that yields a resolution of better than 0.003 picofarads and I have seen that kind of performance when tracking down linearity errors.  Accuracy is limited by temperature compensation of the capacitor which is where -120ppm/C resistors for compensating polystyrene capacitors come from.

The advantage of the CTMU is low cost and fast measurement speed.  It would be excellent in this application but not because of improved accuracy or resolution.

The LC oscillator method is also very suitable simply because that is what the radio originally used.
 
The following users thanked this post: kalj

Offline mag_therm

  • Regular Contributor
  • *
  • Posts: 124
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #65 on: October 26, 2020, 12:55:21 pm »
That's quite a nice Q, and it's measured at a nearby frequency (2.52MHz) so should be nice.  Is rather big though.

Shouldn't the inductors be coupled, for Hartley?

Tim
It will work with non-coupled inductors.
https://en.wikipedia.org/wiki/Hartley_oscillator

I know it works without.  It might work over a wider range with.

Tim
Solutions for the reactive components of the Hartley loops in the Class A case:
M is mutual inductance between the two inductors
 equations below are approximations

needed_volt_Gain_mu = [(L_o + M)/L_fb + M)]  + [resistive_loss_allowance]

F_resonant = [ 2*pi*sqrt(L_fb_ + L_o + 2*M) *C ]^-1

f_actual = F_resonant * ( 1 + resistive_components_inclusion)

Kalj will most likely use one of two choices:

Store bought separate inductors where M = 0 :
needed_volt_Gain_mu = [L_o /L_fb ]  + [resistive_loss_allowance]

A wound ferrite toroid with a feedback tap where M = sqrt(L_fb * L_o)
needed_volt_Gain_mu = [(L_o + M)/L_fb + M)]}  + [resistive_loss_allowance]

Simulator should show the above cases, and a hand calculation using the above can show that the oscillator is mostly in Class A.
That is because the tank circuit acts as a filter so the time varying output will appear sinusoidal even in Class C. 
If the oscillator runs toward Class C (meaning over-drive) , the efficiency improves, but accuracy reduces as non-linearity may be temperature dependant,
and rail voltage can have ripple etc.
« Last Edit: October 26, 2020, 12:56:57 pm by mag_therm »
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 1205
  • Country: nl
Re: Stable and fast measurement of variable capacitor
« Reply #66 on: October 26, 2020, 01:13:52 pm »
A bit of TL:DR.

The combination of a current source and a 555 is not very good for stability.
The constant current source wil be somewhat stable regardless of power supply voltage, while the 555 thresholds change with the power supply voltage.

The CC circuit will also change current with the temperature of the transistor (Vbe changes about 2-mV/degree Celcius)

Replacing the CC circuit with a simple resistor will give more stable results, as then both charge rate and threshold voltage changes cancel each other out.

Some 15+ years ago there was a popular LC meter based on a LC oscillator  made from some passives and and opamp or comparator, and a microcontroller to to measure the frequency, but it seems previous posts already suggested similar directions.

Also: Probing around with your scope probe is not the best way to get accurate results. First, simply by attaching your scope probe you change capacitances, and just the proximity of your hands, and changing position of them may change the behavior of the circuit.





 

Offline IDEngineer

  • Super Contributor
  • ***
  • Posts: 1043
  • Country: us
Re: Stable and fast measurement of variable capacitor
« Reply #67 on: October 26, 2020, 04:00:06 pm »
The advantage of the CTMU is low cost and fast measurement speed.  It would be excellent in this application but not because of improved accuracy or resolution.
Agreed, and I wasn't suggesting it would yield vastly superior accuracy or resolution. But it would be sufficient (the definition of good Engineering), and would meet the OP's criteria:

Quote
The exact capacitance is not relevant, and it does not necessarily have to be linear, but it needs to be stable with relatively low noise.... Additionally, for reasonable responsiveness, the measurement needs to be performed at least with say 10Hz rate.

The CTMU approach would give him what he asked for in a one-chip solution, plus give him significant flexibility in its control and behavior via firmware (on that same single chip). There are many possible solutions to this challenge (as evidenced by this thread) but so far the CTMU is the simplest, most straightforward, and most flexible given the OP's original criteria. Some of the other proposals herein are definitely more technically interesting and I'd love to pursue them for the personal enrichment, but I'm trying to keep my eyes on the OP's original plan without creeping featurism.
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #68 on: November 04, 2020, 07:57:11 pm »
I have been busy with other things, but finally now got the chance to look into this. I've built two circuits with a Hartley and a Colpitts oscillator respectively. In both cases, the component values in the simulation by Zero999 have been used, except for C1 in the Colpitts oscillator which was chosen as 1nF to increase the frequency range. I also added 100nF decoupling capacitors to both circuits. The IC is the CD74HCT4060E.

In both cases I get good oscillations in the 1-5MHz range, and the counter outputs are toggling correspondingly. However, in both cases the oscillation amplitude decreases sharply with high frequency / decreasing capacitance, to the extent that for the last 20% of the varcap the oscillations are to small to correctly trigger the counter.

To see if this was due to a too high frequency, I tried increasing the inductance in the Colpits oscillator, to 100µH instead of 10µH. The frequency was lowered as expected, but the amplitude attenuation seemed to behave the same, with oscillations dying out at the same capacitance.

Any clue what might be causing this problem? Can it be that 14pF is too low a value compared to the ESR of the circuit?
 

Online Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 1205
  • Country: nl
Re: Stable and fast measurement of variable capacitor
« Reply #69 on: November 06, 2020, 04:27:08 pm »
Why not simply build an oscillator with a 555?
 

Offline kalj

  • Contributor
  • Posts: 27
  • Country: se
Re: Stable and fast measurement of variable capacitor
« Reply #70 on: November 06, 2020, 05:50:41 pm »
Why not simply build an oscillator with a 555?
You didn't read the first post did you?
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 320
  • Country: fr
Re: Stable and fast measurement of variable capacitor
« Reply #71 on: November 06, 2020, 05:55:25 pm »
Why not simply build an oscillator with a 555?

It has apparently been built already, see post #1. 

Quote
Replacing the CC circuit with a simple resistor will give more stable results, as then both charge rate and threshold voltage changes cancel each other out.
Which CC circuit ?
« Last Edit: November 06, 2020, 05:57:26 pm by pwlps »
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 14681
  • Country: gb
  • 0999
Re: Stable and fast measurement of variable capacitor
« Reply #72 on: November 07, 2020, 12:43:24 pm »
That's quite a nice Q, and it's measured at a nearby frequency (2.52MHz) so should be nice.  Is rather big though.

Shouldn't the inductors be coupled, for Hartley?

Tim
It will work with non-coupled inductors.
https://en.wikipedia.org/wiki/Hartley_oscillator

I know it works without.  It might work over a wider range with.

Tim
Yes, coupled inductors would be better. A common mode choke could be used.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf