170KHz LC Oscillator vs Plain BNC Anomaly. Please Help. - Page 1
Forum section: electronics / beginners

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 10:08:18 am
content: Houston! or anybody out there... this is another sequel fromHigh-precision L/C Inductance Capacitance meter Designi was playing around with LC Oscillator using LM393. Original design from the above thread is using LM311, but i dont have. Long story short, i managed to get it oscillating at the comparator's output.below is the circuit diagram. black colored is original design i copied from the thread, i add the red colored, 2 X 100KOhm so i can get half volt divider (6V from 12V supply) so i can feed node 1 and 2 (balanced between +ve and -ve) to my frequency counter and counted correctly (Hantek 3x25 frequency counter only count on zero crossing signal, afaik), node 1 goes to +ve, node 2 goes to -ve.whats buggering me is dso reading at far below (bottom left and right), pls note i've indicate in red text how i connect my dso probe to the circuit (+ve probe, -ve probe) to get the reading. not so much annoying on the left, just a little bit of distortion. the most annoying is the bottom right (out of 4 graph figure), the amplitude goes down from 10Vpp to 5Vpp (half). it happened when i introduce BNC connector at node 1 and 2. the BNC is not connected yet to anything, its just hanging there, but it sucking the voltage down. the BNC is not terminated and continuity and resistive DMM check indicates its just open circuit (+ve and -ve wire).i know we've discussed on BNC performance at various frequency in this threadHow to Better Wire the BNC Connector and GHz issue, but come on, this is just 170KHz circuit, hardly touching MHz mark, how bad can a BNC connector be to a KHz circuit. or maybe there is something else causing this? fyi, the real bugger is the BNC cable (BNC3), it sucks the volt most (from air!), BNC1 and BNC2 only attenuate the signal a little bit.Any explanation?

author: deephaven
author_rank: Frequent Contributor
timestamp: April 14, 2011, 10:23:42 am
content: the 2 X 100K give you quite a high impedance of 50K which means at 170KHz you won't need much stray capacitance to affect the mesurement. Either make the 2 X 100K a lot smaller or put a capacitor (say 100n) across the bottom 100K to lower the impedance at 170KHz.

author: tnt
author_rank: Regular Contributor
timestamp: April 14, 2011, 10:25:12 am
content: That cable represents a capacitance, probably around 50-100 pF from the length.The potential at 1 is probably always the same, what changes is the potential at 2.The node 2 has a 50k impedance so with the cable capacitance (lets say 50p), it makes a 60 kHz low pass filter ...

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 10:46:07 am
content: thanx guys. i'll try to digest (calculate) that later. further test, i connected it to freq counter. it only count correctly when i put the dso probe at the same node as bnc. when i move dso probe to 1-G (FC remains at 1-2), the FC does not count anymore, and the dso read back as the top left picture. 12V draw 6mA, and this thing is unstable as touching my finger on the +ve battery will change the graph from left to the right side of the graph below! sigh

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 10:53:41 am
content: Quote from: deephaven on April 14, 2011, 10:23:42 ami'm afraid this solution will draw more current from the battery, makes it less energy efficient circuit. thanx for the 100nF advice.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 10:58:23 am
content: Quote from: tnt on April 14, 2011, 10:25:12 amyou got it backward. node 2 is near constant at 6V, node 1 is the one who oscillating.

author: deephaven
author_rank: Frequent Contributor
timestamp: April 14, 2011, 11:01:10 am
content: You should have a decoupling capacitor (say another 100n) between +12V and 0V.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 12:01:53 pm
content: well, using 0.1uF from 12V to gnd didnt help, but bypassing it from node 2 to gnd improved the stability. still i dont get the science (logic) of it. until i get the answer, this issue will be left in my x-file for later investigation. thanx guys esp deephaven on this. time to carry on.ps: and another thing. i cannot probe with dso node 1-G at the same time my frequency counter is counting node 1-2, since the FC and DSO's ground are tied together to the house's ground. doing so seems to clash the dso ground (0V) and fc ground (6V) unabling the fc to count correctly. i think this is where bench/handheld measurement unit excel.or maybe this is just a crappy, crash coursed, not so brilliant circuit

