Is the waveform of this wave peak detection circuit normal? - Page 1
Forum section: electronics / projects

author: daisizhou
author_rank: Super Contributor
timestamp: February 14, 2022, 06:30:30 am
content: Please refer to the attached drawings for the circuit schematic.500kHZ sinusoidal signal 224mv signal I input in RF INPUT,At TP7 I measure a sine waveform,Next, the upper half is the positive peak detection circuit, and the lower half is the negative peak detection circuit.But I'm testing on TP8 to get a superimposed sinusoidal signal。I don't know if this is normal.I tested again at TP9 and got a negative peak waveform above the horizontal baseline, again I don't know if this is normalPlease let me know if you know the correct waveform, thanks--------------------------------------------------------------------------------------------------------------------------------------------------------------------Retested TP8 signal, now TP8 is back to normal,But TP9 is still above the X axis. Is TP9 lower than the X axis when normal?

author: moffy
author_rank: Super Contributor
timestamp: February 14, 2022, 07:38:14 am
content: The Devil as they say is in the detail. You need to say what types the op amps are, the diodes and the transistors. Parasitic capacitance and leakage currents can play a significant part in the signal integrity, also what power supplies are you using for the op amps?

author: daisizhou
author_rank: Super Contributor
timestamp: February 14, 2022, 08:09:25 am
content: U21:AD844AN (D1、D2、D3、D4、D5、D6 D8、D9、D10、D11、D12、D13):LL4148Q1, Q2:547BNPN Q4, Q5:560BPNPThe power supply uses the transformer 220V AC input, 2-way AC9V output。First pass through U1: LM317T comes out +12V, -12V, -7V，+12V then passes through U18: LM2941T to form +9V，-12V then goes through U20: LM2991T to form -9VThe actual measurement is in the circuit +9V=+8.467V, -9V=-8.583V

author: moffy
author_rank: Super Contributor
timestamp: February 14, 2022, 11:17:30 am
content: Did a quick LTSpice sim of the driving transistor and diode, and your circuit results don't look correct. What is U23 and U22? And with 0v input at the RF input what are the DC voltages at TP7,8,9,10,11? That will give us some idea of the DC bias voltages.

author: daisizhou
author_rank: Super Contributor
timestamp: February 14, 2022, 11:56:51 am
content: U22=U23=LF412CNWhen 0v is input at the RF input, TP7=0.07mvTP8=102.53mv, TP9=-108.53mv,TP10=77.67mv, TP11= 82.14mvThe following are the waveforms of TP8 and TP9 that I recently tested. It seems that TP8 is normal, but TP9 is still higher than the X axis.

author: Geek459
author_rank: Contributor
timestamp: February 14, 2022, 06:21:30 pm
content: Hi , what is s5 and s7 in the schematic?

author: fourfathom
author_rank: Super Contributor
timestamp: February 14, 2022, 06:37:35 pm
content: Looking at TP8: Assuming ideal components, R66 (10M) and C27 (1n) have a time constant of 10 ms. Unless D1 is extremely leaky or has a huge capacitance, or the follower U23 has a ridiculously low input impedance, you should not be seeing the signal you show at TP8. I would start troubleshooting there, look for wiring errors or bad components. Is the capacitor truly 1nF? Perhaps tack a bigger cap across C27 and see what happens?

author: moffy
author_rank: Super Contributor
timestamp: February 14, 2022, 10:19:31 pm
content: The DC TP voltages look reasonable. What fourfathom suggests also sounds like good advice.

author: daisizhou
author_rank: Super Contributor
timestamp: February 14, 2022, 11:00:39 pm
content: In the schematic diagram, s4, s5, s6, and s7 are connected to the input pins of the analog switch chip, and finally connected to the analog-to-digital conversion chip

author: moffy
author_rank: Super Contributor
timestamp: February 14, 2022, 11:21:44 pm
content: Analogue switch chips, in my experience, tend to fail frequently. It provides a common point of failure for TP8,9 can you desolder/disconnect it?

author: daisizhou
author_rank: Super Contributor
timestamp: February 14, 2022, 11:28:32 pm
content: The picture content in the attachment is the functional description of the circuit

author: daisizhou
author_rank: Super Contributor
timestamp: February 14, 2022, 11:34:29 pm
content: The picture content in the attachment is the functional description of the circuit。I can disconnect the analog switch chip, in short, disconnect s4, s5, s6, s7 and the circuit, right? Then re-grab the waveform?

