Small AM peak variation into large DC swing - Page 1
Forum section: electronics / general

author: ricko_uk
author_rank: Super Contributor
timestamp: December 04, 2019, 01:37:09 am
content: Hi,With reference to the attached picture, I have a 200KHz input AC signal centred around 2.5V and the variation of its amplitude is the information I am trying to extract with lots of accuracy/range. In other words the output needs to be a DC signal swinging between 0.5 V and 4.5 V each of such limits corresponding respectively to the minimum and the maximum swing of the positive peaks of the AC signal.The AC signal's positive peaks vary between 4.0 V and 4.1 V and that 0.1V peak's variation needs to be converted into a DC signal varying between 0.5 and 4.5 V. The DC output is not truly a DC signal but almost as it is sampled only at 20Hz maximum.The main requirements are low noise and good precision/stability.What is the best way to implement it?Many thanks in advance

author: DaJMasta
author_rank: Super Contributor
timestamp: December 04, 2019, 04:49:52 am
content: A DC blocking cap, a diode with a forward drop of 1.5V, a capacitor, and a transistor amplifier?An opamp configured as an envelope detector going into a comparator?Do you need frequency discrimination or any other output states?Sounds like you need some type of detector and an integrator, then a level shifter to get whatever logic level you want on the output, and I think there are quite a few ways to do it. What kind of precision/stability do you need?

author: bob91343
author_rank: Super Contributor
timestamp: December 04, 2019, 06:53:00 am
content: I was thinking that an ADC (analog to digital converter) could digitize the signal to any accuracy. Then you could examine the bits of interest.A precision voltage source could be adjusted to match the peak of the wave and then the wave could be clipped considerably to a small peak to peak value. Then differential measurement might be easier.These are two solutions that occur to me.

author: Ian.M
author_rank: Super Contributor
timestamp: December 04, 2019, 09:28:37 am
content: I think whatever you do its going to be fairly fugly. In the Analog domain a 200KHz carrier is too fast for OPAMP precision rectifier circuits to work well, so one is reduced to abusing RF ICs, DC coupling them and trimming out offsets to build a linear detector with bandwidth down to DC.Here's a fairly fugly idea that I have put together a LTspice sim for using an Analog DevicesAD630Balanced Modulator/Demodulator as a precision rectifier, then scaling and offsetting the output with an OPAMP to get it somewhere near the desired range. Don't expect it to run quickly - its got 600 cycles of the carrier to simulate! It also needs to get to a reasonable steady state before it will give a valid output - that's the first 100 cycles.There are almost certainly better ICs for the job than the AD630, as that was simply the first one I found with a decent SPICE model.Precision? Stability?That will depend on how carefully you build and trim it, and whether or not you decide to ovenize the AD630.Its probably viable for a one off, but if you are contemplating volume production you'd be certifiably crazy to go down this road!

author: ricko_uk
author_rank: Super Contributor
timestamp: December 04, 2019, 03:18:04 pm
content: Thank you Ian for the info and for having gone through the trouble of running a simulation!!!And thank you all for your repliesAll useful and gave me few things to try!Ian,the AD630 is not readily available and is not recommended for new designs. Your solution looks like it uses only a small part of the IC.1) Is that some sort of lock-in amplifier or demodulator? I'm not familiar with that area of electronics (more of a embedded systems guy...). What is it and what is it called, so I can learn more about it?2) What other parts can I use? Could you be so kind as to suggest some part numbers suitable? Some which are more readily available and not as expensive (we would have 24 of them in each system...)3) You mention precision and stability might be achieve depending on "whether or not you decide to ovenize the AD630" and might not be viable for production. We do need it for production...So I would really appreciate any pointers to make it suitable for production. We do have a micro and the system needs to be calibrated EVERY TIME it is switched on. The user places it into a controlled target environment and presses the calibrate button (BTW the system is used a maximum of 8-hours before being switched off again). So we can have the micro controlling some pots or other systems/ways for self calibration? Would that help? If so how?Many thanks again for all help!!

author: Alex Nikitin
author_rank: Super Contributor
timestamp: December 04, 2019, 03:52:33 pm
content: Have a look at the OPA698 datasheet, pages 17-18, possibly also the OPA699, page 18.CheersAlex

