FreeSpace Autopilot Crash!


I rarely crash. Maybe I've been lucky? I had been ignoring a bug for the longest time only to have it occur just as I was over the trees ready to land. There was no time to recover.

Toward the end of the video you can see the crash. The plane is trying to follow a runway beam but winds up oscillating back and forth and eventually tip stalls. The only thing that saved me from ending up on the roof of the barn was accidentally flipping on the autopilot for 1/4 of a second as I was in a panic flipping every switch.

My beamfollow is what I suspect caused the crash. It works like this:

1) The "beam" is created and basically defines a path to follow. It is assigned a bearing.
2) I get the distance from the aircraft to the beam. 30m out the bearing command is perpendicular to the beam. As the aircraft gets nearer and nearer, the bearing command converges to the actual beam bearing
3) The aircraft follows the beam bearing by feeding the bearing error into the bank command (The aircraft simply banks toward the bearing)

If the aircraft is going decently fast, there aren't any issues. But something oscillates when I go slow, and especially when I just hover in the wind making no progress as in this video.

So the two bugs are:

1) Beamfollow oscillations induced by low airspeed
2) Altitude was lost making all the turns, making recovery impossible.
3) Probably flying 30 feet above the treetops in gusty winds made for all sorts of funky air currents.

I've learned 2 things from all this:

1) Don't ignore strange behavior. It WILL happen near the ground one day.
2) FAILSAFE MODES! Plane should recognize dangerously low altitudes or oscillations and enter a wings level climb and alert the user.

The damage? Stripped aileron servo gears, Cracked left aileron, busted pitot tube, chipped prop, and a few cracks on the fuse. She'll fly again in a few weeks!
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Developer

  • Developer
    Vstall doesn't change with respect to ground speed so why should the bang angle contraint change. Assuming you are holding airspeed constant? Vstall is a bunch of numbers specific to the aircraft x (1/cos(phi)).

    Basically you know Vstall because everything in the equation is constant minus bank angle.

    V = sq root (Wx(1/cos(phi)) x 9.81/(1/2rho x S x Cl_max))

    where:
    V = Stall speed M/s
    p (rho) = air density KG/M^3
    S = wing area M^2
    Cl_max = Coefficient of lift at stall
    W = weight KG
  • One question remains: It makes sense to me to do this based on ground speed. But you don't want to bank too steep at lower airspeeds, which this doesn't really address. Perhaps an additional step of limiting bank angle in the same way based on airspeed is the ticket.
  • Developer
    Glad I could help - just put my name on anything you use ;)
  • @ Ryan - Found your paper http://dl.dropbox.com/u/2884350/Improved%20Heading%20Hold%20Control... to be quite awsome.

    This morning my idea was to simply scale the bank limits and gain by v^2, but the added atan() drives it home. I will probably do your technique to not only the actual command, but to the bank angle limits as well. This would make sure even manual control of the aircraft didn't bank too steeply for slower airspeeds.
  • Developer
    did you see my code I posted....It is at the bottom of the post but here it is also.

    http://dl.dropbox.com/u/2884350/Improved%20Heading%20Hold%20Control...
  • @Ryan - Ok, you're the man. Your video completely explained the problem to me as well as the solution. I love the idea of linearizing the output. IE - We want to command a turn rate, so take the turn rate and run it through the usual aero formula that gives us the bank angle and feed that into the ailerons.

    You did psi_dot (yaw rate) but I think the same could be done with commanding a turn radius. (I don't have the formula that gives psi_dot from bank angle, so I will do it with turn radius for now...

    See this: Banked turn in aeronautics section http://en.wikipedia.org/wiki/Banked_turn

    Formula is this: turn radius = v^2 / g * tan(bank_angle), rearranged to give bank_angle = atan(v^2/r*g)

    So... I just feed the output of my controller into "r" and I have my bank angle. This would completely knock out velocity from affecting anything.
  • @Ryan - I think you're noticing that the overlay is out of sync with the video. That's a known issue I've yet to address.
  • @ken - No, that's a cheap chinese camera... it never holds the correct date/time.

    @Ryan - I agree. It seems that the key is that you can't bank as much for slower airspeeds, and that since the radius of your turn scales with velocity^2, you just scale down your max bank with airspeed. It's unintuitive to me, since most gains scale down as you INCREASE speed, not the other way. This is definitely the first gain that doesn't follow that rule that I've come across.

    Thanks for pointing me at that post! Seems like I'm running into a similar issue.
  • Developer
    http://diydrones.com/profiles/blogs/improved-heading-controller

    You have to have lower gains for lower speeds. There are a couple of ways to pull it off, but I like my method.

    -Also, it looks like your attitude estimation was the problem. It starts to diverge it seems like?
This reply was deleted.