author: fourfathom
author_rank: Super Contributor
timestamp: February 15, 2022, 12:29:22 am
content: Don't worry about the analog switches for now. The problem is obvious at TP8, which should be essentially a DC value equal to the positive peak of the input signal, and TP9 should be DC at the negative peak level. The signals at TP8 and TP9 are both bad. Fix that and then move on.

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 01:26:44 am
content: Where should I start checking, where should I start?Is TP8 also wrong?It looks more like the overall upward shift of the TP9 waveform is too largeI simulated the correct waveforms for TP8 and TP9. Is the correct waveform the same as what I have drawn in the attached image?

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 02:41:45 am
content: Instead of repairing the board, I recreated a new PCB board based on this schematic.Found this problem when debugging circuit functions

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 03:06:46 am
content: Brief description: My TP9 circuit peak voltage is about 270mv high.Is my description correct?

author: moffy
author_rank: Super Contributor
timestamp: February 15, 2022, 04:04:35 am
content: This is roughly what you should be looking for across the capture capacitor:

author: fourfathom
author_rank: Super Contributor
timestamp: February 15, 2022, 04:30:49 am
content: Quote from: daisizhou on February 15, 2022, 01:26:44 amNo your sketch is not correct.The signal at TP8 should be close to a DC value, decaying with a 1 ms RC time constant between input signal peaks. Here is a LTspice schematic and plot of your circuit between TP7 and TP8 showing how it should be working. There is a 400mV offset in the output of my simulation, but that can probably be fixed by adjusting the standing current in the PNP transistor and the diodes. I haven't looked into that because your results are grossly in error, and minor offsets aren't yet relevant.By the way, resistors R59 and R70 in your first schematic really serve no purpose and could be eliminated. If you need the gain-trim you can get it elsewhere.

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 07:34:14 am
content: I redo the online measurement,The yellow curve represents the (TP8) positive peak curve, and the blue curve represents the (TP9) negative peak curve200mvpp level, there is little difference between TP8 and TP9.But at 1VppTP8 and TP9 the difference almost doublesI do not know why

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 09:08:13 am
content: Sir, as for the TP8 DC signal you mentioned, I think mine is the real circuit.The state simulated by software is an ideal state, without other interference conditions, a DC signal may come out, but there is interference in reality.I drew a picture of my simulation, you see if it makes sense.

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 09:26:32 am
content: Don't know the specific role of R59 and R70 in the circuit,Because I made the PCB circuit board 1:1.It now appears that the gain value for the negative peak of TP9 may need to be adjusted since at 1VP level the voltage is twice that of TP8I also don't know what the exact gain this circuit was originally designed for.I think either reduce the negative peak gain or increase the positive peak gain. But first we need to know what the exact gain was originally designed for

author: Geek459
author_rank: Contributor
timestamp: February 15, 2022, 10:35:50 am
content: In the description file "fucuon.jpg" at the end is written:"The peak detector ran be reset by short-circuiting C27 and C28 via octal analog switch U24",i think it is useful to analize how this interact with a part of schematic circuit that you have placed.Probably , there's a mcu or a logic that manage all sequences ,without this information is so difficult assert if work good or not.

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 02:37:04 pm
content: Yes U24--- DG485DJ (Octal Analog Switch Array)LTC 1272- 5CCN------AiD converter 12 bit 250 kHz at the back，Finally, the microprocessor chip

author: daisizhou
author_rank: Super Contributor
timestamp: February 15, 2022, 02:44:00 pm
content: I rechecked the hFE of Q1, Q2 and Q4, Q5 and tried to make their hFE the sameWhy TP9 is 1/3 times bigger than TP8 at 1VP, I don't know。At 200mVp, TP9 and TP8 measurements are almost identical

author: fourfathom
author_rank: Super Contributor
timestamp: February 15, 2022, 03:55:09 pm
content: Quote from: daisizhou on February 15, 2022, 09:08:13 amIf your hand-drawn green trace is supposed to be the "real world" version of the green trace (at TP8) I show in my simulation, then you have got something seriously wrong. Look at your circuit: Is there anything at the TP8 node that should cause the signal to rapidly discharge towards zero? The relevant components are D1, R66, and C7. What would be the source of your "interference in reality"?Do you have an "octal analog switch" connected to "S5"? If that is the case then having the switch enabled could give you the voltage differences and rapid discharge you are seeing. If so, disconnect the switch from S5 (and S7), or turn it off. Check the power supply and logic levels at the switch.

