Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Per Westermark
03/10/12 06:49
Read: 444 times

#186554 - options, options
Responding to: ???'s previous message
"My qus. is: what is outcomes if i will not use full dynamic range? "

Already covered. Loss of resolution. You thow away your "best" bit of the ADC. This making you more dependant on the "worst" (least significant) bit of the ADC. It's the least significant bits that contains the noise, and the non-uniform stair steps.

"But I will try to increase DC level upto 1.36 V and check it "

Why 1.36V? Why not 3.3/2 = 1.65V?

"how to take samples?"
How to take samples should be obvious. Start a conversion. Wait. Get result.
It is totally separate from how many samples or how often.

But the DC component can be either computed by simplify everything and take the middle value of the highest and lowest samples you get. Obivously requiring you to sample often enough that you do catch both the minima and maxima with reasonable precision.

Or you can perform many samples through one or more full periods and compute the DC level using mean-square or other methods.

"Every 20mS/1023 = 19uS "
Why something odd like 1023 samples/period?
Wouldn't it be better to have a sampling speed of 20ms / 2^10?

That would mean that you do 1024 samples * number of periods. And that if first sample is on a "zero-crossing", then the last sample is one sample interval before a "zero-crossing" n periods later.

By the way - where did you get the value 1023 from? Have you used a pocket calculator (or a tiny PC program) and figured out that your required precision do require 1024 samples/period? Or did you just pick a value randomly?

Set up a table where you compute the amount of error if you do 128, 256, 512, 1024 samples/period. Or maybe 419 samples/period if you like more odd counts ;)

Don't pick numbers randomly. Make sure there is a formula somewhere showing that you really need a specific sample speed. And that you then selects the best sample speed (taking clock frequency, timer divisors etc into account) that fulfills your requirements.

Obviously - many samples are needed if you have a ADC with lots of resolution (and well calibrated) and you want to take full advantage of this to get a high precision. If you have bad precision in the hardware or bad resolution of the ADC, then it isn't meaningful to sample fast. The resulting errors will still be dominated by the calibration, noise, sampling errors etc.

"how to use adc measurement in background. i have to check in my MCU. "
Both internal and external ADC normally support that you start a conversion and then have the processor do something else until there is an interrupt that signals that the ADC conversion has finished and a value can be picked up.

"I will check Zero crossing before DC level Adding for Refernce so we can know at which place i can take SAMPLES. "

But that can introdue a measurement error. What if your zero-detection detects at +5mV? Then you have potentially introduced (depending on what type of measurements/calculations you do) a DC offset error of 5mV.

A hw zero-crossing detection is best for catching the frequency if the input signal. But not always usable for measuring amplitude or rms.

Another thing you can consider, if your program is not fast enough, but the AC signal is changing amplitude very slowly, is to subsample the signal.

So you sample 100 samples from one period of the signal.
Then you sample 100 samples from next period, but with a time offset (maybe 1/4 sample interval)
Then you sample 100 samples from third period, but with twice as large time offset.
Then you sample 100 samples from fourth period, but with three times as large time offset.

Now you have 400 samples that are evenly spread around one period of the signal.
The data would represent the "average" of four full periods, so there is a bit of extra delay in the output result.
But it is possible to perform this calculation continuously, i.e. every full period you throw away 100 samples and make 100 new samples, and produce a full measurement result every full period.

There are an almost infinite number of ways to measure.

But your flowchart (that you have already done) should tell you one solution - have you implemented code according to that flowchart yet? What was the result?