author: deephaven
author_rank: Frequent Contributor
timestamp: April 14, 2011, 12:34:20 pm
content: You could always AC couple the output of your circuit to your counter. You could make sure you are getting enough signal to the counter by probing the counter side of the capacitor with your scope. No need for the 100Ks then.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 12:41:37 pm
content: well, i have another sequel earlier right?Please Help High Pass RC Filter. why dont i implement the bad experience i had earlier. it turned out they put together to a piece nicely. with the mod below, i can bring the both's ground back to common. hooray! and then it proved that a tool is just a tool, practical experience excel! funny me just talking to myself@deephaven: thanx buddy, you always made a good helpbut my FC is cheapo one, no AC coupling feature.

author: saturation
author_rank: Super Contributor
timestamp: April 14, 2011, 12:52:23 pm
content: No matter what open BNC cable you attach the output should not change, particularly at 170kHz. At higher frequencies it might radiate like an antenna. Since there is a different between 1/3 cables, the problem is that cable.The output of LM393 is at node 1. If you want to reduce the amplitude you can put the 100K resistor voltage divider from node 1 to ground not from V+ to ground.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 01:01:11 pm
content: Quote from: saturation on April 14, 2011, 12:52:23 pmthe problem is LM393 is outputting0-Vs(worst its some +ve low to 12V) which our hantek cannot count the frequency. myintentionwas to bring the output down to-Vs/2 to +Vs/2ie -6 to 6V, hence i tried to simulate ground at 6V for 3x25, which didnt mate properly when the dso -ve probe touches the real ground (G) of the circuit. but the 1st circuit above is still a mystery. lets leave that mystery alone. i've found the solution.maybe i just need someone to talk to

author: tnt
author_rank: Regular Contributor
timestamp: April 14, 2011, 01:01:30 pm
content: Quote from: Mechatrommer on April 14, 2011, 10:58:23 amNo ... the your node 1 is fine. It's oscillating of course but it's amplitude (Vpp) will not change wether the BNC is plugged or not.But since 'node 2' is not a real hard 'ground' but some voltage divider with a big impedance, you're making it move by AC coupling it with a 100 pF capacitor (the BNC cable). Since it now 'moves' with node 1, the potential difference between 1 - 2 is now reduced ...

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 14, 2011, 01:10:05 pm
content: Quote from: tnt on April 14, 2011, 01:01:30 pmyeah i think i get the picture more clearer right now. its like putting a low value caps directly between 1-2, just like my latest circuit above, and the whole thing (bottom part of 100K Ohm and the rest on the left side) got into parallel and screwing my "wrongly thought voltage divider". Thanx tnt for taking care explaining.

