Wednesday, April 03, 2013

Teaching a computer to fly...


For this years spark fun AVC I'm planning to bring both a Car and a Plane. The Car is primarily last years car upgraded with a lower center of gravity and a much much better GPS.    The plane is a different story...
As part of the Lunar Lander Challenge  I built an autonomous helicopter to test  out my code.  Right now I have a vectored thrust rocket I'm flying as well, all in all these two efforts have the actuators and response of the vehicle fairly well coupled and tight.   a rocket or helicopter is a brute force thing that beats the environment into submission. An airplane is a gentle elegant creature. I 've been a pilot since I was a teenager, and when I look at most of the open or openly discussed UAV autopilots out in the world it strikes me that a lot of the people working on them don't understand this distinction.    

I have a copy of x-plane 10 with I'm using as a simulator for the autopilot development.
I've set this up as a hardware in the loop simulator and I've been slowly teaching the NetBurner to fly.
Much  like my Dad taught me to fly a long time ago.

  • Manage your airspeed, 
  • Coordinate your turns, 
  • Hold a heading, 
  • Hold an altitude,  
  • Make smooth level turns...
  • Turn to a heading...


Now learn to do all of the above while climbing, descending, accelerating, decelerating, you have a precision tool with the grace of a light saber, feel the grace.  If the engine dies it should still be in control when  glides gently to earth.....


 An airplane can be flown with a single axis rate gyro,  anyone that has passed a partial panel IFR checkride understands this.   I have all the rate gyro integrating quanterion attitude estimaters that everyone else has.... alas most of this is not needed you can do everything you need to do to control the airplane with airspeed , rate of turn, magnetic compass and altitude.

The interactions can be subtle... does the throttle control speed? does it control altitude? what variable does it control? How about energy.....  I found this paper to be especially good on this point.

The basic bottom level  control laws are simple....

Inputs:
Desired Airspeed
Desired Heading
Desired Altitude (or rate of climb)

Sensors:
Pitot AirSpeed (IAS)
Magnetic heading
Rate of turn.
Altitude (either baro or GPS driven)


The controls are simple...
The elevator is controlled with Airspeed  and TargetAirspeed
The rudder does nothing more than keep the "Ball" centered in flight or the aircraft on the runway on takeoff.
The Aileron is controlled by rate of turn, magnetic heading and target heading
The throttle is controlled with the current energy state  ie airspeed ^2 and altitude vs their target values.
(I've also found it useful to have a bit of feed forward from turn rate to throttle to add a little power in the turns)

In any case I'm having fun writing this....







10 comments:

Anonymous said...

Ahh... memories of UPT.

Ben Brockert said...

How are you measuring IAS on an R/C plane?

Paul Breed said...

Pitot tube as primary and GPS as backup....

Specifically:
http://store.diydrones.com/Kit_MPXV7002DP_p/kt-mpxv7002dp-01.htm

RemoteOp said...

http://www.nasa.gov/pdf/732725main_crash_course-ebook.pdf

Andy said...

Very interesting. Good description on the controls.

Info on your rocket control?

heroineworshipper said...

Would just copy the arduplane source code to the custom board for this. Most helicopter autopilots got started by copying the rotomotion autopilot. The single gyro autopilot is the 1st step in a very long process of wheel reinvention.

Anonymous said...

Playgrounds help children get outside to enjoy the fresh air and the sun. Playing outside is a great way to get children to exercise and to socialize, but there’s a pretty big danger for anyone who looks up. Schools in Dubai can easily install shades from sun shades manufactures in Dubai.

Mark Smith said...

Al Aydi Tents manufactures Sun Shades for the gym area, park area, mosques, several gardens, and children play area for Canadian schools, local schools, and hotels.

bistee said...

this pagevisite site click siteher response Homepagebasics

Unknown said...

u2i68l6k08 s4i83p7f91 s4j90r0b69 c5y05x0k07 h9x58x9k02 x5b05h2p21