I'd like to save "level" just like multirotor - to be able to boot up APM at any angle, instead of having to level up the plane before each boot.

how can that be done ?

Views: 324

Reply to This

Replies to This Discussion

Tridge, I just looked thru 2.32 specifically for the level thing. Maybe you did,t see my previous comment here.  I did this this on my head tracker on a imu v3. You need to have a < g.manual_level == 1>. Wait for gyros to get their offsets, and then trig the accelerometers and plug that into the <Matrix3<T>::from_euler> and initialize the DCM with that matrix.

Cheers, Greg

Hi Greg,

I see what you mean, but that's very much a second order effect. The time constant on the PI controller in DCM is just a few seconds. So even if you startup with the plane upside down it gets the right attitude in a few seconds with MANUAL_LEVEL==1. I just tried it, and from upside down it works things out in 9 seconds. From a 20 degree tail dragger pitch it takes 3 seconds to get the right attitude after booting. I don't think many people will manage to take off within 3 seconds of booting.

The only problem with this is that it pushes omegaI off by a small amount, but we have a slope limit on that, so it doesn't matter much. omegaI matters on the order of minutes, not seconds.

I could do the from_euler() or just ask DCM to advance the omegaP by a big factor for a second after startup, but it's not a big deal.

There is one situation where it does matter, and that is an airstart. In that case those few seconds could cost you the plane, but that applies regardless of the setting of MANUAL_LEVEL. So it would be nice to have a ahrs.fast_level() function that pushes up _kP by a factor of 10x for the next second. We could call that on airstart as well as startup with MANUAL_LEVEL==1.

I don't think using trig on the accels isn't the right solution btw, as it won't work in all attitudes. Pushing up _kP is a much better bet, as that uses the normal maths for correcting attitude, and just runs it faster for a while.

Cheers, Tridge

Tridge, You're right, it wasn't an issue so it wasn't needed. I did for head tracking googles. I had plans for making a level fixture with a bubble level on it an I had a light bulb moment above my head. I have a digital gravimeter. Leave the goggles still for the init and then the thing is ready to go. It freaked me out how accurate it was. I mounted it on a cam tripod for calibration and testing. I need to make a video. And I did a manual mag calibration and also did a mag scale normalizer.

Cheers, Greg

Hi Greg,

I think we should fix it for airstart though, and if we fix it there, we may as well use the same method for MANUAL_LEVEL=1.

Do you want to try putting together a patch that adds a ahrs.fast_level() function? The way I imagine it would work is:

  • add a new _kp_fast variable in AP_AHRS_DCM.h, default value 0
  • multiply _kp_fast by 0.95 in every drift_correction() call to decay it
  • wherever we use the _kp values now (there are two, one for roll/pitch, one for yaw), instead use _kp_foo + _kp_fast
  • add a AP_AHRS_DCM::fast_level() function that just sets _kp_fast to _kp_roll_pitch * 20

Then we can call ahrs.fast_level() on airstart and when MANUAL_LEVEL is 1. It will very quickly get the right level on startup, even if there is lots of vibration.

This could save someones plane someday, as right now if you airstart (ie. APM reboots unexpectedly in the air) then the attitude could be way off for several seconds. That is enough time for it to crash.

Cheers, Tridge

That would cover every thing. I just thought being still during start up would take care of the G and at least the gyro offsets would calibrate. An air start???  I will think about it.

Hi, thank you very much.

Looking forward to test it later today.

RSS

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service