ATI Command Augmentation System

ATI Command Augmentation System #1

I am changing acronyms starting with this post.  Previously I was calling this an SAS for “Stability Augmentation System” but someone pointed out that this is technically more of a CAS for “Command Augmentation System”.

SAS implies a direct connection between pilot input and control surface deflection with some additional stability augmentation mixed in.  CAS implies that a flight computer is translating pilot inputs into a “request” and the flight computer then tries to satisfy that request, but there is no immediate direct mapping between stick deflection and control surface deflection.

Just to review, the ATI “CAS” system internally tracks a target bank angle and a target pitch angle.  The pilot is “flying” these target bank/pitch angles and the flight computer is doing it’s best to match up with the request.  The pilot changes the target bank angle by deflecting the stick; the greater the stick deflection, the faster the target bank angle changes.  This is similar for the target pitch angle.  When the pilot centers the stick, the target bank or pitch angle is held steady.

If the pilot banks into a 15 degree turn (target bank angle) and centers the stick, then the flight computer will hold that 15 degree bank indefinitely or until the pilot deflects the stick again.  Likewise with the target pitch angle, the pilot pulls the nose up or down with the stick, but when the stick is centered, the flight computer holds that pitch angle indefinitely (as best as is possible for the available throttle and airspeed and maximum control surface deflections.)

The system can limit that maximum bank and pitch angles to stay within “nice” limits.  In addition, the system can limit that maximum control surface deflections to avoid abrupt and rapid attitude changes.  Currently the system is rigged so that even if the pilot commands maximum pitch up angle (+15 degrees) and pulls the throttle to idle, there is not enough allowed elevator authority to stall the aircraft.  This makes the aircraft very safe to fly and very predictable.

Here is some real world flight video from the same flights shown in the first video.  The CAS system is active for all but the initial take off in both of these videos.  You can see in some situations the system is working quite well, in some situations the flight computer cannot completely compensate for the natural airframe dynamics and environment effects (turbulence, etc.) and in a few situations additional tuning will be required:


Senior Telemaster SAS Test Day #2

System updates for this video:

1. We added some additional logic to slowly roll the wings to perfect level if the pilot puts the bank angle within +/- 10 degrees of level.  It’s really hard to get it exact from a ground perspective, so the idea is to let the pilot get in the ball park and the system will take over and finish the job.  Auto-leveling will only kick in after the pilot centers the stick so it doesn’t fight the pilot if the pilot is intending to bank the aircraft.

2.  To mimic more natural flight behavior we automatically pitch the nose up by a few degrees when the pilot adds throttle and pitch the nose down by a few degrees when the pilot pulls the throttle back.  This is much more “intuitive” for a pilot and makes the system more predictable and easy to fly.

This was unfortunately another windy day, and the telemaster is a self stable, “trainer” style airframe and thus roll and yaw are very coupled and the aircraft’s natural flight dynamics react quite a bit to even small wind gusts.  This means the SAS isn’t shown yet in it’s best light.  I guess I’ll keep apologizing for the weather and at some point move to a more stable airframe, or try to find nicer days to fly.

I will say one thing.  Even when the aircraft is bobbing around on final approach in the turbulence, it’s nice to be able to fly hands off the aileron stick and trust the SAS system to immediately return the wings to level, even when we get knocked 10, 20, or even 30 degrees off kilter.  I’m still fiddling and improving and I’m not totally in love with the system yet.  But it’s good enough already that I miss it when I turn it off.

So here’s some fun video from the day:

Telemaster SAS

Senior Telemaster SAS Test Flight #1

ATI has been developing a number of flight control system building blocks and we have been testing them on my Senior Telemeaster airframe.  This week I decided to connect them up to create a simple SAS (stability augmentation system.)

Briefly, when flying with an SAS, the pilot is still 100% in manual control over the airplane, however we have inserted a flight computer in between the pilot control inputs and the control surface actuators.  Rather than the pilot’s stick commands directly moving the control surfaces, the pilot stick commands are translated to roll and pitch “rate” requests.  The flight computer keeps track of the target pitch and roll angles and adjusts these according to the pilot’s stick inputs.  The more the pilot deflects the control stick, the faster the aircraft rolls or pitches in that direction.  When the pilot centers the stick, the flight computer holds the current bank and pitch angles, even if there are throttle or speed changes, gusts and turbulence, etc.

