Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
Tri-axis accelerometer question

 
Post new topic   Reply to topic    Forum Index -> General
Author Message
victorf



Joined: 01 Jan 2006
Posts: 342
Location: Schenectady, New York

Posted: 24 April 2007, 15:02 PM    Post subject: Tri-axis accelerometer question Reply with quote

I have been looking at the DE-ACCM3D Tri-Axis Accelerometer:

http://www.dimensionengineering.com/DE-ACCM3D.htm

and would like to use it in a project. It is a 3.3v device. If I attach the outputs to three of a ZX-24s ADC inputs which measures the values relative to 5v, how do I interpret the value? This is confusing me.

Any enlightenment will be appreciated.

Vic
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 24 April 2007, 16:54 PM    Post subject: Re: Tri-axis accelerometer question Reply with quote

victorf wrote:
If I attach the outputs to three of a ZX-24s ADC inputs which measures the values relative to 5v, how do I interpret the value?

The fact that the maximum analog output of the attached device is 3.3V doesn't change anything except the maximum value that your application will get from GetADC(). With the function form, the value returned when the device's output is 3.3V is 3.3 / 5.0 * 1024 = 675. Consequently, the range of ADC readings will be 0 to 675. Your application will have to map that range to represent the physical value being measured.

As I read the datasheet, when operating with the onboard regulator the device outputs 333mV/g. Since the ADC of the ZX has a resolution of 4.88mV when operating with a reference of 5V (5 volts divided by 1024 quantization levels) this means that the resolution in terms of the physical quantity is 0.0147g/step ( 5V / 1024 steps / 333mV/g).

If you wanted better resolution, you could provide an external reference voltage to the ZX and operate the ADC manually (instead of using GetADC). If you chose to supply a 3.3V reference, for example, the resolution would be 3.3V / 1024 steps / 333mV/g = 0.0097g/step.

The application note AN-217 demonstrates how to operate the ADC by directly accessing the registers.
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 142
Location: Southern California (Blue)

Posted: 20 April 2009, 7:28 AM    Post subject: Accel & ZX Ref. Voltage Reply with quote

Now I am more confused about accelerometers and the microcontroller analog-to-digital converter. Some background... For the sake of this forum, let:
Vs = Accelerometer Sensitivity (mV/G units)
Vcc = Operating Voltage
Vout = Device analog output voltage
N = Acceleration (in G units)

Considering model DE-ACCM5G:
http://www.dimensionengineering.com/DE-ACCM5G.htm

Vs = 0.312V/G
Vcc = 5V
Range= +/-5G

According to their spec (DE-ACCM5G.pdf), 0G corresponds to Vcc/2, or 2.5V. Therefore, the measured acceleration is as follows:
N = (Vout - Vcc/2)/Vs

Checks:
If Vout=2.5V, then N=(2.5 - 5/2)/0.312=v0G

If Vout=3.06V, then N=(3.06 - 5/2)/0.312= 1.79G (matches spec)

Here is my confusion... the range of the model in question is +/-5G. The corresponding output voltage at +5G is only 4.06V (see calc below), short of 5V as in the accelerometer Vcc and the default microcontroller 5V ADC range.

Vout = N*Vs + Vcc/2

Vout = 5G*0.312V/G + 5V/2 = 4.06V

This means there is a further degradation in resolution beyond the 10 bit ADC quantization. Is this right? Am I missing something? If my reasoning is correct, should the ZX device reference voltage equate to the accelerometer Vcc (+5V) or more appropriately to the voltage corresponding to the accelerometer +5G range (in this case 4.06V)? Thanks.


Liam
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 20 April 2009, 15:53 PM    Post subject: Re: Accel & ZX Ref. Voltage Reply with quote

liam.zbasic wrote:
This means there is a further degradation in resolution beyond the 10 bit ADC quantization. Is this right?
It's not a degradation in resolution, per se. Rather, it is a case where the signal you're measuring does not use the entire dynamic range of the ADC. This means that you have less resolution than you would if -5G were 0 volts and +5G were +5 volts.

liam.zbasic wrote:
If my reasoning is correct, should the ZX device reference voltage equate to the accelerometer Vcc (+5V) or more appropriately to the voltage corresponding to the accelerometer +5G range (in this case 4.06V)?
You can do either; you would have slightly better resolution in the latter case. With a reference of 4.06V, the ADC resolution would be 4.06V/4096 steps = 0.99mV/step vs 1.2mV/step with a 5 volt reference. Note that with a 5 volt reference, each ADC step equates to 0.004G/step. Is that resolution sufficient for your project? If not, you could add some linear circuitry to amplify and shift the analog output so that 0G remains at 2.5V and the minimum and maximum expected G levels do not exceed the 0-5V range.

Say, for example that you expect a G range of +/-3G. Since this is 0.6 of the transducer's output you could feed the output to an amplifier with a gain of 5.0V/(0.312V/G * 10G * 0.6) = 2.67. Of course, the amplification factor affects the 0G value, too, so you would need to apply a negative bias to adjust it back to 2.5V. The shifting factor would be 2.5V - (2.5V * 2.67) = -4.18V. As a check on these values, consider the case of a 3G reading. The transducer output would be 312mV * 3G + 2.5V = 3.44V. Applying the gain factor to that would yield 9.17V and applying the negative bias voltage would yield 4.99V.
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 20 April 2009, 16:12 PM    Post subject: Re: Accel & ZX Ref. Voltage Reply with quote

