Proposed active gust damping for model aircraft

MFB

Senior Member
Whilst learning how to fly an electric RC training aircraft I found most of my effort was spent trying to counter the effects of wind gusts, and that this is an inherent problem because this type of model tends to have a low wing loading in order to fly slow enough for novice pilots to respond. I therefore concluded that adding some form of active damping might allow me to concentrate more on the aircrafts longer-term flight path. The following code is my first attempt at an elevator control circuit that could be duplicated for the rudder and ailerons. Pulses from the decoder’s elevator output are mixed with motion feedback from a pitch axis gyro and correction pulses issued to the elevator servo. Unlike an active stability system, complex PID control should not be necessary for gust damping because model trainers have a high degree of aerodynamic stability. With the correct sensor orientation and servo linkage the models response to dynamic pitch changes seems to make sense (e.g., nose pitched down results in up elevator movement) but before moving on from the bench testing stage I thought the basic approach should be submitted for comment. For example, is the gain setting too course and could some form of fail-safe be included?

#PICAXE 08M
symbol gain = 3
symbol offset = 22
symbol centre = 40
setfreq m8

start:
pulsin 3,1,w0 '1-2mS input command pulse
w0=w0-180 'Apply 1mS offset to command pulse
readadc10 4, w1 '0-3.3v input from gyro
w1=w1/ gain + offset 'Sets rate gyro input gain and offset
w2=w0 + w1 'Sum of gyro and command inputs
w2=w2 + centre max 420 min 180 'Centre servo and set define end-stops
pulsout 1,w2 'Output comman pulse to servo
goto start
 

srnet

Senior Member
Begginers really ought not to try and learn to fly in windy conditions, and it would be better to learn to fly without artficial stability systems !

Having said that I have a gyro fitted to my Hawkeye;

http://www.electricflights.com/

Not tested yet, but I want to give it a go because at high altitude (1000ft +) where it can be quite windy, I get a fair bit of roll which I would like to damp out so that more of my photographs have a horizontal horizon.

If I was trying the PICAXE approach on one of my planes, I would most definetly want a failsafe, both for cost reasons and safety. Although if you have a switch on your TX that can turn the Gyro off, that ought to be enough, and is the approach adopted by commercial Gyros.

Interesting project though.
 

MFB

Senior Member
I didn't really notice light winds until I started flying rc aircraft. However, I now know that anything over about 15kmh will significantly increases my workload. Artificial stability (eg. F16) would be cheating but a bit of a active gust control has been acceptable on real aircraft since the 1950's.

Good comment about adding a channel for switching to fail-safe mode. The only technique that I would trust would be switching out the PICAXE by routing the decoder output commands directly to the servo. Maybe via a simple analog multiplexer or digital gate.
 

srnet

Senior Member
but a bit of a active gust control has been acceptable on real aircraft since the 1950's.
No doubt, but then I guess the flyers of real aircraft have to go through quite a bit of training on what to do when the help systems fail ..........
 

MPep

Senior Member
In your code I note that you are not allowing pulse transmission to take effect every 20ms or so.
Code:
#PICAXE 08M
symbol gain   = 3
symbol offset = 22
symbol centre = 40
setfreq m8

start:
pulsin 3,1,w0			 	'1-2mS input command pulse 		
w0=w0-180			 	        'Apply 1mS offset to command pulse
readadc10 4, w1		 	        '0-3.3v input from gyro 
w1=w1/ gain + offset			'Sets rate gyro input gain and offset
w2=w0 + w1			 	'Sum of gyro and command inputs
w2=w2 + centre max 420 min 180 	'Centre servo and set define end-stops 
pulsout 1,w2				'Output comman pulse to servo	
goto start
Just wondering but would a SERVO command not be appropriate here, or a PAUSE for 15 - 20 ms (actually doubled as you are using 8MHz)?
 

MFB

Senior Member
MPep, The servo pulse is issued at the same rate as the incoming pulses from the RC decoder but with an offset delay. At 8MHz the PICAXE has plenty of time to get around the loop before the next input pulse arrives. Provided you use an 08M per channel/axis.
BTW, thanks for tidying up my listing!
 

Mike_cj0

