2
\$\begingroup\$

I would like some clarifications of this circuit.

I had previously written code for a similar circuit to measure Vavg, which worked well enough linked here: Calculation of maximum input impedance.

I am now writing code for computing the RMS value using an STM32 uC.

enter image description here

In my previous circuit, the neutral was connected to the signal GND of the analog circuit, but in this one there is a resistance of about 120k between circuit GND and neutral, though I have still not located the path.

  1. I am unable to understand the function of resistors R5, R6 and R7 and its probable interaction with R8 on the feedback path.
  2. What is the function of R4 (1 Meg)
  3. The divider formed by R137, R138, R139 with R141 does not utilize the full swing of 3.3 V. It would have made more sense to make COM1 3.3V/2, instead of 5V/2 to utilize the full swing of the STM32 ADC. Am I missing something here?

TIA

Thomas

\$\endgroup\$
7
  • \$\begingroup\$ there is a resistance of about 120k between circuit GND and neutral, though I have still not located the path. - look at R3 \$\endgroup\$
    – Andy aka
    Commented Sep 6, 2021 at 15:30
  • \$\begingroup\$ Where did this circuit come from? Why can't you ask the original creator these questions? \$\endgroup\$ Commented Sep 6, 2021 at 15:42
  • \$\begingroup\$ @Andyaka R3 was drawn in for the purpose of simulation after measuring the value in the circuit. \$\endgroup\$
    – EmbSysDev
    Commented Sep 6, 2021 at 16:00
  • \$\begingroup\$ point 1 : U2 is a differential amplifier to measure main voltage V2. So R5,R6,R7,R8 and R137, R138, R139, R141 must be paired and forms a attenuator. These 3 first resistances are serial ... to withstand main voltage. point 2 : R4 don't care... Point 3 : you are not missing something. Label 5V = 3.3V. Unless I am wrong ... \$\endgroup\$
    – Antonio51
    Commented Sep 6, 2021 at 16:05
  • \$\begingroup\$ @Antonio51 No , it is actually 5V on the PCB. Similar resistor like R4 , exists between neutral and 3 phases, and also between neutral and earth. \$\endgroup\$
    – EmbSysDev
    Commented Sep 6, 2021 at 16:06

3 Answers 3

2
\$\begingroup\$

EDIT : I add some informations and simulations about "neutral" voltage. See also my remarks in picture ... R12, R13, R14 deleted.

3-Phase schematic "update" !

enter image description here

**And a "special view of Neutral Voltage ... Just for "playing".

Here I changed some resistors and verified some sign variables ...

More realistic ... Phase S : +10 V - DC_offset phase S : 5V. Unless something wrong.

enter image description here

point 1 : U2 is a differential amplifier to measure main voltage V2. So R5,R6,R7,R8 and R137, R138, R139, R141 must be paired and forms a attenuator. These 3 first resistances are serial (and 3 others) ... to withstand main voltage.

point 2 : R4 may be used to discharge eventually "capacitors" hidden in "main" ... But it can be used also to define a "center" virtual point ( would be wired independently as "star" with center point), when used in 3-phased mains, which would be Neutral wire in a ideal system. This virtual point can be used to see if neutral is in "good conditions" versus "Earth wiring". So the use of R3, but with some over-voltage "protections" needed if "neutral voltage" is measured by ADC.

Point 3 : I was missing something (LT1014 power supply 5V min -> 44 V). Label 5V = 5 V. Midpoint reference would be 1.5 V (use of R1/R2 = 7/3).

Point 3. Simulation of U1, U2 measuring "floating" voltage to see limits points. Unless I forget something ...

Measurements seems ok. Scale goes from 0.673 V to 2.327V for +/- 372 V. ( overload 10 %, permitted, in fact until +/- 600 V, case V neutral not centered on 0 V). For V2=0, the "center scale" point is 1.5 V (so 1.5 V +/- 0.827V).