List of 66 messages in thread
Sine wave detection on microcontroller      Yagnesh Mehta      03/07/12 04:59      
   Detect or measure?      Per Westermark      03/07/12 05:25      
      not detection, measurement of sine wave signal      Yagnesh Mehta      03/07/12 06:14      
         What are you measuring?      Andy Peters      03/07/12 10:05      
            RMS and Average - 1st Priority      Yagnesh Mehta      03/07/12 20:59      
               415 v      Mahmood Elnasser      03/08/12 22:07      
                  I have to do using MCU      Yagnesh Mehta      03/08/12 22:48      
                     Start simple      Mahmood Elnasser      03/08/12 23:17      
                        if time is major isssue than.....      Yagnesh Mehta      03/08/12 23:31      
                           People responding to specific questions      Per Westermark      03/09/12 02:14      
                              Same Technique....      Yagnesh Mehta      03/09/12 04:32      
                                 RMS      Maarten Brock      03/09/12 05:49      
                                    Sorry for my laziness        Yagnesh Mehta      03/09/12 20:50      
                                 So what have you done?      Per Westermark      03/09/12 06:19      
                                    Require more work...      Yagnesh Mehta      03/10/12 00:50      
                                    Working on that      Yagnesh Mehta      03/10/12 06:12      
                                       options, options      Per Westermark      03/10/12 06:49      
   Help me      Yagnesh Mehta      03/08/12 21:31      
      Okay      Joseph Hebert      03/09/12 06:13      
         Are many threads available      Per Westermark      03/09/12 06:29      
      when you save a char ...        Erik Malund      03/09/12 08:09      
      Why don't you specify your problem COMPLETELY?      Richard Erlacher      03/09/12 11:36      
         Already specify it      Yagnesh Mehta      03/10/12 02:07      
            there are some details?      Richard Erlacher      03/10/12 07:51      
               comparisions      Yagnesh Mehta      03/12/12 01:16      
                  How are you calculating your needed sample rate?      Per Westermark      03/12/12 01:54      
                     start with simple one....      Yagnesh Mehta      03/12/12 08:02      
                        You do know sin(90+angle)? Or 2-log computations?      Per Westermark      03/12/12 08:48      
                           ADC resolution............      Yagnesh Mehta      03/12/12 12:27      
                              impossible or wrong      Erik Malund      03/12/12 13:30      
                              double post, ignore      Erik Malund      03/12/12 13:30      
                  Precision Rectify:      Erik Malund      03/12/12 06:44      
                     SCR Chopped Wave      Yagnesh Mehta      03/12/12 07:48      
                        What accuracy do you need?      Kalpak Dabir      03/12/12 08:43      
                           CT accuracy      Yagnesh Mehta      03/12/12 12:58      
                              the fundamental      Erik Malund      03/12/12 13:41      
                              50Hz      Per Westermark      03/12/12 14:27      
                              Precision rectifier is suitable for any waveform      Kalpak Dabir      03/13/12 01:47      
                                 are u sure??      Yagnesh Mehta      03/13/12 08:03      
                                    Depends      Per Westermark      03/13/12 09:08      
                                    must be severely bandwidth limited      Erik Malund      03/13/12 09:11      
                                       Maybe was circuit with top-voltage capacitor      Per Westermark      03/13/12 09:17      
                                       Sorry for confusion      Yagnesh Mehta      03/14/12 00:18      
                                          What accuracy do you need?      Kalpak Dabir      03/14/12 01:23      
                                             360/1024      Yagnesh Mehta      03/14/12 01:41      
                                                Not what he (or me) have asked      Per Westermark      03/14/12 04:39      
                                                   you are right....      Yagnesh Mehta      03/14/12 11:51      
                                                Do you believe you can protect your circuit from noise?      Richard Erlacher      03/14/12 08:19      
                                                   Very Noisy environment      Yagnesh Mehta      03/14/12 11:57      
                                                      re Very Noisy environment      Erik Malund      03/14/12 12:23      
                                                         Some of those rules are showing their age      Richard Erlacher      03/14/12 20:00      
                                                            here we go again      Erik Malund      03/15/12 08:15      
                                                               think about this for a minute      Richard Erlacher      03/15/12 17:10      
                                                                  when discussing a FAQ      Erik Malund      03/16/12 06:49      
                                                                     Well, when were those cap sizes determined?      Richard Erlacher      03/16/12 09:53      
                                                                        Technology      Per Westermark      03/16/12 10:13      
                                                                           Steady state currents do not need decaps      Kalpak Dabir      03/16/12 22:48      
                                                                              Often low capacitance so limited charge. But remember load.      Per Westermark      03/17/12 06:41      
                                                                        fixations      Erik Malund      03/16/12 10:40      
                                                                           Nothing. has been proven yet.      Richard Erlacher      03/18/12 13:15      
                                                                              once more for the peanut gallery      Erik Malund      03/19/12 07:23      
                                                                                 Where you sit determines what you see ...      Richard Erlacher      03/20/12 01:56      
                                                                                    Off-topic        Per Westermark      03/20/12 02:01      
                                                                                       difficult when ...      Erik Malund      03/20/12 06:59      
                                                                                       Yes ... I don't know how we got here either      Richard Erlacher      03/20/12 09:32      
                                                                                          i do      Erik Malund      03/20/12 09:45      

Back to Subject List