How to calibrate mavproxy accelerometer on SITL X Plane?

Hello,

I’m using Mavproxy on a Linux Ubuntu virtualbox on Windows 7. And I’m connecting X Plane to mavproxy. When I try to use the arm throttle command it tells me I need to calibrate the 3d accelerometer, but how to I do the “hold plane level” procedure with x plane?

Thank you

There’s no function in SITL to calibrate the accelerometer. Instead, the accelerometer offset parameters need to have small values to fool the preflight checks that a calibration has already been done.

There’s a parameters file for SITL in ./Tools/autotest/ArduPlane.parm in the Ardupilot source code. Use that for your parameters and you shouldn’t get the error.

I checked the ./Tools/autotest/ directory and there isn’t any file named ArduPlane.parm.

I found the .parm files in ./Tools/autotest/default_params/

I got it working, thank you.
I had to change the “etc/defaults.parm” directory in the sitl.h file to the correct directory.

Or you can add --defaults THEPATHTOTHEPARAMFILE, to make it get the right param file !
Otherwise the use of sim_vehicule.py will get the default param for you

So, I downloaded the newest version of Ardupilot, and now I’m getting the same error again and I have no idea why.

I am running into the same problem too. Its preventing my mission basic python script from running because it gets stuck in waiting to initialize. The odd thing is I am only having this problem when x plane is running…

for example if I only run sim_vehicle.py and send my python script to sim_vehicle everyone is happy.

when I do the steps above but have x plane running i get this prearm 3d calibration problem

I think I have a brute force solution!!!

I am running everything on ubuntu so I downloaded qgroundcontrol

Run qgroundcontrol
Run sim_vehicle.py
qground will connect automaticaly via 14550
find the parameters tab in qgroundcontrol
then set the following from the plane.parms file:
INS_ACCOFFS_X 0.001
INS_ACCOFFS_Y 0.001
INS_ACCOFFS_Z 0.001
INS_ACCSCAL_X 1.001
INS_ACCSCAL_Y 1.001
INS_ACCSCAL_Z 1.001
INS_ACC2OFFS_X 0.001
INS_ACC2OFFS_Y 0.001
INS_ACC2OFFS_Z 0.001
INS_ACC2SCAL_X 1.001
INS_ACC2SCAL_Y 1.001
INS_ACC2SCAL_Z 1.001
INS_GYR_CAL 0

This at least got rid of 3d accel call needed and bad AHRS.

Now off to the next problem why my python app is stuck in waiting to initialize…

Hope this helps

1 Like

my xplane don’t armed erro message accel calebration how to fix

Hi, I have set these params as the default and have verified they are being loaded properly, but I am still getting the error. Does anyone have any idea why this might be?

Okay, so I started digging around in the source, and I found a few things.

First, I had used a set of parameters from a post I found where the offsets where set to zero, and apparently it checks for this because exactly zero offsets are very rare. Then, I had changed the offsets to 0.001, which took care of that problem.

But, I added extra parameters because the SITL has an extra accelerometer that it is not using, and it turns out the code also checks to make sure that unused accelerometers have zero offsets, so the number 0.001 caused a problem. After I got rid of the parameters for the 3rd (unused) accelerometer, and set the offset to 0.001 for the 2 in use, this error went away.

You can suppress calibration on arming in the Ardupilot parameters somehow. I can’t recall directly how I did it but I remember it being an option.