author: Kleinstein
author_rank: Super Contributor
timestamp: December 04, 2019, 04:40:44 pm
content: The AD630 is doing phase sensitive detection, just a lock in amplifier does. However Analog multipliers tend to show quite some drift.For highest stability is may be better to use a more switching type mixer (e.g. CMOS switching or classical diode ring type, maybe other mixer chips like MC1496).For 200 kHz the digital sampling method is also very realistic. With sufficient averaging even a 12 Bit ADC as found in µCs could be sufficient. Some of the STM32 have 2 such ADCs and could be sufficient for 2 channels. For the math it may help if the excitation signal is also generated by the µC, so the µC "knows" the phase.

author: IconicPCB
author_rank: Super Contributor
timestamp: December 04, 2019, 10:16:53 pm
content: IN absence of AD630 try a conventional CD4066 analog switch as per Kleinsteins suggestion.Be aware the post detection amplifier should incorporate the same switch elements within the gain setting resistor network to compensate for the sampling switch arrangement.This arrangement is also phase sensitive, that is phase between clocking signal and signal in question.Experiment with variants of CD4066 in that there are higher performing logic families with lower switch drain source ON resistance ( a more ideal switch).

author: maxwell3e10
author_rank: Frequent Contributor
timestamp: December 04, 2019, 10:52:53 pm
content: If you care specifically about the height of only positive peaks, you could use a comparator, whose output charges a capacitor. The capacitor is also used as the "-" input of the comparator and has a large resistor to ground. The idea is that the voltage on the capacitor will float up until it gets only very short bursts of charge from the top of the peaks. That DC level can be shifted and amplified to the desired output range.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 12:07:24 am
content: Thank you MaxwellWith your solution I assume you also would have a diode forward biased between the comparator output and the capacitor "positive/top" terminal to prevent discharging the cap? Like in a precision peak detector with op-amp?If so, what is the advantage of using the comparator apart from lower cost? Is it better/faster? Would the capacitor voltage be as accurate as with an op-amp precision op-amp?

author: maxwell3e10
author_rank: Frequent Contributor
timestamp: December 05, 2019, 12:37:18 am
content: Yes, one would need a diode or use an open-emitter comparator output. It should be easy to find a comparator that is fast enough. There are no diode drops to deal with, the stability would be given by comparator voltage offset specification. By playing with the size of the capacitor and drain resistor one can set the bandwidth of the circuit. Here is something similarhttps://www.edn.com/design/analog/4347624/High-speed-peak-detector-uses-ECL-comparator

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 12:52:42 am
content: Thank you Maxwell,with the diode I agree. But without a diode and only with an open collector I am not sure how that would work. Wouldn't the capacitor be discharged immediately? In other words without the diode would it not just follow the input?

author: maxwell3e10
author_rank: Frequent Contributor
timestamp: December 05, 2019, 12:57:02 am
content: open-emittercomparator output.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 02:05:39 am
content: oops... in the rush I "read" collector instead of emitter. The fact that here it is 2 a.m. doesn't help

author: Kleinstein
author_rank: Super Contributor
timestamp: December 05, 2019, 07:00:14 pm
content: Using only the peak voltage is rather prone to noise and also shifts in the DC level. The phase sensitive measurement is usually the more stable and lower noise one. Here it looks like a good reference signal is available from the excitation of the bridge.To day it is more like the question between analog phase sensitive detection or direct digitizing and phase sensitive detection in software.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 08:37:29 pm
content: Thank you Kleinstein,following your previous post I ordered some MC1496 and received them this afternoon.But now I am not sure how to connect it (not really familiar about phase detection). And the datasheet does not even have the pin name/description nor the internal diagram (I could only find one datasheet from On Semi - attached below).I only have the schematic that Ian kindly simulated few days ago (see attached screenshot and previous post from him) and not sure how to connect the MC1496.Any help would be much appreciated as that seems the best solution but am pretty much stuck with it not knowing how to connect it.Could anybody suggest how to wire it up for this specific application?