author: moffy
author_rank: Super Contributor
timestamp: February 15, 2022, 11:31:18 pm
content: Looks like the switches might be important. The DC test voltages basically show that the transistors and diodes are forward biased, with junctions intact, Q1 and D1 basically cancel out D2 and D3 giving 0.102V at TP8 when TP7 is 0.07mv. TP8 being above 0 is expected because D1 will be drawing little current and the 1N4148 diode only roughly matches the BE junction of the Q1. Same for the negative side. So we are looking for a load on the capacitor C27,C28 which could well be the switches. And whatever load it is it looks like it is connected to 0v, because the voltage across C27 doesn't seem to go below 0v even though the input signal does.

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 03:28:06 am
content: ok .i removed the u24 analog switch chip and also the u23 and u22 chips.Below is my test graph

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 03:32:11 am
content: Quote from: daisizhou on February 16, 2022, 03:28:06 amI uninstalled the analog switch chips (U24) and (U23) (U22), above is my test graph

author: moffy
author_rank: Super Contributor
timestamp: February 16, 2022, 04:18:52 am
content: Well, you have solved the ripple issue but now have a substantial offset. Does "no RF signal" mean that the RF Input is connected to 0v? And what does TP7 look like with "no RF signal"?

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 04:29:31 am
content: The second picture is the waveform measured at TP7 when the signal generator turns on the signal at the RF input point."No RF signal" means the generator has no output, but it is wired

author: moffy
author_rank: Super Contributor
timestamp: February 16, 2022, 04:31:31 am
content: The extra offset could be because D1 feeding the 10Meg resistor only has about 0.3v drop while D2,D3 have about 0.67v. Which gives around a 0.4v difference. Why that offset is not added to the input signal peak I don't know.

author: moffy
author_rank: Super Contributor
timestamp: February 16, 2022, 04:34:28 am
content: Quote from: daisizhou on February 16, 2022, 04:29:31 amMuch better to ground the input rather than just turning off the signal generator. You could end up with a floating input picking up stray voltages.

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 05:28:25 am
content: you mean let me connect the rf input port to GND,Test TP8, TP9 voltage,Read the voltage value and record.Then input 200mVp level and 1Vp level at the RF input, then read the voltage values of TP8 and TP9 and record, and then compare the recorded data?

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 06:06:39 am
content: I shorted the RF input signal and measured 0.4395v DC voltage using a digital multimeter here at TP8，, the -0.4597v DC voltage is measured here at TP9.When I input a sine 500kHZ200mvp level to the RF input, I measure 0.5245v here at TP8, and -0.5318v here at TP9.When I input a sine 500kHZ 1Vp level to the RF input, I measure 1.1408v here at TP8, and -1.1559v here at TP9.When I input a sine 500kHZ 2Vp level to the RF input, I measure 1.9348v here at TP8 and -1.509v here at TP9

author: moffy
author_rank: Super Contributor
timestamp: February 16, 2022, 08:22:13 am
content: Did a simulation in LTSpice:RFin= 0 TP7=0v TP8sim=400mv TP8Real=449mvRFin= 100mvp-p TP7=350mvp-p TP8sim=474mv TP8Real=524mvRFin= 500mvp-p TP7=1.6vp-p TP8sim=1.05v TP8Real=1.14vRFin= 1vp-p TP7=3.2vp-p TP8sim=1.836v TP8Real=1.934vSo there is quite good correlation between the real and simulated results. Real results are between 0.05v to 0.1v above the simulated, an extra offset due to real world devices vs idealized.I modeled the AD844 input buffer which has a gain of about 3.3, I had to halve the input voltage at RFin to get what you do at TP7.

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 09:24:11 am
content: Thanks for the test, it looks like my peak circuit doesn't seem to be faulty and the schematic results are close。But in actual work, this peak detection circuit controls a -10DB attenuator and a -20DB attenuator to work, the result is that the attenuator works in advance, I don't know what causes this result

author: moffy
author_rank: Super Contributor
timestamp: February 16, 2022, 10:07:32 am
content: It's not the most accurate peak detector circuit I've seen. Hope you are able to resolve the issues with the attenuators.

author: daisizhou
author_rank: Super Contributor
timestamp: February 16, 2022, 11:25:12 am
content: Sir, I noticed that your voltage at the RF input is half the voltage I tested.When I test the data, I connect the input signal of the signal generator to the RF-INPUT port of the schematic diagram。But when my circuit actually worked, there was a 50 ohm resistor in series in front of the RF-INPUT. Your response voltage is half of my test result. Is it the result of not connecting this 50 ohm resistor?

author: moffy
author_rank: Super Contributor
timestamp: February 17, 2022, 12:43:53 am
content: Yes that would be the case. The output impedance of your signal generator is probably 50R so having a 50R load will divide it in two, halving the signal level, which I needed to match your levels at TP7. I didn't have a signal generator with 50R(0 for the sim) output impedance, or a 50R input load(it was 1k for the sim).So my input signal was not divided by 2 as yours was.

author: daisizhou
author_rank: Super Contributor
timestamp: February 17, 2022, 01:33:33 am
content: In fact, the output impedance of my signal generator is 50 ohms. That's right