Hi there!


I've always wanted to take part in arduplane development, so I finally have chance to do it =)


Here you can find info on how to do the same http://diydrones.com/profiles/blogs/how-to-contribute-to-a-diy-dron...


I have chosen this one -

8) Minimum altitude feature for modes >= FBW - Add a feature where the user can specify a minimum altitude that the autopilot will not go under when in higher modes

just because I was implementing some anti-crash functions on my own.


So here my little demo. APM is in FBW-B mode and I hold pitch all the way DOWN! until the very end of video. The jumps you will see is my code bringing the plane back to safe altitude. Minimum alt was set 30 meters above home altitude, so you can see ground. Enjoy and post your ideas!


UPDATE: Here is new video (new algorithm, no jumps): 


And my patch has been applied to the ArduPlane source! =))) Man, I wish I could have a job related to drones...

Views: 1017

Comment by Mike on October 5, 2011 at 8:59am

Nice work!


I'm curious about the "jumps" though... In FBW if you have the max bank set to 45degrees and you put full left stick it will only take it to 45degrees and stop there... So with the minimum altitude set at 30m and holding the stick down shouldn't the plane level out at 30m and effectively hold that altitude? Perhaps even as it approaches 30m the elevator slowly goes back to center on its own?


Or would this be its own set of PIDs to tune?

Comment by YureZzZ on October 5, 2011 at 9:18am

Hmm could be nice idea - let me try that =)

Comment by Doug Weibel on October 5, 2011 at 10:20am



I am not sure what approach you have taken, but I agree that it should not jump.  However, that effect could be caused by poor gains in your xplane sim (or possibly it is just due to the way you are trying to implement this function).  Check that your pitch_comp is tuned reasonably well.  You should not loose much altitude when making turns in FBW if it is tuned properly.

Comment by YureZzZ on October 5, 2011 at 11:00am

Doug! Jumping was caused by my implementation. Thanks to Mike I did a new one which is nice and smooth. I didn't make roll cancellation at min alt for now, I think it is pretty stable during sharp turns as well. I've tried to crash it and right now just one thing can make it touch the ground - yaw control. Will be looking into that. As for now here is demo of new version. (yes, you will notice some slight jumps - don't worry that is me moving the plane back and forth. my code doesn't have that jumps anymore).


As for YAW - how it should be handled in FBW-B mode? Isn't it supposed to be ignored?

Comment by Mike on October 5, 2011 at 11:17am

You said: "here is a demo of the new version", but I'm having a hard time finding that... The video in this post appears to still be the original "jumping" video. Am I missing something?

Comment by YureZzZ on October 5, 2011 at 1:42pm

Sorry for that. Now I've added video to original post.

Comment by Mike on October 5, 2011 at 1:57pm

Thats pretty cool, and it will definitely come in handy to help train newcomers to the hobby.


Just curious, did you try climbing to several hundred meters and do a straight down dive into the ground? I realize FBW has a min/max pitch limit, but as a test if you bump that up to 90degrees and attempt this, is recovery possible with your code?


Also, if this is enabled during auto mode, I assume the "land" command disables it?

Comment by YureZzZ on October 5, 2011 at 2:18pm

Nice to know that it is useful =)


I did try to climb around 100 meters up and then push stick down - FBW limits it nicely and my code stops the descend.


90 degrees dive? Let's try it! But for that I have to disable FBW limits. I'll post video when I can.


For now it is still beta, so it activates only in FBW-B mode.

Comment by YureZzZ on October 5, 2011 at 2:57pm

About that 90 degrees dive - well I've tried to fly in manual, climb few hundreds then dive down with roll and just close to ground I engage FBW-B mode and it is recovered. Also same thing happens with stabilize mode, with small difference - my code+FBW-B will automatically climb to desired height after recovery. Sorry - no video here, my machine goes laggy when recording in dive.


So this concept proves that it works with recovering from bad situations, BUT as long as we have some extra height to do the maneuver.


Still one question unanswered - what suppose to happen with yaw, when user move the stick? Also I need to find the way to disable manual yaw control when near the limit. For now it is the only control which can crash the plane if used together with ailerons.

Comment by Mike on October 5, 2011 at 3:34pm

FBW doesn't prevent extreme YAW input just like roll input?


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service