Member
I could really do with somthing like this on my planes. I live by the coast and it takes the enjoyment out of flying when you are constantly fighting gusts just to try and point in the right direction.

Just one query about your code. im new to this so may have missed it when reading it, but have you taken into account the changes in direction that the gyro will pick up when you are intentionally banking, climbing, looping etc?
 

MPep

Senior Member
@MFB,
I see now where I got myself confused. Never used PULSIN, but now see (just read in the manual:)) that it waits until a LOW to HIGH transition, hence there is the timing. Not so much tidied the code as using the
Code:
 tags

@Mike_cj0,
The sensor output is between 0 and 3.3V. A presumption here, but when the plane is level the output will be at around 1.65V. Therefore wiggling either way will produce value above or below this, hence the direction is automatically taken care off.

@MFB (again :)),
What is the sensor you are using?
Just a thought but a motion sensor from a Wii should work well, analogue output for 3 directions. This way control can be provided for both elevator and aileron. [URL="http://www.analog.com/en/mems-sensors/inertial-sensors/adxl330/products/product.html"]Datasheet is here[/URL]
 

MFB

Senior Member
Pleased to hear someone else has trouble just keeping the aircraft pointed in the right direction. I was beginning to think it was just me!

The steady state output of the LY530ALH gyro is indeed 1.65V and the PICAXE can therefore determine the direction of movement. The feedback will damp intentional pilot commands and have the effect of making the aircraft feel larger to the pilot. However, the rate gyro only responds to transients and the amount of feedback decays with time, a bit like using an ac coupled sensor. I think the basic Wii only uses a tri-axis accelerometer, which would not be suitable for this application.
 

elios

Senior Member
im suprised you guys are having issues with wind.... My advice would be to fly higher while you're training, then it gives you more time to correct when things go bad.

Back from when I flew GA - Altitude with no airspeed is fine. No altitude and no airspeed, is not so fine.

What mode controller are you flying? I started flying mode 1 but that was so hard to master, especially on my chopper, I've swapped everything to mode 2.

MFB - I have a feeling the anti-gust control would be integrated into the fly by wire computer control. The extent of training for them, in the event of failure, is removing left hand from throttle and placing on eject paddle. Other forms of anti gust control would be auto-pilot..? I've had a bit of time in the jump seat of commercial turbo-props, and the pilots had to correct everything, unless it was on auto pilot, which the computer sorted everything out anyway.
 

bluejets

Senior Member
im suprised you guys are having issues with wind.... My advice would be to fly higher while you're training, then it gives you more time to correct when things go bad.
As a flight trainer, I agree. Usual recommendation is 2 1/2 mistakes high. Learning to fly in windy conditions makes you a better pilot.
Many times I have seen students of mine having fun flying while all the "no wind for me" people would pack up and go home.
Sometimes even before their first flight of the day.
If I hear you say, "what about when I take off and land?" .....you should not be flying unaided if you are not competent.
Model aircraft can be very dangerous in the hands of beginners.
As regard to "aided controls" I personally have found them to be a hinderance and give "doughy feel" to flying.
One exception is of course, a heli gyro. Without this on a single rotor chopper, it would be impossible to control. Some have said like balancing a matchstick vertically on your finger.
 

MFB

Senior Member
Thanks for the training advice. Which is pretty much in line with that from my instructors. However, as my 'other hobby' is electronics it seems appropriate to reduce my workload when flying by developing some helpful technology. Its probably time for me to stop tinkering and to start trying out these ideas on a model aircraft.
 

elios

Senior Member
Looks like we can't budge you from the whole flight stabilisation system /auto pilot :p

I started one a while ago but have had to put the project on hold. Had to use a 20x2 because of the speed, but going to grab myself a 20M2 hopefully. I found the biggest problem with using PICAXE with this, in a practical sense, is that they are just too slow when it comes to interpreting information and then commanding the servos. I had noticeable delays when even using a program of <10 lines to control a servo with a joystick. To get a more perfect solution you will have to use PIC or similar. I want to complete mine with a PICAXE though, as a "see it can do it", but think I am pushing it up hill with that lol. Got a couple 'samples' of PIC32 lying around so might make a breakout and have a fiddle.