author: Zad
author_rank: Super Contributor
timestamp: April 16, 2011, 06:05:32 pm
content: Rather than use an op-amp, have you tried using a 555? That seems to be quite a common method that is fairly precise. I keep meaning to write it up for my blog.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 27, 2011, 03:12:31 am
content: still at it and it seems that i'm stuck in this curse. now my circuit is like below. the problem is... the frequency its oscillating is unstable (increasing), its like from the formula f = 1 / 2pi.sqrt(LC) that the C is decreasing. and waiting it to stabilize will take ages, its now 526KHz, it was 523KHz or something minutes ago (few Hz every second). i've tried changing capacitors value, put the circuit in metal box (Faraday cage? bought the Vochelle's. the chocolate went to the wife, and the metal box went to this circuit) but still no success. why i'm so unfortunate to get this curse?edit: this increasing freq trend is worsen when i connect my frequency counter to it. connecting to only dso, the frequency seems to jump up and down, but still incresing at slower rate.

author: tecman
author_rank: Frequent Contributor
timestamp: April 27, 2011, 01:58:19 pm
content: One likely culprit is temperature. Most caps have a temperature coefficient. Caps that are designated as NPO have little to no temp drift. Others have temp drift that can be significant. The inductor also will have a tem component due to the magnetic materials, construction, etc. Some caps are made with tempcos to match various inductors. They may be N150 or another designation, indicating the amount of change. I bvelieve that the number indicates parts per million per degree C, with N for negative and P for positive. Inductors will have a corresponding, and opposite, tempco.Some caps also have a voltage dependent change in capacitance. Last is aging, which will also add some drift as well as effects of humidity. Also be aware with your relatively small cap value, stray capacitance's in the layout will have an effect as well, and may vary.Nothing is perfect, but more money can buy better components.paul

author: vk6zgo
author_rank: Super Contributor
timestamp: April 27, 2011, 04:21:03 pm
content: Quote from: Mechatrommer on April 27, 2011, 03:12:31 amHi,Safri,Am I correct in assuming the frequency was stable when you were chasing your original problem?If so,what have you changed since then?The only thing I can think of,is the introduction of the coupling capacitor.Op amps like to go into spurious oscillation when they have a capacitive load,so you may have two forms of oscillation occurring at the same time.The frequency jumping up & down tends to point to this,where you can get mixing products between the two frequencies.I suggest you remove the frequency determining components so the oscillator should stop working,then see if you can still see anything at the output.Have you tried the counter input of the Hantek connected directly to the output pin of the IC,or have you only assumed that it will not read correctly?The online manual shows the input marked as capable of 18v p-p,so the voltage divider idea was not necessary to begin with,& maybe also the coupling capacitor.If the coupling capacitor is the culprit in your present problem,& you want to keep it in circuit,try placing a 200 ohm (or around about that value) resistor in series with the cap (on the Op amp side of the cap).This fixed a differential amplifier which was spuriously oscillating at around 38kHz in what was supposed to be a dc control circuit!Cheers,VK6ZGO

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 27, 2011, 05:29:08 pm
content: i think tecman is correct about the temperature. i closely look more detail into it. switch OFF the fan, close all window, put back the thing inside its Faraday cage, it seems to stabilize, but still oscillating. o well, maybe i was expecting too much, thanx for the advice guys. fyi: i'm using ceramic (smd) capacitor in the LC tank, maybe that little guy too sensitive to the cold.

author: vk6zgo
author_rank: Super Contributor
timestamp: April 29, 2011, 03:01:33 pm
content: Sorry,my mistake,I didn't notice that you had changed the L to 100uH.From the frequency formula, this should give you a frequency of 503 kHz,but you are getting 526kHz,so it is about 1.045 times the calculated figure.With your original value of L,the formula gives about 159 kHz,but looking at your original DSO pix,your frequency varies from around 172to173.6 kHz or thereabouts (According to your Rigol).Proportionally to your frequency,this is about the same amount of variation.You are right about the ceramic cap,these vary in value with temperature,&are not the most stable things to use in an oscillator.Try a mica cap if you can findone,or a polystyrene.MKT caps are quite stable,too.Do you have access to a RS Components catalogue? You can get a good idea of the temperature stability of various caps from these catalogues.VK6ZGO

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 29, 2011, 07:36:23 pm
content: yes, i'm studying on caps variety now, even watch back the Dave's old vids on that, now i know how much precious it is more than before. and i figured out something (maybe flawed) in this LC opamp/comparator oscillator concept. its seem like ESL sneeking in and i cannot measure C value (frequency) accurately among types of caps, and i doubt the resonance formula is like stated (on other links) still studying. more likely i'll just "mythbusted" this design. almost make a lengthy success conclusion on this, but thanx gosh, i figured it out before i got embarassed.but the good thing, i learnt alot doing this, from caps, L, LC resonance, ESR. ESL etc.it seems clearer why people tend to advice to buy more appropriate device (LC Meter) and dont have to deal with this mess, have a good night sleep etc. but measuring LC down to pF and nH is something not easily be found. if any suggestion with reasonable price, i will appreciate it. have to look/dig back the old threadand thank you vik'six'zee'gofor your advice. dont be sorry, i know you mean well at advising. we all do make mistake. Cheers

author: tecman
author_rank: Frequent Contributor
timestamp: April 29, 2011, 08:04:24 pm
content: Mechatrommer:If you want stability, you must find components that are temp stable. Ceramic caps are fine, but you must use NPO tempco rated caps, if the inductor is stable. Most inductors are not. Especially power inductors, which is most of what you find in catalogs. If you look at cores,http://www.mag-inc.com/products/ferrite-cores/ferrite-pot-coresyou will see in the ferrite info that there is a well defined temperature effect. For most materials, there are corresponding caps, such as N50, N100 and N150 caps that have negative tempcos to compensate for the core. (in a former life I worked for a company that made filters) Using the right pair, very temperature stable L-C circuits can be made. You will end up winding your own inductor, but that is easy. Other caps will work as well, but watchg some of the foil/film parts that have relatively high ESL. Stacked micas are both stable and low ESL, but expensive and tend to be large.For experimenting, you should not worry. If you need to make something, then more careful design and parts selection is required if you need accuracy and stability.paul

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 29, 2011, 08:42:25 pm
content: i can get stable and repeatable measurement of the C value all right. the problem is when i changed capacitor type to be used as Ccal (which is supposed to be silvered mica)... The photo below they are all 1uF measured with my Uni-T DMM, but the two on the left are the enemy of the two on the right. I mean, when i put the big brown cap as Ccal (refer to latest circuit above), it cannot measure the 1uF electrolytic cap correctly, ie only half the value (500nF) and its pretty consistent, the only way i can measure electrolytic correctly is by putting the same type electrolytic as Ccal, but then it cannot measure the big brown type correctly (read something like 2uF). I measure the ESR using poor man's method, they are roughly the same 7-8 Ohms (dont ask, they are all a bunch of cheapo and ripped off an old board stock). So something's telling me, either i miss something about:1) ESL, which i dont have a tool to measure. or...2) resonance is not 1/2pi*sqrt(LC) as advertisedi tried to find concrete mathematic prove of the circuit in the net and book, i cannot find. The only acceptable LC oscillator are Hartley and Colpitt's type.correction: the green one (poly?) in the picture is not the 1uF, i picked up the wrong caps, but the 1uF green one is there lying somewhere in the mess.

