Accelerometer output

Post any questions you may have about our current range of oscilloscopes
Post Reply
toto
User
User
Posts: 5
Joined: Thu Mar 19, 2009 3:13 pm
Location: Stockholm

Accelerometer output

Post by toto »

Hi,

I am using a PS2203 and to channel A I have connected a analog output accelerometer. I want to see how well the accelerometer measures acceleration, thus I have created a software.

The software takes the acceleroemeter output through the ADC of PS2203 in block mode.

I plot the result with MATLAB and get the results like the attached files. It looks kind of like a PWM signal. My question is thus, does the ADC produce a PWM signal? Or is this a question that I should with to the manufactorer of the accelerometer?
Attachments
Zoomed in
Zoomed in
z_axis_zoom.jpg (30.9 KiB) Viewed 9485 times
Z-axis
Z-axis
z_axis.jpg (21.8 KiB) Viewed 9493 times
Toto

ziko
Advanced User
Advanced User
Posts: 1705
Joined: Fri Dec 01, 2006 10:03 am
Location: St Neots

Post by ziko »

Hi toto,

Are you looking for a signal generator with a PWM? Can you explain your question further?

Kind regards
Ziko

Technical Specialist

toto
User
User
Posts: 5
Joined: Thu Mar 19, 2009 3:13 pm
Location: Stockholm

Post by toto »

Hi,
Thank you for your quick answer.

No, I am not looking for a signal generator with PWM. Take a look at the attachments and you will se that I have plottet the output of the accelerometer via the ADC of the PS2203, as I described, together with the theoretical value of the accelerometer. I now want to calculate the scalefactor and bias of the accelerometer. But to do this I want the output to be a nice sine wave, just like the theoretical value. That is why I am wondering if it is a PWM wave that the ADC have produced?

Thank you!
Toto

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hi

The steps in your signal are due to quantisation. It looks like you are only using a small portion of the selected input range. The 2203 is an 8-bit scope, so your input range will be divided in to 256 discrete voltage levels. To minimise the quantisation error, make sure you are using the most appropriate input range.

Hope this helps

Robin

toto
User
User
Posts: 5
Joined: Thu Mar 19, 2009 3:13 pm
Location: Stockholm

Post by toto »

Thank you for your reply. I am using the code that was delivered from you when I bought the scope. Anyway, in the initialization the software sets the "firstRange" to 50mV and "lastRange" to 20V. The range of the scope is the same as the "lastRange". This range is also used in the function "adc_to_mv" when the ADC-count is converted to a voltage.

The thing is that the acclerometer is turned by a motor. I need both the angle of the motor and the output of the accelerometer as often as possible. That is why I am running a block with no_of_samples = 1.

The next level of gain in the array "input_ranges" is 50V, should I try with this as "lastRange" instead?
Toto

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

Hi

You need to specify the range when you call ps2000_set_channel. You need to know the output range of your sensor in order to select the appropriate range.

The available ranges are ±50 mV, ±100 mV, ±200 mV, ±500 mV, ±1 V, ±2 V, ±5 V, ±10 V, ±20 V

It might be a good idea to use PicoScope 6 at first as it can select the range automatically.

Robin

toto
User
User
Posts: 5
Joined: Thu Mar 19, 2009 3:13 pm
Location: Stockholm

Post by toto »

I have now managed to minimize the steps. The output range of my accelerometer is ±5 V so I have set this to be the range of the scope as well. As I said, I have managed to minimize the steps, they don't disappear entirely. But perhaps that cannot be achieved?
Toto

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

That's correct. There will always be steps because it is a digital system.

The steps can be reduced by using a higher resolution scope, such as the 12-bit 4000 series.

You can also use the "resolution enhancement" feature of PicoScope 6 to smooth the signal.

If you are writing your own software, you could look in to oversampling.

Robin

toto
User
User
Posts: 5
Joined: Thu Mar 19, 2009 3:13 pm
Location: Stockholm

Post by toto »

I have now got oversampling to work. The graph does not contain all those steps anymore. I downloaded the updated driver that you had attached in the following thread:

http://www.picotech.com/support/viewtop ... ersampling

One final question though: I only intend to collect one sample every time I use run_block. That is why I set no_of_samples = 1. I have set oversampling to 256, maximum. Since it is collecting an average, does this mean that no_of_samples shouldn't be equal to 1? I saw the table in the thread about oversampling but I didn't understand to much. It said that if I set oversampling = 256 with PS2203 the no_of_samples is equal to 0.

What I want is this: An average of as many samples as possible (suppose oversampling=256), but the run_block should only return one sample. Should no_of_samples = 1 then?
Toto

Robin
Advanced User
Advanced User
Posts: 558
Joined: Fri Sep 19, 2008 10:17 am

Post by Robin »

That's correct, set no_of_samples = 1.

The tables in the post you mentioned show the maximum possible number of samples for a given oversample value. The maximum number of samples you can specify with oversample=256 is 32 (for a 2203).

Robin

Post Reply