To start with: Fast chip with lots of program space. Response time is critical. investigate PID
 

elios

Senior Member
@Bluejets: I had an EPP Aermacchi glider once upon a time. Absolutely indestructible, used to fly it in 40kt winds. Control surfaces along the entire trailing edge. It would snap roll given the most slightest chance, had to put about 12oz of lead in the nose to balance it though. Used to drive it into the ground to land it, else it wouldn't go down haha. Used to have to straighten the nose out after said landing, as it would be poking out at right angles...
 

srnet

Senior Member
I found the biggest problem with using PICAXE with this, in a practical sense, is that they are just too slow when it comes to interpreting information and then commanding the servos.
.
.
.
Fast chip with lots of program space. Response time is critical. investigate PID
That would be my guess too.

Beginners planes, light with low wing loading so they can fly slow, are going to be blown about in gusty conditions. Adding weights or other ballast helps but then the plane needs to go faster of course.

You would need to correct in roll and pitch, and beginners planes which often have dihedral or polyhedral wings tend to be more affected by sideway gusts than planes with no wing dihedral.

Getting a PICAXE working for this would be interesting, but myself I would get a couple of Gyros off eBay (about £8) to see if they actually did make the plane easier to fly, I have my doubts.
 

geezer88

Senior Member
I've been reading this thread with interest because I've spent some time trying to do this with a real plane. I've got a homebuilt, two-place, all aluminum plane that has a very light wing loading. If there is any turbulence I can't take my hand off the stick to unwrap a sandwich or fold a map. So, I researched some ideas.

The rate gyro as discussed here is sensitive to the rate of change of an angle. You can orient the thing to detect roll, or yaw. Neither one is a perfect solution, though, because the system only generates a signal to how fast the angle is changing; hence the name rate gyro. It does not respond to the actual position in space error, but gives you a number that is proportional to the rate of change of one or more rotations. I bought a unit designed for model airplanes. It is designed to be inserted between the receiver and the servo, making changes to the signal in response to the rate of change of the aircraft. These are available on your favorite auction site for less than $30. I'd give this a try on the model plane. No picaxe required. I understand the interest in doing it yourself, though.

Another method for keeping wings level on model aircraft uses the optical differences between sky and ground to detect the orientation of the wings. I think this one is also designed to be inserted between the receiver and the servo. These are also very inexpensive, less than the gyro.

A real multiaxis gyroscope that responds to changes in position would be the easiest to use. It would give you an error signal proportional to the difference in position as opposed to rate of change. This type would be the easiest to apply, but I could not find any sensors for less than $1000.

At least if you make a mistake, the model won't do much damage. 8)

tom
 

srnet

Senior Member
Another method for keeping wings level on model aircraft uses the optical differences between sky and ground to detect the orientation of the wings. I think this one is also designed to be inserted between the receiver and the servo. These are also very inexpensive, less than the gyro.
The autopilot systems that are now available for model aircraft use these optical systems, as you say a normal RC model Gyro wont keep the wings level .....
 

MFB

Senior Member
Although I have not yet flown the 08M based gust damper, it should not introduce significant control lag because it is able to process and output an updated correction servo command between each incoming pulse (e.g. within approximately 20mS). Bench tests consist of keeping the gyro input fixed at the centre voltage and whilst inputting the complete range of command pulses and, alternatively, keeping the control stick centred whilst inputting the maximum gyro range. There should be no need for complex PID control code because the model trainer is already aerodynamic stable.

It should be possible to use this ( http://www.giantcod.co.uk/giantcod-401b-avcs-digital-head-lock-gyro-p-404476.html ) low cost commercial unit to provide gust damping on each axis but I thought it would be more interesting to develop a PICAXE versio.

I have also done some development work on IR horizon detection using thermopiles. This instrumentation provided good measurements from model rocket flights but the post flight analysis is proving a bit difficult.
 

MFB

Senior Member
The latest issue of the BMFA news has an interesting article by Barrie James about using a commercial in-line gyro unit to help him fly in windy conditions and his comments are very positive. Could this mean that such techniques are becoming respectable, rather than a form of cheating?
 
Top