author: tecman
author_rank: Frequent Contributor
timestamp: April 29, 2011, 09:54:47 pm
content: The big cap could be a mica, but it looks more like a film, mylar or polyester. The electrolytic should never be used for an oscillator. They have horrible tolerance and worse temp drift. I have seen published tolerances of -50%~+100%. The smd ceramic is likely a common X7R with again bad drift and tolerance.These are all 1uf. Your circuit shows 1000pf. Big difference !paul

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 30, 2011, 12:31:38 am
content: Quote from: tecman on April 29, 2011, 09:54:47 pmdont count on that. mylar or poly could be it. its even used in mains section of a cheapo pc psu if i'm not mistaken. just pick random stock for now to look how the design goes. i dont think C drift is a big problem now (its managable), the real problem is already stated 2 points above. below is some example how this thing oscillating (report from frequency counter to pc). on the left is very steady but keep increasing freq drift i was talking about, with controlled temperature and cabling setup, i can get that moving down a bit. i prefer on the right side, even though random, but its within range so i can pick visually where the average frequency is. i guess whoever dealt with this will look the random graph familiar.

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 30, 2011, 12:38:04 am
content: or let me just put the whole story here in 1K worth of words...

author: vk6zgo
author_rank: Super Contributor
timestamp: April 30, 2011, 04:28:53 am
content: The green & brown caps are polyester.Don’t use the electrolytic, they are notoriously inaccurate in value, plus they are lossy (ESR).I am a bit puzzled by your last posting, but looking back to the one on 26 April, if you calculate thevalue of the C, assuming the L is correct from: - fr=1/2pi sqrt LC, for f=526kHz, the cap comes out as 915.52pf, which is within 10% of the nominal value, &assuming C is correct, that L is 91.552uH, again within 10%.As capacitors & inductors are not specified to better that, you have done well!Real components don’t behave quite the same as the perfect versions of theory, for instance, inductors have capacitance between the adjacent turns, as wellas series resistance.All real components exhibit stray capacitance to earth & other circuit parts.Even resistors, which are easy to test at dc, don’t look quite the same at 500KHz, & are even more unlike the dc model at, say, 50MHz.VK6ZGO

author: Mechatrommer
author_rank: Super Contributor
timestamp: April 30, 2011, 06:59:59 am
content: Quote from: vk6zgo on April 30, 2011, 04:28:53 amnot until i changed capacitor type. and it was suppose to be 1nF and 100uH, but during calibration, it calculated as 0.9++ - 1++ nF and ~87uH, the inductor is off by 13%, i dont know, after latest mod with 442pF (470?), it read wrongly as 2pF (latest picture), but L stays at 87uH, its puzzling i kind of lose track already about the value and mod shown above, still working on it. i got no issue with inductance measurement so far, only variety of type of caps gave inconsistent/conflict reading. My next stop will be to look closely at capacitor and inductor model, and study that. I'll put this circuit on hold until i got stronger background knowledge. Trust me, its more puzzling than it may seems, not a simple words can describe that. The day i'm satisfied with it, the next day i figure out another problem, as Dave said, hopefully your project wont work the first time.