Liam, I think you are right. But only you can determine if this is a problem or not.

For 5V, the range of input voltages will be between 0.94V and 4.06V i.e. between 19% and 81% of the input voltage. When the supply voltage is reduced, the range is about the same. As it says in the ADXL320 datasheet - the device is radiometric and the output senstivity varires according to the supply voltage. So for example if the supply voltage is 2.4V, the range is 0.525V to 1.875V i.e. 22% to 78%.

For the 5V supply the ADC output values will range between 192 and 832 which is about 60% of the available range. the 10-bit ADC has a resolution of about 5mV which equates to 16mG. If you make AREF 4.06V then the resolution will increase to 13mG and you are still going to lose some range at the bottom end.

You have to decide whether this resolution is sufficient or if you need something better by using a higher resolution ADC.
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 142
Location: Southern California (Blue)

Posted: 21 April 2009, 6:03 AM    Post subject: Reply with quote

Thanks for your responses. Very much appreciated. The DE-ACCM5G was only used as an example. Other accelerometers yield better or worse resolution. That said, I'm a bit confused about your resolution in terms of G per step (dbkinzer calculated 0.004G/step). Here's why...

I think its agreed that the device analog output voltage is:

Vout = N*Vs + Vcc/2

Back to the DE-ACCM5G accel (sensitivity = 0.312V/G, Vcc=5V, Range=+/-5G), at +5G and -5G, the corresponding Vout values are: (assuming ZX reference voltage = 5V)

N=+5G, Vout = +5*.312 + 5/2 = 4.06V
N=-5G, Vout = -5*.312 + 5/2 = 0.94V

The voltage spanning from +5G to -5G (10G span) is:

delta-V = 4.06V - 0.94V = 3.12V
delta-G = +5G - (-5G) = 10G

The corresponding number of ADC steps is:

Steps = 2^10 * 3.12V/5.0V = 639 steps

Therefore, the resolution in terms of G per step is:

G/step = 10G/639steps = 0.016G/step

Am I missing something here? Again, the accelerometer model chosen is only an example, so the resolution value is not germane - its the approach that is important.

Adding linear circuitry (i.e., op-amps) was suggested as a way to improve resolution. As you may well have discovered, I'm not an electronicist, so I find a minimalist but functional approach. Adding linear circuitry probably adds more noise and more variation with temperature to the overall integrated system. I prefer setting the ZX reference voltage (Vref) to a desired value. This may require more circuitry, unless its possible to set Vref using the putDAC function and hooking this channel to AVcc? Is it possible to combine DAC channels to synthesize a voltage beyond 5V? I'd try it if I knew it wouldn't fry my ZX chip. Thanks for your comments.


Liam
Back to top
mikep



Joined: 24 Sep 2005
Posts: 765
Location: Austin, TX

Posted: 21 April 2009, 6:52 AM    Post subject: Reply with quote

liam.zbasic wrote:
G/step = 10G/639steps = 0.016G/step

Am I missing something here?
No. I did the calculation starting from mV per count and then working back to Gs. As you see in my append I calculated 16mG = 0.016G - same as you.

I also showed you that changing AREF to 4.06V only improves the resolution to 0.013G.

You have not told us what the required resolution is. Having a greater resolution may or may not be useful for your application depending on what you are trying to do. You could invest in a 16-bit ADC if resolution is really that important to you.
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 21 April 2009, 16:08 PM    Post subject: Reply with quote

liam.zbasic wrote:
I'm a bit confused about your resolution in terms of G per step (dbkinzer calculated 0.004G/step).
Sorry, my calculation was wrong because I used 4096 steps instead of 1024.

With a 5 volt reference, the ADC has a resolution of 5 volts/1024 steps = 4.88mV/step. Since the transducer generates 312mV/G, it follows that the effective resolution with that transducer connected to a 10-bit ADC with a 5V reference is 4.88mV/step / 312mV/G = .016G/step.
Back to top
liam.zbasic



Joined: 25 Mar 2008
Posts: 142
Location: Southern California (Blue)

Posted: 21 April 2009, 17:13 PM    Post subject: Reply with quote

I appreciate your responses very much. I now understand the scaling.

I don't have a specific application at this moment nor a specific resolution. I did want to understand how to process accelerometer output in order to apply on a myriad of projects including a simple data acquisition unit for vibration testing (up to 100Hz), tilt sensing, a balance bot, and ultimately a vibration suppression system. Some will require more resolution than others, so I was looking for a catch-all (highest system resolution).

For now, I will simply find an accel that yields the best system resolution without adding external circuitry. I'll start with a +/-3G range and at least 250mv/G sensitivity. I'll use a single voltage regulator to modify Vcc (as close as possible) to get an output of 5V at +3G.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> General Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group