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?
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?
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.
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?
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.
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?
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:
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?
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).