Sloppy altitude control in loiter

Hi all, this is a problem I have seen with both of my pixhawk-equipped drones: During loiter if I do some maneuvring (semi-aggressive yaw while forward flight or something) my quad will lose atitude to the point that I have to give aggressive throttle up in order to save it from touching the ground. It doesn’t seem like altitude control is as locked-in as I’d like. From what I can understand the idea is that the unit should attempt to keep current altitude as long as the throttle stick is centered or within the deadband range around center when in loiter. I find that when testing this by flying 3-4 meters above ground it will loose too much altitude and get dangerously close to ground. I have more than enough power in my unit (hovers at about 40% stick), I just get the impression that arducopter prioritizes control input in the horizontal plane more than in the vertical plane. IMHO it should be the opposite, avoiding hitting ground should be more important than reacting to horizontal movements. In any case my unit has more than enough power for both. Is there anything I can tune to make my unit keep its altitude more precisely? What alt range should I expect from my unit? Comparing with my old phantom 2 that unit is able to hold altitude extremely well… Any pointers appreciated!

Don’t know what your copter looks like which effects how it flies. Altitude will drift by 10 or 15 meters based on conditions. Since altitude is controlled by air pressure if you fly in one direction the copter may build up air pressure and cause it to rise or if its on the back side may cause a vacuum and it will fall. If the copter is fully enclosed like the Phantom it should not have this problem.

Thanks for replying!
So 10-15 meters of variance is considered acceptable? I’m within that I guess, but it still seems a lot.

Does this mean that ArduCopter will give more weight to the pressure sensor than the GPS? Since Loitering already requires a GPS and I never Loiter without a HDOP above 1,5 (not sure about my VDOP) I would assume that GPS is more precise than the pressure sensor, except for when the craft does micro-adjustments.

I’m currently running a Quanum XJ470, the Pixhawk unit is pretty open and would probably be subject to wind.

Yes, very little weight if any is given to the GPS altitude. GPS altitude is not very reliable in most cases. Loiter only uses the GPS for position and not altitude.

Mike

Thanks Mike. So I tested again just now, and you are correct, it does indeed correct itself. Funny thing is: If I do some semi-agressive maneuvring it loses height. When I let go of the sticks it will slowly ascend a little bit, so its like it is aware of the fact that it is losing a little bit of height, but it prioritizes right-stick/yaw behavior over throttle. As long as I have more than enough power in reserve, why doesn’t it just keep the desired altitude at all times instead of allowing itself to lose alt and then compensate after I’ve stopped?

Maybe I’m too picky here, maybe the pressure change after stopping causes it to realize its too low. I haven’t looked at the logs yet.

That topic has been talked about before. The copter is doing what you ask and does not hold altitude but do what you want and fly faster. You can adjust the lean angle to not allow it to lean as far which will also reduce the forward speed but will help to keep altitude.

Mike

Thanks. Do you happen to remember which forum it was discussed in? I could understand the logic if the copter was at max power, but as it isn’t I don’t understand why it doesn’t both fly faster and keep its altitude.

https://groups.google.com/forum/#!topic/drones-discuss/SwnE_luqLiY

I’ve been reading up a bit, and for me I got good results from changing the EKF_ALT_NOISE parameter to 7, giving less weight to the pressure sensor and more to the GPS. I’m running a good GPS on this unit (ublox m8n), and also reduced the GPS_HDOP_GOOD value somewhat to make sure I have a good quality GPS lock before I can use any flight mode requiring the GPS. The first tests were promising, I can’t see any altitude loss when maneuvring in loiter mode now. Will continue testing tomorrow.

Altitude can drop, particularly with fast flying, My APM controlled F450 does this regularly. However I have never seen anything that dropped 15 meters. 10-15 feet perhaps. So, no, I don’t think 15 meters is considered acceptable. If I were that bad I would be looking for another flight controller.

If you’re interested in a fix this might give a clue how to go about that.

Had this happen to one of my APM 2.6 flight controllers, after months of normal flights.

Tried reloading the firmware, reinstalling the default config, different GPS, … Nothing worked.

Finally figured that the barometer (used as the altimeter) on the flight controller had failed.

Sure enough… A new flight controller (this time I upgraded to a APM 2.8 with side connectors).

Used the same everything else. Now it’s stable as a rock. (And when I say stable as a rock… less than 1" movement in any direction, or up/down, even with wind.)

you can solve? I have the same problem. how can I know if there is something wrong with the barometer of my controller?

It may worth to disassemble plastic enclosure and to check/fix APM in a following way:

  1. MS5611 barometer chip needs to be covered by a piece of foam to protect it from airflows and wind gusts. Put there some light and soft foam in case there is no foam installed on top of chip. Don’t glue it.

  2. MS5611 barometer chip is sensitive to the light and even LEDs on APM board able to introduce measurement bias. So it is good to use not just a foam but dark and moderately dense foam.

regards,
Dmitry