Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to measure a clipped and non-clipped sinewave accurately

Status
Not open for further replies.

gopal_amlekar

Junior Member level 1
Joined
Jun 14, 2009
Messages
17
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,283
Location
Pune, India
Activity points
1,468
Hi all,

In my inverter project, I am generating a sine wave 230V with PWM using a full bridge of MOSFETs. The feedback is to be measured with an ADC built in the MCU. I need to regulate this 230V upto a load of 800VA.

I would like to know expert opinions on what should be the method to measure the sinewave accurately. I am briefing below things I have tried and problems I observed in those:

1. Stepped down output 230V to about 15V using a transformer and then rectified, filtered with a diode bridge and a capacitor. Fed this DC voltage to ADC input via a resistive divider. Problems observed in this is that when sinewave starts clipping at higher loads, the DC voltage variation reduces a lot. For e.g. a non clipped 230V sinewave generates a DC voltage of 19V and a clipped 230V sinewave generates DC voltage of 18V. This introduces an error in feedback at higher loads, which I want to avoid.

2. I stepped down the 230V sinewave via resistive divider and fed it to an OP-AMP whose one input is biased at 2.5V. This way the OP-AMP generates a sinewave centered at 2.5V. This centerline 2.5V is used to detect zero crossings. Now I measured peak value between two zero crossings and took that peak value as reference. Again, when sinewave is clipped, this peak values does not give correct indication because peak remains same (the clipped level) even though actual RMS varies. Another problem with this method is that sometimes peak gets skipped due to other overhead running in MCU, so in some cycles, I get errorneous readings of a lower peak.

3. I am trying to average the instantaneous values between a positive ZC and negative ZC. I am not yet finished with this method so do not konw pros and cons.

I am using a PIC16F72 running at 20MHz (It has an instruction cycle of 200nsec). All programming is in assembly. There is no hardware multiply, divide etc. So that way, it is quite low-end design.

Can someone please suggest me which approach I should take in this regard?

Best regards,
Gopal
 

Measuring the peak value, or a value near to it, by a rectifier/capacitor circuit is surely the worst variant.

"Rectified value" (rectified and averaged) would be better and is easily available. It doesn't matter much, if the voltage is converted by a transformer or a resistive divider. I don't see an advantage in generating the rectified value in software, except for a faster response time.

RMS value, as determined by higher quality voltmeters or e.g. energy measurement chips is the third variant. It can be either determined by special hardware or calculated in software from instantaneous voltage measurements by averaging the squared values over a full period.
 
FvM, Thanks for reply.
But how do I cope with the error if I use "rectified, averaged" value?
 

Usually, rectified value is calibrated as RMS. 1 V RMS gives 0.9 V rectfied value (2*√2/pi). But it's only exact for sine waveform.
 
It might be a useful feature of your circuit to include a "clip detector", this would simply provide a binary value which would advise you that the output was distorted by clipping, quite independently of the actual voltage at which clipping occurs. I guess this could be achieved with just a few components, moreso if only half-wave detection was used. I envisage the circuit would simply detect the duration in which each half cycle was within a relatively small voltage margin of the peak voltage. Current measurement may be the more usual method of detecting overload, but I just wondered if this might help.

I apologise that this does not answer the OP's question (which others have done!).
 
Last edited:

I think that if you filter out the fundamental out of your output wave form, hopefully this will increase in value right up to clipping. The PSU must be configured so that it will meet its output power rating without clipping, so clipping indicates its being overloaded and so must be shut down.
Frank
 

gopal. i'm also trying to do the same thing you are doing. what i believe we should do is to take the average of the feedback signal. maybe by taking sample during the cycle and later take the average of the sample.
why am doing this is to be able to regulate the output rms maybe clipped or not. reply so that we can share our experience more. best regards. isreal

---------- Post added at 13:42 ---------- Previous post was at 13:40 ----------

gopal. i'm also trying to do the same thing you are doing. what i believe we should do is to take the average of the feedback signal. maybe by taking sample during the cycle and later take the average of the sample.
why am doing this is to be able to regulate the output rms maybe clipped or not. reply so that we can share our experience more. best regards. isreal
 

gopal. i'm also trying to do the same thing you are doing. what i believe we should do is to take the average of the feedback signal. maybe by taking sample during the cycle and later take the average of the sample.
why am doing this is to be able to regulate the output rms maybe clipped or not. reply so that we can share our experience more. best regards. isreal
Hello israel7732,
Taking average of all the readings in half cycle worked fine for me. Only thing you have to ensure is sample the sinewave at equal and consistent intervals of time.
I elaborate this a little bit here:
Sample the sinewave at fixed slots of time, say 100us each.
Wait for zero crossing of the sine wave (If previous sample was negative and the sample now is positive, zero crossing is detected).
Now start summing the sample values till a negative sample is detected. (Negative sample is obviously not added to the sum).
Take average of these sample readings, i.e. divide the sum by the number of samples summed.

It was quite painful for me doing in assembly language of PIC16F72 running at just 5MHz and doing lot of other tasks. :)
I hope this helps you..

Regards,
 

The original post didn't clarify, if averaged rectified value or RMS is the measurement value of interest, it's more referring to technical problems of doing a consistent measurement, e.g. not missing samples.

Obviously, if you want an exact RMS value, you have to do RMS processing, squaring the samples, etc. But which measuremnt do you really want to use for inverter voltage feeedback?

To make the thing even worse, different loads are "seeing" a distorted inverter waveform different. A filament lamp sees RMS, an induction motor mainly the fundamental, an electronic device with rectifier/filter capacitor input mostly the peak value.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top