Different output of Amplifier with slightly changes at input side

Hayee

Member level 4
Joined
Mar 4, 2022
Messages
68
Helped
1
Reputation
2
Reaction score
3
Trophy points
8
Activity points
709
Hi Guys,
I am looking at the following 3 circuits. all of 3 circuits are slightly different but their outputs are different.
Circuit A has a scaled down output (full sinewave) with DC shift.
Circuit B has a scaled down output (half sinewave) with no DC shift
Circuit C is giving pulses at output act as a zero crossing.

I want to know that how to mathematically calculate the resistance values and how these slightly difference in configuration make different output. Mean how I know that by doing this I will get these responses
Kindly guide me






Thanks
 

you need 12 bit resolution and 10 bit accuracy or +/-1bit in 10^10 with almost a full-scale signal = TBD for 0.1% accuracy. What R tolerance do you think you need to assume an ideal ADC for 0.1% accuracy??
 

A/D errors budget budgeting :


And lest you forget yiour signal path, R's and OpAmp also have errors.

The easy way to do end to end error budget is convert all erross into same units, such as
PPM or LSB equivalents, and then add. Dont forget noise errors have to be added as root
of squares. And on top of that you have AC errors to deal with. In your case noise would
be primary consideration, both in high valued R's and OpAmp.





Regards, Dana.
 

as i am learning how to read the AC voltages in microcontroller, and there are some safety rules which I have to follow then I must decide the circuit which is safe for experimental basis so I decided to go with the "floating" mode to see the behavior of the circuit without any unwanted risk of life.
Also I would like to go with 1% accuracy so that i can use the 10-bit ADC of the microcontroller.

regarding point no 2
I want 4 volt peak at 250V input.

regarding point no 5
I want to use my circuit which is in post # 11

following is the simple sketch of the waveform at input side and output side
 

Hi,

I´m shocked about the waveform.
You really try to calculate RMS value with an error of 1% while you completely ignore 50% of the signal?
How?
* Just by hoping the missing half wave is identical to the exisitng half wave with error in the region of 1%
* Just by hoping the input waveform is pure sine .... without any distortion / overtones ... to get an output value with 1% accuracy error?
* Just by hoping the amplifier has no offset error, the output goes perfectly to GND, the output has no problems (timing, ringing) when continously going from regulated condition to saturated condition and back.

For "hoping" when designing electronics I´m the wrong man. I rely on physics and math and work with realistic waveforms.

I don´t doubt that with a perfect laboratory generated sinewave and some tricks in software you get a "faked" output value that matches your expectations.
But on a real mains waveform .... there is no way to get reliable output values with an 1% accuracy error.

****
Please tell me something about the algorithm (code) you want to use inside the microcontroller to get the desired values. How do you calculate the RMS value from the given (half) waveform?

Klaus
 
Last edited:

Dear members,
I know you are asking right things, but look from the asker side as well. If I know all these details then I was cleared in my mind what I have to do.
I am here because to know what considerations I have to follow and what are the limitations and how to solve the desired task.


To read in microcontroller, what I will do is to take samples in an array after every 100uS for 20mS.
Then I will do the following

=======================calculation of RMS FACTOR============================//
To find out True RMS Voltage or Current we have formula
Vrms = sqrt((V1^2 + V2^2 +----+Vn^2)/n)
Where V1 is calculated as
V1 = (ADC * 5000(mV))/1024
Now our main formula will looks like
Vrms = sqrt(((ADC1 * 5000/1024)^2 + (ADC2 * 5000/1024)^2 +----
----+ (ADCn * 5000/1024)^2)/n)
By simplifying we will get
Vrms = sqrt(5000/1024)^2 * sqrt((ADC1)^2 + (ADC2)^2 +----+ (ADCn)^2)
Vrms = 23.84 * sqrt((ADC1)^2 + (ADC2)^2 +----+ (ADCn)^2)
 

Hi,

OK. At least your algortihm uses "Square" and "squareRoot" ... but you missed the "Mean" part, the "M" of "RMS".
And also you missed .. to care for the missing half wave.
These are two issues that simply can be corrected.
So far so good.
***

If I´m not mistaken, then the linked tutorial tells to use full wave with offset.
So what is your idea ... why do you think it´s better to use one halfwave only?
You chose to do so ... so what´s your reason? Where is the improvement?

Klaus
 

Perhaps you should analyze how DMM's work first, rather than reinvent the wheel. Then decide whether to improve on a product that costs $5 to make or $50 or $500? or behave worse than all 3. Not to worry, you may learn more if you fail.
 