author: Ian.M
author_rank: Super Contributor
timestamp: December 05, 2019, 11:01:20 pm
content: Its going to be somewhat like a hybrid of the MC1496 datasheet Figure 28. Product Detector(12 Vdc Single Supply) and Figure 30. Low Frequency Doubler. Model the latter and see what you get, then try to hack in the output circuit from fig. 28, but DC coupled. Note the comments in the section 'Product Detector' (page 8 ) especially the last two paragraphs.I'll attach the LTspice MC1496 model, symbol and test circuit from the old Yahoo group files area contributed by Helmut Sennewald back in 2005 so you've got something to start from. I've confirmed his test circuit gives what looks like a full wave rectified output with both inputs set to 200KHz, levels left as per originalI'm not convinced it will be any better than the AD630 version, but at least the MC1496 is readily available and cheaper than chips (food)!

author: ricko_uk
author_rank: Super Contributor
timestamp: December 05, 2019, 11:57:06 pm
content: Thank you again Ian!!!!I read through the datsheet and especially those paragraphs you mentioned.I noticed that it is driven from 12V (in both the schematic you shared and the datasheet). Can I drive it form 5V or does it need a higher voltage?Also there is -8V on pin 14 (on the schematic you shared and also on Figure 30 - page 10). But it is connected to GND on Figure page 29 (page 9 of the datasheet). I could not find an explenation. Can I connect pin 14 to GND or -5 V instead of -8V?If I can make any of the above changes, what components do I need to tweak?Many thanks again!

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2019, 12:50:16 am
content: There's no real hope of running it from a 5V supply.Quote from: Datasheet page 4and see Figure 23. Circuit Schematic for its internals, which will show you its got basically three 'layers' of transistors stacked E to C between its outputs (which get pulled up to Vcc) and its negative supply Vee (pin 14). That's a minimum of 6V with no headroom for signals. Practically you'd probably want at least 9V between Vcc and Vee, which should be enough for small signals.As a first step towards getting rid of the negative supply, edit Helmut's test circuit so it looks like fig. 28, apart from the outputs on pins 6 and 12 which should remain the same apart from changing the pullups to 3K.After you've done that, try reducing the supply V1 to 10v to see if its going to be possible to use +/-5V rails. Some changes to the 1K3-820R-1K bias resistor ladder may be required.You'll also need to copy in my modulated signal source from the AD630 sim and add a resistor ladder attenuator with two taps to get suitable levels to feed to fig. 28.

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2019, 02:10:17 pm
content: Well I had some spare time so I've roughed out the MC1496 sim for you.Requires: Helmut Sennewald's model & symbol from reply#16MC1496.zipToDo:Check all bias voltages against the equations and constraints on page 4 of the datasheet.Try to increase signal levels and/or MC1496 gain to reduce required OPAMP gain.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 06, 2019, 03:05:58 pm
content: Thank you Ian for all this help, I really appreciate it!!!I ran the simulation in LTspice (not much experience with it) and I get the output shown in the screenshot attached. It looks it works VERY nicely!Apologies for the silly question, but I noticed that the supply in the simulation is -5V and +5V. Does that mean it works with +/-5V or is that perhaps some limitation of the model that perhaps simulates the functionality but does not "check" the voltage ranges?Thank you

author: Ian.M
author_rank: Super Contributor
timestamp: December 06, 2019, 03:15:00 pm
content: I did quite a lot of tweaking of the OPAMP's feedback resistor, and bias voltage on its +in to get it within your required output range. It will probably need autocalibration using digipots, with an on-board test signal fed into the MC1496 to make it usable for production.Quote from: ricko_ukMaybe yes, maybe no. I haven't reverse engineered the model netlist to see whether its behavioral or component level. Even if its component level there's no guarantee that it accurately matches actual silicon, and as I commented, the MC1496 bias voltages etc. all need careful checking.Also note its quite a heavy load on the signal source, which will probably need buffering if it cant drive +/-10mA with negligible loss of amplitude.

