# TinyCircuits

## TinyCircuits Products => TinyDuino => Topic started by: jeejoyi on February 19, 2016, 07:36:00 PM

Title: 9 Axis IMU Tinyshield Gravity in Acceleration?
Post by: jeejoyi on February 19, 2016, 07:36:00 PM
Hi, I have a 9 Axis Tinyshield IMU and whenever I use it doesn't seem to be calibrated. When idle, the values always add up to 1 (i.e. 0,0,1; 1,0,0 etc.) It seems that instead of being all 0's one has a value of 1 and is not calibrated. Is there a way to fix this? Also, is there a way to add acceleration due to gravity in the readings? Thus at idle it would be something like (0,0,9.8) instead of just all zeroes. I cannot find out a way to do this in the example code. I can't find a configuration or anything like that.

Title: Re: 9 Axis IMU Tinyshield Gravity in Acceleration?
Post by: Ben Rose on February 20, 2016, 01:29:38 PM
Hi,

Can you tell me exactly what code you're using? Our codebender example has a default output that looks more like 'Pose: x:7.41 y:4.76 z:-89.00'

Thanks,
Ben
Title: Re: 9 Axis IMU Tinyshield Gravity in Acceleration?
Post by: jeejoyi on February 20, 2016, 02:15:13 PM
I'm using the codebender code still but instead of using the pose output I am using the commented out RTMath::display("Accel:", (RTVector3&)imu->getAccel());
Title: Re: 9 Axis IMU Tinyshield Gravity in Acceleration?
Post by: Ben Rose on February 22, 2016, 04:58:47 PM
Alright- looking at the accelerometer output, it seems like what you want- just presented in units of gravitational force, rather than in m/s^2. You could scale it by multiplying by the gravitational constant, or use the unit vector as is. I definitely see ~0.69 in two axis when the board is at a 45 degree angle, ie a bit below(sensor error plus board not being perfectly flat in third axis) sin/cos of 45 degrees. Let me know if this doesn't check out.
Title: Re: 9 Axis IMU Tinyshield Gravity in Acceleration?
Post by: jeejoyi on March 02, 2016, 03:24:46 PM
Thanks, this clears things up for me.