I plan on adding this as an option for the next release (so it should be in 2.31 when it comes out). I'll probably leave the current behaviour as the default and add a EEPROM option for avoiding the level on each start. What should the option be called though?
you could call it "save_level" or "store_level" ?
Great - thank you. -this will make it easier to trim trimming the model perfectly for efficient flight.
I agree with Andke.
Bringing a spirit level to my favourite flying spot is a bother, but using it on a damp grass/mud hill is a pain in the butt.
How about naming it : LEVEL_MODE
Perhaps there should be more that two modes.
Where: LEVEL_MODE = 0 NORMAL, Default (works like it does now)
LEVEL_MODE = 1 NORMAL ON POWER UP ONLY. (does not re-level when the reset button is pressed)
LEVEL_MODE = 2 STORED or FIXED or LOCKED (level calibration is done only with Mission Planner)
Maybe an R/C channel could be assigned with a parameter, say, [ LEVEL_TUNING ] for in flight trimming.
Where, LEVEL_TUNING = 0 is disabled and any other value 1-8 or more (APM2.0) represents the R/C channel # that gets used for trimming the LEVEL value stored in the EEPROM for mode 3 or ram for mode 1 & 2. Or just make that a function that Mission Planner can adjust while in flight.
-level tuning by RC channel could easily be dangerous. and should not be necessary - just my 5 cents.
you say : damp grass/mud - I say snow :) exactly why I wish to avoid doing it - also - higher precision.
In hindsight, I agree about mid-air level tuning being hazardous. And it should not be need as it would probably indicated the need to reassess the planes trim condition.
I'm about to go out to the wet & muddy hill soon, and fly APM with firmware 2.28 (in light winds for a change) for one last flight before updating.
Hi - it it included in 2.31 ? - how to use it ?
Tridge, I did that for a head tracker on the imu 3. It works very well. You need to initialize the dcm matrix based accelerometer data. It saves the level settings to eeprom and and just does the gyro offsets on start up works great +/- less than 1 degree. I mounted it on a level tripod so I could move it around..I am pretty good with gimbal stabalizing too . I will pm you some code.
sorry, no, I didn't put this into 2.31. I did the 2.31 release as a quick release for the barometer bug.
I'll add the level support soon!
Thanks - that will be great.
I've now released ArduPlane 2.32 with a new 'MANUAL_LEVEL' option to implement this feature. It defaults to zero, which gives the old behaviour. If you set it to 1 then it will not do accelerometer calibration on startup, and instead will use the last saved values.
Tridge, I haven't looked at the 2.32 yet, but are you using the accelerometers to initialize the DCM? This works very well and would be good for tail draggers that don't sit level.
That is exactly the sort of situation this is useful for. You get a good level for flight and boot with the default of MANUAL_LEVEL== 0. Then you set MANUAL_LEVEL=1
After that you can boot the plane at any attitude. It doesn't matter if its a tail dragger with its tail down, or if its at 45 degrees on its side. It will use the level from when you did the calibration. You do still need to hold the plane as still as you can while it boots, as it needs to learn the zero point for the gyros, but it doesn't matter if it is on its side when you do that.
One of the big advantages is that you will get more consistency between flights. I fly tail draggers a lot and I always found it hard to get the right pitch during startup. It meant that some flights it tended to lose altitude and other flights it tended to gain altitude. Now it should be much more consistent.
There is a potential problem with the accelerometer calibration varying with temperature and even varying between boots but I'm guessing that the size of error caused by not being able to hold a tail dragging in a consistent attitude on every boot will be larger than the temperature/reset effects for many people.