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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
03/10/12 13:49
Read: 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
TopicAuthorDate
Sine wave detection on microcontroller            01/01/70 00:00      
   Detect or measure?            01/01/70 00:00      
      not detection, measurement of sine wave signal            01/01/70 00:00      
         What are you measuring?            01/01/70 00:00      
            RMS and Average - 1st Priority            01/01/70 00:00      
               415 v            01/01/70 00:00      
                  I have to do using MCU            01/01/70 00:00      
                     Start simple            01/01/70 00:00      
                        if time is major isssue than.....            01/01/70 00:00      
                           People responding to specific questions            01/01/70 00:00      
                              Same Technique....            01/01/70 00:00      
                                 RMS            01/01/70 00:00      
                                    Sorry for my laziness            01/01/70 00:00      
                                 So what have you done?            01/01/70 00:00      
                                    Require more work...            01/01/70 00:00      
                                    Working on that            01/01/70 00:00      
                                       options, options            01/01/70 00:00      
   Help me            01/01/70 00:00      
      Okay            01/01/70 00:00      
         Are many threads available            01/01/70 00:00      
      when you save a char ...            01/01/70 00:00      
      Why don't you specify your problem COMPLETELY?            01/01/70 00:00      
         Already specify it            01/01/70 00:00      
            there are some details?            01/01/70 00:00      
               comparisions            01/01/70 00:00      
                  How are you calculating your needed sample rate?            01/01/70 00:00      
                     start with simple one....            01/01/70 00:00      
                        You do know sin(90+angle)? Or 2-log computations?            01/01/70 00:00      
                           ADC resolution............            01/01/70 00:00      
                              impossible or wrong            01/01/70 00:00      
                              double post, ignore            01/01/70 00:00      
                  Precision Rectify:            01/01/70 00:00      
                     SCR Chopped Wave            01/01/70 00:00      
                        What accuracy do you need?            01/01/70 00:00      
                           CT accuracy            01/01/70 00:00      
                              the fundamental            01/01/70 00:00      
                              50Hz            01/01/70 00:00      
                              Precision rectifier is suitable for any waveform            01/01/70 00:00      
                                 are u sure??            01/01/70 00:00      
                                    Depends            01/01/70 00:00      
                                    must be severely bandwidth limited            01/01/70 00:00      
                                       Maybe was circuit with top-voltage capacitor            01/01/70 00:00      
                                       Sorry for confusion            01/01/70 00:00      
                                          What accuracy do you need?            01/01/70 00:00      
                                             360/1024            01/01/70 00:00      
                                                Not what he (or me) have asked            01/01/70 00:00      
                                                   you are right....            01/01/70 00:00      
                                                Do you believe you can protect your circuit from noise?            01/01/70 00:00      
                                                   Very Noisy environment            01/01/70 00:00      
                                                      re Very Noisy environment            01/01/70 00:00      
                                                         Some of those rules are showing their age            01/01/70 00:00      
                                                            here we go again            01/01/70 00:00      
                                                               think about this for a minute            01/01/70 00:00      
                                                                  when discussing a FAQ            01/01/70 00:00      
                                                                     Well, when were those cap sizes determined?            01/01/70 00:00      
                                                                        Technology            01/01/70 00:00      
                                                                           Steady state currents do not need decaps            01/01/70 00:00      
                                                                              Often low capacitance so limited charge. But remember load.            01/01/70 00:00      
                                                                        fixations            01/01/70 00:00      
                                                                           Nothing. has been proven yet.            01/01/70 00:00      
                                                                              once more for the peanut gallery            01/01/70 00:00      
                                                                                 Where you sit determines what you see ...            01/01/70 00:00      
                                                                                    Off-topic            01/01/70 00:00      
                                                                                       difficult when ...            01/01/70 00:00      
                                                                                       Yes ... I don't know how we got here either            01/01/70 00:00      
                                                                                          i do            01/01/70 00:00      

Back to Subject List