Here is a video of my very first SAS test flight:

The first flight test went pretty much according to script.  The basic mechanics of the SAS worked as planned and produced reasonably stable and smooth flight.  Transition between direct manual control and SAS flight was smooth. After the flight I adjusted two things.  First, my gains were set way too low.  Even at full stick deflection, the system responded much too slow to be intuitive for an average pilot.  Second, I had used an exponential control mapping.  This means that near the stick centers, I have to move the sticks a lot to produce just a little bit of aircraft response, but as I near the extremes of the stick deflection range, the rates ramp up quickly and the aircraft responds at maximum (programmed) rates.  Below are two plots that show the difference between linear and exponential input mapping.

I had a little fun on the first landing.  I included it all in the video posted above.  After a couple low slow approach passes followed by a go around, I figured I had enough confidence in the system to attempt a full landing. However, the combinations of gains being set way too low along with exponential input mapping meant my flare was way way way too slow and from the video you can’t even see any pitch up at all even though my stick was pulled all the way back.  I hit so hard I sent the camera tumbling … sky / ground  / sky / ground 🙂  Every thing was fine … I’ve had rougher landings once in a while even under pure direct manual control.

After this flight I tripled the gains and switched to linear input mapping and the result was something that is much more intuitive to fly and allowed me to do some nice landings on subsequent flights.  The system still isn’t perfect and needs some more tuning and fiddling, but for the first day out in the field after a couple days of intensive coding, I am really happy with the results!

Here is some video from my last flight of the day:

Elevator Gain Tuning

Tuning UAV Autopilots

One of the most challenging aspects of autopilot setup is tuning the gains for a particular airframe. When the gains are tuned poorly, the aircraft my oscillate excessively, it may lag way behind the target pitch angle or roll angle or velocity, it may never reach the target values. Poorly tuned gains could destroy an airframe in a worst case scenario, but often people just live with non-optimal gains that aren’t great but work well enough to get the aircraft around the sky. It’s hard to know what gains to tune and why and a person could play with the numbers all day and only manage to make things worse. It’s easy to spot a problem; often the aircraft will look like it is fighting itself even though it does make it’s way to where it should be, or it just may not do what you ask it to do.

Real World Experimentation

Today I did some test flying with one goal to improve the elevator / pitch gain. Previously my gains were set too low.  The result was smooth pitch control, but the actual pitch lagged far behind the goal pitch and tended to oscillate slowly above and below the desired pitch angle. To fix this, I increased the proportional gain until the pitch became unstable, then reduced the gain by 50%. This doesn’t ensure optimal results, but works pretty well in practice.

Here is a short before and after movie

The first half of the movie shows a flight where the elevator gain has been increased until we have just crossed the threshold into an fast oscillating system.  You will see it stabilizes from time to time, but any little gust or even a turn can excite the system and lead to oscillations.  In the second half of the video the gains have been reduced by 1/2 and you can see the pitch is much more stable.  One point to note is that both flights were flown in very windy/turbulent conditions.  During the second flight I was seeing sustained winds at 20 kts, gusting to 25 kts.  The aircraft was set to cruise at 28 kts for a portion of the flight and on one up wind leg, it just stopped in the sky.  (28 kts = 32.2 mph)

Want to learn more?

If you are interested in more information on PID controllers and gain tuning, I wrote a tutorial several years ago explaining much of the basic theory that goes into a simple PID controller. I then discuss some specifics about the autopilot implementation used in the FlightGear flight simulator. This is interesting because my UAV autopilot uses the same basic FlightGear approach. In fact, it’s possible to develop an autopilot xml configuration file in the FightGear flight simulator, and then copy the config file over to the real UAV and run it with only a few small changes.

At the end of the tutorial I include several tips and strategies for tuning PID controllers.

My standard disclaimer is that my educational background is computer science; I do not present myself as a control theory expert; instead I’d just like to share what I have learned in a way that makes sense to me.