Jump to content


TWOSTEP is in SVN


  • Please log in to reply
4 replies to this topic

#1 Jonathan Brandmeyer

Jonathan Brandmeyer

    Developer

  • Members
  • PipPipPip
  • 46 posts
  • Country: flag of United States United States

Posted 21 March 2011 - 01:12 AM

I've completed the main parts of the TWOSTEP calibration algorithm and merged them into the trunk.  Main conclusions of the work are:
The orthgonal alignment of the magnetometer is excellent, and somewhat better than what you can possibly calibrate out in a reasonable number of samples.  Therefore, it is omitted entirely.  On the other hand, the orthogonality of the accelerometer is just a little bit worse, with a repeatable 1-3% cross-axis scale factor sensitivity.

The scale factor and/or bias of the accelerometer are temperature dependent.  If you calibrate cold, and then warm up the vehicle, the calibration will be off.  Maybe gyro temperature can be used as a proxy for accelerometer temp here?

The TWOSTEP-based multipoint calibration comes in at < 0.5% total error in X and Y, and < 1% total error in Z.

See also OP-191

There is a consistently measurable 2.5 degrees or so of misalignment between the accelerometer and the magnetometer.  Calibrating that out will help with any GPS/INS that attempts to dynamically estimate bias terms for the accelerometer and gyro.  The GCS code computes this rotation vector right now, but I still need to pipe it down to the AHRS and use it there.

Please give the new calibration a try and provide feedback.

Edited by Jonathan Brandmeyer, 21 March 2011 - 01:34 AM.


#2 Sambas

Sambas

    Core Developer

  • Core Team
  • PipPipPip
  • 244 posts
  • Country: flag of Finland Finland


Posted 29 March 2011 - 05:25 AM

I had some troubles getting gyros and magnetics calibrated yesterday. Gyros I solved by setting better gyro_bias init value in GCS (committed patch). Magnetics took 5 tries to get sane values. Homelocation was set correctly. I notised that PFD was working normally when calibration failed while at last run PFD halted like it should I suppose. I suspect calibration command didn't go thru or something. Using Xbee telemetry, total datarate about 2300.

#3 Jonathan Brandmeyer

Jonathan Brandmeyer

    Developer

  • Members
  • PipPipPip
  • 46 posts
  • Country: flag of United States United States

Posted 29 March 2011 - 01:16 PM

View PostSambas, on 29 March 2011 - 05:25 AM, said:

I had some troubles getting gyros and magnetics calibrated yesterday. Gyros I solved by setting better gyro_bias init value in GCS (committed patch). Magnetics took 5 tries to get sane values. Homelocation was set correctly. I notised that PFD was working normally when calibration failed while at last run PFD halted like it should I suppose. I suspect calibration command didn't go thru or something. Using Xbee telemetry, total datarate about 2300.

Can you describe the kind of values that you did get in both the failure and the success cases?

There are three separate and mutually disagreeing places in the source code about the default values for calibration scalars and offsets.  In they gyro bias case the AHRS source code has one set of initial values (24), the UavObject XML for AhrsCalibration has another (23), and the ahrs calibration widget in the GCS has yet another (28).  So, are you sure that the one you programmed into the GCS is correct?  If so, can you update the other two locations for this value?

#4 Sambas

Sambas

    Core Developer

  • Core Team
  • PipPipPip
  • 244 posts
  • Country: flag of Finland Finland


Posted 29 March 2011 - 02:08 PM

View PostJonathan Brandmeyer, on 29 March 2011 - 01:16 PM, said:

Can you describe the kind of values that you did get in both the failure and the success cases?

There are three separate and mutually disagreeing places in the source code about the default values for calibration scalars and offsets.  In they gyro bias case the AHRS source code has one set of initial values (24), the UavObject XML for AhrsCalibration has another (23), and the ahrs calibration widget in the GCS has yet another (28).  So, are you sure that the one you programmed into the GCS is correct?  If so, can you update the other two locations for this value?

With gyros, failed calibration gave gyro bias values +-23ish which made gyro values look like +-400 deg/s. With mags I don't remember exact values, but after discussing with James in irc he said Homelocation.Be vector length should be same as mags values length (sqrt(x^2+y^2+z^2)). My be length is 507, couple times I got mags lenght ~240 and ~1000. With successful calibration I got 506.

Old gyro_scale was 0.014 and then 23 was about correct value for gyro_bias. I would like to hear others to give some feedback.

#5 peabody124

peabody124

    Crash Dummy

  • Administrators
  • 4095 posts
  • LocationHouston, TX
  • Country: flag of United States United States


Posted 29 March 2011 - 02:32 PM

A better starting point for the initial gyro scale is 0.017 which is why the bias now is ~28.  This should be in the .xml file and I just patched it (sorry, recalibration for all I'm afraid).

The default values in the ahrs.c code really don't matter, just something not insane to blow up the filter before the uav object values get propagated.

I asked Sambas to change the initial gyro bias now to 28/0.017*gyro_scale (i.e. 1647 ADC value times the scale) so that if someone has a custom scale this won't occur again there.

However the gyro issue doesn't seem to explain the mag calibration errors.