enter image description here

\$\endgroup\$
4
  • \$\begingroup\$ Antonio51 , Thanks very much. "This virtual point can be used to see if neutral is in "good conditions" versus "Earth wiring". So the use of R3, but with some over-voltage "protections" needed if "neutral voltage" is measured by ADC." I know this is not the original query,but can you explain further how to check if neutral is in good condition vs Earth wiring with this system. TIA. \$\endgroup\$
    – EmbSysDev
    Commented Sep 7, 2021 at 6:30
  • \$\begingroup\$ Will make an edit to show how to wire "virtual center". From my "point of view"... Sometimes, I think that the neutral wire is not just where it would be. The neutral voltage may be "walking" around, because of some "errors" about mains voltages or something else. \$\endgroup\$
    – Antonio51
    Commented Sep 7, 2021 at 8:02
  • \$\begingroup\$ Thanks for your simulation. Rg as you have mentioned in your circuit is not connected like that in the PCB. It is connected across Phase and Neutral. \$\endgroup\$
    – EmbSysDev
    Commented Sep 9, 2021 at 9:11
  • \$\begingroup\$ @EmbSysDev Right. There are my R1,R2,R3. \$\endgroup\$
    – Antonio51
    Commented Sep 20, 2021 at 8:45
1
\$\begingroup\$

Question 1

R5, R6 and R7 combine to form a total resistance of about 1MΩ, a value needed for the transfer function which I describe below. However, a single resistor would probably not be able to withstand the hundreds of volts that the inputs are subjected to (by source V2). This series arrangement shares the total voltage equally across three indiviual resistors, to bring the voltage each resistor is exposed to down to acceptable levels.

U2 and its peripheral resistors form a classic differential amplifier, but with a DC voltage offset applied to COM1. Simplified a little it looks like this:

schematic

simulate this circuit – Schematic created using CircuitLab

The output of this circuit is:

$$ V_{OUT} = V_{COM1} \cdot (1+k_1) \cdot (1-k_2) + V_R \cdot k_2 \cdot (1+k_1) - V_N \cdot k_1 $$

where

$$ k_1 = \frac{R_2}{R_1},\ \ k_2 = \frac{R_4}{R_3+R_4}$$

Plugging in the resistances, we get approximately:

$$ V_{OUT} = V_{COM1} + 2.22 \times 10^{-3} \cdot (V_R - V_N) $$

Question 2

I see two possibilities for the purpose of R4. The first is to tie the differential inputs together in the absence of any source being measured, but this seems very unlikely because:

  1. It's a single resistor subject to the same conditions that R5, R6 and R7, and would likely need to be split into 3 separate series resistors for the same reason.

  2. Even if the inputs were unconnected, the nature of this circuit is such that the output would settle at its "zero input difference" quiescent level. That would be equal to \$V_{COM1}\$.

That leaves the only other reason I can think of, which is to help the simulator work. Sometimes disconnected voltage sources in a simulation can throw errors.

Question 3

Given that the ADC expects an input between 0V and 3.3V input, as you say, and also that the opamp output cannot swing all the way to the positive 5V rail, I believe you are correct.

This opinion is supported by the transfer function of the differential amplifier, which clearly adds this 2.5V (\$V_{COM1}\$) offset to the output. Unless there's something we don't know, setting \$V_{COM1} = \frac{3.3V}{2}\$ makes more sense.

\$\endgroup\$
1
  • \$\begingroup\$ Thanks very much , Simon. "That leaves the only other reason I can think of, which is to help the simulator work." Actually I put the resistor in the simulator after physically measuring the resistance in the PCB, between Neutral and circuit GND. \$\endgroup\$
    – EmbSysDev
    Commented Sep 7, 2021 at 6:23
0
\$\begingroup\$

I think, this is nearer to your needs. You have to bias it around 1.65V not 2.5V, further you need a voltage divider circuit.

enter image description here

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.