Go Down

Topic: Guide to gyro and accelerometer with Arduino including Kalman filtering (Read 313 times) previous topic - next topic

AntR

I'm using this sensor combination (FreeIMU 0.3.5MS) also - you can just feed the raw values from the BMA accelerometer into the filter.  There's no need to scale the sensitivity, although it makes no difference if you do.  Also, if you're using up to 4G sensitivity, there's no need to calibrate (ie subtracting the offsets).  The BMA seems to have a fairly accurate calibration I've found.

cristo829

So you changed this:
gyroX = analogRead(gX);
  gyroXrate = (gyroX-gyroZeroX)/1.0323;//(gyroX-gryoZeroX)/Sensitivity  Sensitivity = 0.00333/3.3*1023=1.0323   
  gyroXangle += gyroXrate*dtime/1000;

to this?

(read x value on i2c gyro)
gyroXrate = (gyroX-gyroZeroX)
gyroXangle += gyroXrate*dtime/1000;

Im building a qudcopter, how many Gs do you think is a good idea to use on the BMA? Also, have you programmed the Magnetometer on your IMU im having some trouble with the tilt compensation, my measurement varies within 10 degrees when i tilt it which is finw for me, except when i tilt it to one specific side when i tilt it that way it varies something like 40 degrees is this normal?
Thanks for your help

AntR

I'm using 3G for my quad, this seems to be a good compromise between pitch/roll accuracy and sensitivity to noise.  If you try 1.5G, you might find it too sensitive to vibrations.

I have used the mag,  I have to calibrate it by working out the offsets.  The best accuracy I've got has been a calibration with the sensor in place and all four motors running (without props on obviously).  I get pretty good stable results with the MARG algorithm as part as the FreeIMU library, but I haven't recently tried tilt compensation calculations with my current offsets so can't really comment on how well this works.

Your gyro code looks ok to me.


So you changed this:
gyroX = analogRead(gX);
  gyroXrate = (gyroX-gyroZeroX)/1.0323;//(gyroX-gryoZeroX)/Sensitivity  Sensitivity = 0.00333/3.3*1023=1.0323   
  gyroXangle += gyroXrate*dtime/1000;

to this?

(read x value on i2c gyro)
gyroXrate = (gyroX-gyroZeroX)
gyroXangle += gyroXrate*dtime/1000;

Im building a qudcopter, how many Gs do you think is a good idea to use on the BMA? Also, have you programmed the Magnetometer on your IMU im having some trouble with the tilt compensation, my measurement varies within 10 degrees when i tilt it which is finw for me, except when i tilt it to one specific side when i tilt it that way it varies something like 40 degrees is this normal?
Thanks for your help


Almost Scientific

Hello everyone --

I'm really glad to find this thread so active.  I'm currently working on a project that involved tracking the orientation and position of an object.

I've got an ADXL345 accelerometer, ITG-3200 gyro and an HMC5883L magnetometer. 

I've gotten Fabio Varesano's awesome code working which is giving me great position information.

But I'm hoping someone on this thread can point me to some code that I can use to get a good measurement of velocity so I can calculate position.

Thanks in advance.


Go Up