author: Ian.M
author_rank: Super Contributor
timestamp: December 07, 2019, 10:49:45 am
content: If you can transformer couple the input it would get a lot easier to design an AM detector that is easy to trim to the desired range and offset and to keep stably calibrated.It requires a 1:1:1 coupling transformer, then uses a small signal Schottky diode full wave bridge to get the + and - envelopes, filters them, then amplifies them differentialy to cancel common mode noise (with some offset to keep the signals between the rails). It then uses a final gain stage to get the required range and offset trimmed by digipots.The offset shifts considerably with temperature due to the varying diode Vf, so you'll need enough trim range for the worst case operating temperature range and probably need a temperature sensor so you can use a calibration table to correct for temperature changes during a run. The amplitude will be a lot more stable.It needs a single clean +5V supply and a rail splitter to get Vcc/2 of 2.5V to bias the amplifiers. Use a dual RRIO single supply OPAMP for U1,U2.Depending on the transformer you use you may need to decrease C1 and add a 10R resistor in series for damping to avoid excessive transient ringing at powerup.TT Electronics HM42-40002LFlooks like a likely candidate.Adjust the inductance and resistance of the sim's L1, L2, L3 for your choice of transformer and adjust the coupling factor in the K statement to model the leakage inductance.Complete LTspice sim attached.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 07, 2019, 09:20:32 pm
content: Thank you sooo much Ian! I REALLY appreciate all this suggestions and simulations!!!Today I have been playing with the previous solution but this looks like an even better one! I have ordered the transformer and will start playing with it on Tue when it arrives.The rest of the weekend will be spent playing with the previous solutions.Thank you again!

author: Ian.M
author_rank: Super Contributor
timestamp: December 08, 2019, 12:06:02 am
content: I've added some compensation diodes (and tweaked a few resistors) to reduce the offset drift with temperature. Its still not great but reduces the tendency for the final amplifier to rail on only a moderate temperature swing.LTspice sim only this time - use the rest from reply #22.N.B. I've got *NO* idea of the HF performance of the transformer I suggested. Hopefully it doesn't crap out below 200kHz. The first thing I'd suggest when it arrives is to drive its primary from a sweepable signal generator, with a 10K load secondary side, and scope the input and output to plot the amplitude ratio from lets say 50KHz to 500KHz.It wont be a straight 'drop in' you'll probably have to tweak the resistors in the first amplifier stage to bring its output into range.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 08, 2019, 02:24:47 pm
content: Thank you again Ian!To keep the noise level to a minimum I am thinking of using thin film as well as keeping (where possible) the resistor value as low as possible. Is that correct and which resistors in your latest schematic are the most crucial to keep noise to a minimum?Thank you

author: Ian.M
author_rank: Super Contributor
timestamp: December 09, 2019, 10:08:23 am
content: From the bridge rectifier, up to the first OPAMP, the signal is relatively low level, e.g. the sim shows 166mV pk-pk after the filter between Det+ and Det-. You could reduce all resistors in this section by an order of magnitude, and increase the filter caps to keep the same time constant (or even increase them further if there's excessive bandwidth for your application), for an approximate factor of three improvement in the noise floor due to the resistors, however that loads the bridge rectifier more, increasing the load on the signal source, decreasing the detected amplitude, and worsening thermal drift due to the higher peak currents in the bridge.It would almost certainly be more effective to remove the bias networks for the two OPAMPs from the rails, and feed them from a well decoupled pair of 2.048V references centred on Vcc/2, as any noise on Vcc currently directly influences the output. Also, reduce the bandwidth of the output amplifier to the minimum acceptable for the application.

author: ricko_uk
author_rank: Super Contributor
timestamp: December 13, 2019, 08:09:02 pm
content: Thank you Ian! As always, very appreciative of all your help!!

author: Ian.M
author_rank: Super Contributor
timestamp: December 14, 2019, 10:28:53 am
content: Do keep us updated with the project, It sounds interesting and its always useful to learn of the pitfalls on the road towards a practical application on someone *ELSE*'s dollar!

author: ricko_uk
author_rank: Super Contributor
timestamp: December 17, 2019, 08:40:41 pm
content: Yes, I was going to do that! Back to the sch and pcb design for now to do a low-noise board proto.Will keep you posted!Thank you again, really appreciated all your help!

author: ricko_uk
author_rank: Super Contributor
timestamp: January 27, 2020, 04:35:57 am
content: Hi Ian,just wanted to give you and update as promised.We made a PCB and got it working nicely. So thank you very much again for all your help, suggestions and for having gone as far as running all those simulations! Very much appreciated!!