I using a MPU 6050 and raspberry pi pico for making an IMU. I have set the range of accelerometer as +- 2 g but there is a .96 g offset this severly limits the sensing range on the positive side. I have written a calibration program which works fine in which we explicitly add the offsets to the data `
def calibrate(i2c):
temp=0
accel_x,accel_y,accel_z,gyro_x,gyro_y,gyro_z=0,0,0,0,0,0
for i in range(10000):
temp += read_raw_data(i2c, TEMP_OUT_H) / 340.0 + 36.53
accel_x += read_raw_data(i2c, ACCEL_XOUT_H) / 16384.0
accel_y += read_raw_data(i2c, ACCEL_XOUT_H + 2) / 16384.0
accel_z += read_raw_data(i2c, ACCEL_XOUT_H + 4) / 16384.0
gyro_x += read_raw_data(i2c, GYRO_XOUT_H) / 131.0
gyro_y += read_raw_data(i2c, GYRO_XOUT_H + 2) / 131.0
gyro_z += read_raw_data(i2c, GYRO_XOUT_H + 4) / 131.0
print('calibration done')
t=temp/10000
a_x=accel_x/10000
a_y=accel_y/10000
a_z=accel_z/10000
g_x=gyro_x/10000
g_y=gyro_y/10000
g_z=gyro_z/10000
is there any way in which i can calibrate the sensor and still get full range?