paparazzi-devel
[Top][All Lists]

## Re: [Paparazzi-devel] re:razor imu

 From: Felix Ruess Subject: Re: [Paparazzi-devel] re:razor imu Date: Thu, 10 Feb 2011 13:46:23 +0100

Hi Ana,

I fixed the periodic send macros, thanks for catching that!

As mentioned in an earlier mail you have to take the binary fixed point fraction into account, i.e. you have to convert your sens value into BFP with the appropriate number of shifts (e.g. 10 for accel).

So for the accel sens you get something like:
acc_sens = (Vref / adc_resolution-1) * ( 2 * sensor_range_in_g / Vmax_sensor) * 9.81m/s² * (1<<INT32_ACCEL_FRAC)
acc_sens = (3.3V / 1023) * (2 * 5g / 3.3V) * 9.81m/s² * 1024 = 98.195894428

Can you be a bit more specific about the problem with the calibration script?
You might need to install python-scipy and python-matplotlib if you don't already have so.

Cheer, Felix

On Thu, Feb 10, 2011 at 8:45 AM, GARCIA ALVAREZ, ANA wrote:

So,

The IMU_SENS and ACCEL_SENS are written in floating point. And they convert the ADC values in SI physical magnitudes. Furthermore, the real magnitudes are obtained via: real magnitude=sens*(adc value-neutral)

For the accelerometers, I have obtained the following parameter:

Sens=(3mv/step)*(g/330mV)*(9.8m/s^2/g)=0.0883m/s^2/step

For the gyros with a similar operation I obtain 0.0158663rad/s/step

But with these parameters, the IMU doesn’t react...it’s like they are too small…

I have tested with different sens values, and have found ones which make the PFD react more or less according to the inclinations I apply…but after some seconds it looks like the IMU fixed another position as zero…I have read something about gyro drift, but don’t know if that is what I’m experiencing.

On other hand, I was watching only the ACCEL_RAW and GYRO_RAW messages with the message agent. I have looked into messages.xml and can see they should be the unscaled values, but I think I see the unscaled values-neutrals(with sens=1)…but when I add a sens parameter different to zero, instead of the unscaled values I see (I guess sens*(unscaled-neutral))…and then I have also looked into the ap_downlink.h:

#ifdef IMU_TYPE_H

#include "subsystems/imu.h"

#define PERIODIC_SEND_IMU_ACCEL_RAW(_chan) { DOWNLINK_SEND_IMU_ACCEL_RAW(_chan, &imu.accel_unscaled.x, &imu.accel_unscaled.y, &imu.accel_unscaled.z)}

#define PERIODIC_SEND_IMU_GYRO_RAW(_chan) { DOWNLINK_SEND_IMU_GYRO_RAW(_chan, &imu.gyro_unscaled.p, &imu.gyro_unscaled.q, &imu.gyro_unscaled.r)}

#define PERIODIC_SEND_IMU_ACCEL(_chan) { DOWNLINK_SEND_IMU_ACCEL_RAW(_chan, &imu.accel.x, &imu.accel.y, &imu.accel.z)}

#define PERIODIC_SEND_IMU_GYRO(_chan) { DOWNLINK_SEND_IMU_GYRO_RAW(_chan, &imu.gyro.p, &imu.gyro.q, &imu.gyro.r)}

#else

#define PERIODIC_SEND_IMU_ACCEL_RAW(_chan) {}

#define PERIODIC_SEND_IMU_GYRO_RAW(_chan) {}

#define PERIODIC_SEND_IMU_ACCEL(_chan) {}

#define PERIODIC_SEND_IMU_GYRO(_chan) {}

#endif

And as far I as can understand, it’s like the messages IMU_ACCEL_RAW and IMU_ACCEL are mixed…

I have tried changing in the IMU_ACCEL, the DOWNLINK_SEND part to DOWNLINK_SEND_IMU_ACCEL (without the raw), and then I always see the raw values in the raw message…the problem is that in the other messages IMU_ACEL and IMU_GYRO I see “nad” or something like that, I can’t remember exactly.

Sorry it’s such a long message…but I am still trying to make the IMU run, and wonder if I have some hardware issue(I don’t know if I should remove some resistors in the IMU-but feel that this is not the problem), or if I am not well understanding the sens parameter, if calibrating the IMU is not a simple question…

Next steps I’ll take will be testing the software branches supposed to work with the IMU(when I first tried them there were errors while compiling)and trying the calibration tool…I don’t know which programs are supposed to be installed to run the script, only python? When I run it by now, I get two nice pictures of my desktop, and nothing more.

_______________________________________________
Paparazzi-devel mailing list