@KlausST
The reason for selecting the halfwave is to find out how to do the circuit design using full wave and half wave.
How to calculate the things. How to compare the things which is better and which have advantages over others.
The link I provided is based on fullwave and the calculations are also mentioned.
I want to do in halfwave so that I know about the difference in circuit design and calculations.
Want to learn the things not just by copying and pasting the materials but by doing the mathematics and experiment.

Hope this clear my point
 

Hi,

sounds like you want to do a one leg sprinting competition to find out which one is faster: one or two legs.

So this is just a learning challenge .. without practical use?

****
On the one hand you write you do ADConversions for full 20ms. A full wave.
On the other hand you cut - on the analog side - one half wave.
So sampling over the one 10ms makes sense ...

... but what about the other 10ms?
* If all values are zero .. you know it´s perfect. But then you simply could replace the digital data with zeroes .... and omit the sampling at all
* if not all values are zero ... you know there is a flaw ... these values need to be erroneous. ... and you know you have to omit them.

***
Then you ask how to calculate .. for the half wave solution...
As long as you are interested in the RMS part of the one half wave only ... everything is correct ... so far.

But since you never wrote you are interested in the RMS value of one half wave only ... we did not take this into consideration.
Simple conclusion: If you cancel one half wave ... you NEVER can MEASURE it.
If you use math .... then this math only can be related on GUESSING ... that the second half wave is identical to the other one.
But GUESSING means NOT KNOWING. It could be right, it could be wrong.

For me personally speaking: GUESSING is the opposite of measuring. The result is a guessed result and thus not reliable. I would never design a measuremnt tool which relies on guessing.

Close one eye ... you still will see, but you lose spatial vision.
Close one eye ... you still will hear, but you will lose spatial hearing.
--> I can not find any benefit in randomly cutting out one half of information.

What about going the same way .. a step further?
Since a sine is symmetrical ... why not use 5ms only?
Why not using the peak value only .. since you know on a sine waveform ... there is: V_RMS = V_peak / sqrt(2)?
The answers to both is: They are correct on a perfect sine waveform ... they are incorrect on a real (distorted, noisy) waveform.


Klaus
 

Consider comparing different methods by converting to Vrms. e.g.
1. Vp 1 kHz BW
2.Vpp 1 kHz BW
3. Precision FW rectifier to Vavg
4. diode half wave to Vavg
5. 1 kHz BW 24 ks/s
6. no filter 1kHz ADC
 

Hi,

Tony, you surely know that these methods only for a fix, very known waveform work.
As soon as the waveform changes a bit ... the conversion factor to RMS also changes ... otherwise the calculated RMS value is wrong.

For me speaking: the ADsampling --> squaring --> averging --> squareRooting --> RMSvalue... is the only valid method to find true RMS values (like the name says).

The true RMS method can be done with dedicated analog ICs, digital metering ICs or with a microcontroller (like the OP does).

When talking about mains voltage and current ... often one talks about overtones ... up to the 30st (29th).
According nyquist the sampling rate needs to be HIGHER than 2x 50Hz x 30 = 3000 Smpl/s.
The OP uses 10.000 Smpl/s .. which is fine.

So everything the OP does is correct so far ... until he cuts away one half wave. He cuts away one half of important information ... and additionally adds new errors that not existed before.
He talks about benefit ... Thus I expect he has an idea about the benefit.
I mean - if I see a circuit, with description, with code and so on ... I don´t modify it, unless I have a good reason for it. Any improvement can be a good reason.
Cutting away information ... is always equal to reducing information - this can be wanted or not.

If not "improving the measurement quality" is the reason ... it might be "to make it cheaper". This is a valid reason. But I can not see any reduction in cost.
Neither in hardware, nor in software.

Thus I still wonder where the OP sees the benefit. I only see reduced performance.

And as long as I miss this information I can only recommend to use the schematic of the linked document. They do the RMS measurement pretty well.
Better than most other so called "RMS measurement" solutions.

I see not much ways to improve it (given the existing hardware, like Opamp, resistors, ADC inside microcontroller...).

Klaus
 

To analyze and mathematically calculate the resistance values in these circuits and understand why they produce different outputs, it's essential to have a deeper understanding of the circuit configurations. Although the precise schematics for Circuit A, Circuit B, and Circuit C are not provided, we can make some general assumptions based on typical circuit behaviors.

Let’s break down how different resistances and configurations can affect the output, and how to approach the calculation of these resistance values:
 

If you have an idea of what you want to measure for inputs and output error tolerance to compare each method of interest, make a list of spec's(design) and design verification tests (DVT) then design it. But if you can think of it, you can simulate it faster, so you ought to learn how that can be done faster. There are dozens of tools to choose from. Just search or ask.
 

Cookies are required to use this site. You must accept them to continue using the site. Learn more…