Airplane mode RTH

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

Could you also explain in other words what did you mean "angle of attack"?

Angle of attack is same as ACC Nick.(The angle the nose of the plane points)

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

For sure: on two state (LOW, HIGH) switch you have ARM at LOW, MID is useless because there is never such state

Like I said I'm mixing (in TX) 2 on/off switches to get single channel max/mid/min states...
...does your plane disarm when reaches home?

Yes it does and it does that with TH stick in any position (it can be max TH).
Regards Andrej

BTW: the angle of attack comes from aerodynamics and wing profile... http://www.free-online-private-pilot-gr ... _airfo.gif

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

OK, if I used English dictionary I wouldn't look like stupid... :? . Of course I know this angle, just didn't know that English term.
I have old 35 MHz radio and it has one 2 state swich (GEAR) on CH5 and to CH6 can be mapped POT (intended for flaps) which can be used as 3 state switch.
I suppose that when RTH is activated by switch, plane won't disarm at reaching home but will circle @ CRUICETHROTTLE keeping height.
I'll see how it will work in reality.
Roman

jANjALANi
Posts: 7
Joined: Mon Apr 01, 2013 1:45 am

Re: Airplane mode RTH

Post by jANjALANi »

which pin do you put the esc for flying wing? tried D9 it doesn't arm.

jANjALANi
Posts: 7
Joined: Mon Apr 01, 2013 1:45 am

Re: Airplane mode RTH

Post by jANjALANi »

nevermind. figured it out. i just have to adjust my throttle trim.

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

Hi Guys,
during the Eastern vacation I finally tested RTH functionality on my Easystar with version FW_Nav_130322. It was very little wind so I set quite low throttle values for automatic navigation to avoid "crazy horse" ride.
I kept defaults for navigation corrections and it was resulting in quite tight turns and "snake like" flight, but I think this can be improved by tunning throttle and navigation values.
Generally in the video higher throttle means manual control and low throttle is when RTH is active.
You can see complete video here http://youtu.be/P-VkW56nOaY , in short I have to say that it improved a lot (no overspeed and flutter problems ;) ) but still I encountered two troubles:

1) When the plane was close to home, one servo (probably rudder) was oscillating at high speed. You can hear it in the video sound e.g. at 1:54, 2:35, 3:40, 4:45, 5:17 and 6:02. Not critical but not so nice...

2) After several RTH attempts from close distance (~50-200m) I tried RTH from bigger distance ~400m (at about 7:00) but despite I was clicking RTH switch up and down, plane kept flying away without taking care of it so at 7:13 I had to turn it back manually. I don't have explanation for that. :(

Some time before the last attempt I probably reached "armed time warning" (it was set to 330s, you can hear nervous buzzing at the end - if it doesn't mean something else...).
I'll try to increase that value, add some ultracapacitor to protect supply voltage, once more check all settings, but I really don't know what happened at the end... :?:
When the wather will finally improve, I'll try to do more consistent tests, best with OSD but if at least this "rattlesnake" tail servo behaviour can be corrected in meantime, it would be perfect.
P.S. I'm using 10Hz GPS but don't believe, that one GPS measurement can say "turn left" and next one "turn right" periodically for so long time ...
Regards
Roman

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

rbirdie001 wrote:.
2) After several RTH attempts from close distance (~50-200m) I tried RTH from bigger distance ~400m (at about 7:00) but despite I was clicking RTH switch up and down, plane kept flying away without taking care of it so at 7:13 I had to turn it back manually. I don't have explanation for that. :(

I was unable to find any of those posts in forum.... ...but I think that i2c GPS had issues (overflow) on distances more than X meters (X be 400, 500, 600 ?!).
Please check if it is really I2C GPS issue (as I think) and not ATTiny's.

Regards Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

Yes I2c coded was overflowing on distance to home.
I dont know if it's fixed yet.
viewtopic.php?f=8&t=2817&p=28446#p28446

I have seen the nervous behaivour on servos when the plane is very near home.
Especially when we miss wp really close.

It can be "filtered" with a if( dist < 5meters ) set dif=0.
It will remove the jitter around home and pass over home on level Wings.

I have tested it before and it works.

Code: Select all

if (GPS_distanceToHome <=5) dif=0;
// Wrap Heading 180
      if (dif <= - 180) dif += 360;
      if (dif >= + 180) dif -= 360;


There is also a debug function you can remove who can interfear.
GPS_directionToHome=GPS_FwTarget; // For debug Show direction To Target instead of Home

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

Hi Patrik,
Thanks for ideas!
PatrikE wrote:Yes I2c coded was overflowing on distance to home.
I dont know if it's fixed yet.
This shouldn't be the case because I'm using Promini serial GPS. Additionally I don't think that I'd be more than 500m away. Easystar have wingspan 130cm and from my experience it's difficult to control such plane visually over 500m.
It will became interesting when I receive my Minim OSD board because then I'll have to change to I2C GPS and for a plane with FPV is 650m quite "near" :)

I have seen the nervous behaivour on servos when the plane is very near home.
Especially when we miss wp really close.
It can be "filtered" with a if( dist < 5meters ) set dif=0.
It will remove the jitter around home and pass over home on level Wings.
I'll test that but from my first feeling the "home deadband" should be little bigger. Cruise speed of my plane is about 6m/s and this "nervous behaviour" of servos takes usually at least 3-4 seconds so I tend to use as a first value 25m. I think there shouldn't be any risk, what do you think?
Regards
Roman

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

5 meter was just a example..

In the code i only use gps values comming from MWii.
Direction to waypoint and distance.

One thing that can cancel navigation is if you loose 3D fix.(5 Sats.)

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

PatrikE wrote:5 meter was just a example..

In the code i only use gps values comming from MWii.
Direction to waypoint and distance.

One thing that can cancel navigation is if you loose 3D fix.(5 Sats.)

In my calculation I anyway mixed up diameter and radius so for cancelling servo jitter during 4 secs @ 6m/s I will need 24/2=12m radius deadband.
I understand that most of the code is used from MWi, it can be anything anywhere which cancelled navigation. I don't think that GPS itself would loose 5 +sats once it gained 9-10 sats while plane is 200 high and isn't doing any acrobacy. More I suspect short power dropout because all 4 digital servos in the plane are powered from the same BEC as MWi and if all moved at the same time and needed lot of current... :?:
I'll install some big capacitor to cover short peaks in supply and will see. If only this grey sky and could wind finally ends :!:
Roman

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

rbirdie001 wrote: More I suspect short power dropout because all 4 digital servos in the plane are powered from the same BEC as MWi and if all moved at the same time and needed lot of current... :?:
Roman

Friendly suggestion is to invest into one external BEC that can provide 5V and 5A and power everything from there... (digital servos controlled from MWII can drain lot of current).

Regards Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

A powerdrop can cause a reboot of the Arduino!....
Calibrating gyros inAir!... :?
Resetting Homepos if you don't crash before!... :shock:

A crash is almost as sure as a Bill from the electical company!
Passthru is hopefully the rescue.

On a plane we only have ONE ESC with ONE 0,5-1.5A BEC built in.
Even small servos is very powerconsuming!
A Big external BEC and a Cap is a god saftey.

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

Hi,
thanks for suggestions, I should know something about that matters (in fact I'm an electronic ;) ).
Unstable power was my suspect, but theoretical situation isn't as bad as you described. These four servos in my plane are 12g digital servos and they draw maximum 250mA each, i.e. ~1A total max. current, MWi takes almost nothing and the BEC is rated for 2A continuos, peak current probably even more. During my last test video I was all the time until the end flying in GYRO mode and plane was all the time behaving well, just it didn't care last RTH request.
At the end you can see that I was quite aggressive loosing height but that was done by my control. When the plane didn't return, I got nervous that something got wrong and wanted to land asap, additionally my hands were frozen and plane was constantly beeping and I didn't know why. (Just afterwards by reading MWi documentation I found that this beeping was probably only over "armed time" limit.)
Regards
Roman
EDIT: During the loading updated code I found probable reason why RTH didn't work last time: GUI checkbox for RTH wasn't active anymore! Deactivation must have happened in the air before the last RTH attemtp. That's very strange but can confirm theory about unstable power - this can cause EEPROM unwanted writes. Capacitor 3300microFarads low SR is now connected so I'll see...
R.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

To bring that topic back to life.... :)
Today I successfully tested "auto-launch" feature (enable RTH on the ground with "#define RTH_BAILOUT true").
Due to strong wind I did not test RTH from bigger distance.

Regards
Andrej

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Airplane mode RTH

Post by msev »

So how was it, did it went straight from your hand or did you have to correct roll with the sticks?

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

By my observations it went straight (I made no stick input). But since the wind was too strong I have not waited long enough to reach target height (now set to 60m) and return to home but took over (disabling RTH) after seeing nice straight climb to probably 20m.

Regards
Andrej

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

In the last couple of days I moved MWII electronic to my new wing (X5 from HK) and today I did first test.
The results were "brilliant" PH was very good even in slight wind and also RTH worked flawlessly.
At the beginning of this week I also did some RTH tests (with previous platform) from distance (aprox. 400m) and it also worked without issues.
So I believe that current Patrik's implementation (FW_Nav_130322) is stable!

Best Regards
Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

So I believe that current Patrik's implementation (FW_Nav_130322) is stable!

Nice to hear Andrej,
It might be time to merge with _shared soon then. :D

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

For consideration:

Code: Select all

#define RTH_BAILOUT  true

Is a really nice feature when used as "auto launch" since many planes/wings can be very annoying to launch by the pilot himself...
...but when enabled and used as RTH function to reach proper height it can be annoying/unhelpful since when I fly in the wind and enable RTH with tail wind my wing fly too far away before it reach set height to make home turn and in case of emptier battery it can happen that the plane never reaches set height and it newer returns!

My suggestion is that level wings in climb-out is only active when height above home is less than 15-20m, above that height it starts to navigate home.

Regards
Andrej

@PatrikE: How to enable RTH when FAIL_SAFE is triggered (it seems it is not working right now)
Last edited by crashlander on Tue Apr 23, 2013 6:50 pm, edited 1 time in total.

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Airplane mode RTH

Post by dr.tom »

1. why would you launch it downwind?
2. why would you launch it with half empty battery?

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

@dr.tom:

Code: Select all

#define RTH_BAILOUT  true

means that plane will try to reach safety/set hight with level wings (only climbing and not turning) any time when RTH is enabled not only when launching!
So it is quite possible to trigger it 40m high and downwind (when set hight is 70m) and when the battery is is not strong enough to reach that hight in short time.
But when you disable that code you will not be able to use "auto launch" since the plane will try to turn immediately toward home ant that is mostly not acceptable (strong turning 2m high at launch) :)

Regards
Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

crashlander wrote:@PatrikE: How to enable RTH when FAIL_SAFE is triggered (it seems it is not working right now)


In config
#define FAILSAFE_RTH false // Enable RTH for failsafe incl Auto DisARM at home

It should set a flag in failsafe routine.
f.FAILSAFE_RTH_ENABLE

f.FAILSAFE_RTH_ENABLE should enable GPS_HOME

Add if(curr_Gps_Alt < 15) in Bailout.

Code: Select all

        #if RTH_BAILOUT
         if(curr_Gps_Alt < 15) navDiff=0; // Forced Climbout with Level Wings below 15 meters
        #endif

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

@PatrikE:
you probably meant

Code: Select all

if(curr_Gps_Alt < 15){dif=0;}
.

You are saying that setting
#define FAILSAFE_RTH false

should ENABLE FAILSAFE_RTH?
If not than there must be problem with my setup (Spektrum DX7, and AR7000something) since when I switch of my TX it only sets TH to 0 and MWII does not activate anything.

Regards
Andrej

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

Hi guys!
also I finally tested FW_Nav_130322 and can confirm that it works fine!
I think it's really time to merge it to the project :D
You can check video here:
http://www.youtube.com/watch?v=WBshop0ZvxQ
I have to say that this video is a little boring so I put few points to check for impatient people... ;)
Launched with

Code: Select all

 #define RTH_BAILOUT true
and RTH activated as a autolaunch. It was raising very nice (you can hear that battery was beeping with 1st level warning so not only crashlander is doing it... It was last test of a serie with the last battery to discharge :D )
Plane went almost straight (little turning caused probably by wind), the only unexpected thing was that it reached obviously more than 50m which was set for RTH safe height.
I guess it reached about 250m of height (you can check time 1:12 of the video - you can see how far the ground was...) before it ended ascending and started navigation.
I guess this was because GPS height in my GPS module (MTK3329) is internally strongly filtered and reacts very slow.
After the plane reached the height and started navigation home, I set throttle stick to zero which means that after the plane passed near by home, it disarmed and started gliding above home position (time 1:27).
This was the only stick action I did during whole flight! The plane was then circling (OK, little like drunk sailor :lol: but who cares) slowly descending and at the end it ALONE landed without me touching sticks!
It was kind of testing of my nerves because in the height of about 2 meters automatic almost stalled the plane but it recovered alone and landed <10m from the home position. I tested autolanding twice and both was successfull.
On the Patrik's advice I added following line into MultiWii.ino to level plane near the home:

Code: Select all

if (GPS_distanceToHome <=15) dif=0;  //fly straight over home
// Wrap Heading 180
and it works very nice. I intend to put even bigger deadband. I think it can be also answer for crashlander - even if you don't set #define RTH_BAILOUT true, the plane should after launch for some distance fly straight and turn later when gets further...
So conclusion is:
Thanks to Patrik, great work!
I'm going to install FPV equipment and OSD, then it will be easier to see what's happenning.
Regards to all!
Roman

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

crashlander wrote:If not than there must be problem with my setup (Spektrum DX7, and AR7000something) since when I switch of my TX it only sets TH to 0 and MWII does not activate anything.

Andrej,
with the new failsafe code for me failsafe state works even with Spectrum DX6i.
First check whether MWi goes into failsafe when you turn off TX. When in FS, beeper beeps and in the GUI is activated LEVEL box.
If not, you can try rebind your receiver with throttle stick and throttle trim at lowest position (THRO pulse under 950 microseconds, as low as possible). After binding you have to readjust THRO endpoint back to 1050 or something similar. This should allow you using failsafe.
Regards
Roman

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

@rbirdie001
Your setting of:

Code: Select all

if (GPS_distanceToHome <=15) dif=0;  //fly straight over home

makes your plane to "autolaunch" and fly straight until the code detects that it is 15m far from home.
That is why Patrik's suggestion to set

Code: Select all

if(curr_Gps_Alt < 15){dif=0;}

is safer since the plane will not turn until is 15m above ground (home point)!

I have never tested autolaunch until the target height but at least when RTH is enabled the plane does not overshot target hight for more than 5m, I'm using Neo6 (UBLOX) on Mega board.

Thank you for your suggestion of setting TH too low (when binding) and trigger failsafe that way since that will probably work.

Best Regards
Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

Nice flyig Guys..

Some observations....
There should be some dampening on servo otputs to avoid the ratteling when Direction to taget is ~180 degrees.
Servos try to compensate from - 180 to + 180 degree error and causes the ratteling.
with time it can cause a servo to failure...

And for navigation we dont need any fast caompensations.
better with smooth controols like when you fly manually!
You hopefully don't compensate with full throws when you fly...
Any idea's someone?

Also the Stalls is not so nice.
There should be some roule about how much elevator is allowed to compensate at low or no throttle.
Maby even force it to dive 1-2 degrees when power off?
Just to avoid stallSpeed.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

Today it was another nice day for RTH and PH testing (sunny with stronger gusty winds) ;)
The code is now really sweet and it is working perfectly despite wind.

There should be some dampening on servo otputs to avoid the ratteling...

True but probably not so problematic since it only happens above home point and since RTH is more or less safety function it will not run all the time.
Also the Stalls is not so nice.

I could observe stall like behavior with PH enabled but after increasing CRUICETHROTTLE and IDLE_THROTTLE just a bit it went away.
Maby even force it to dive 1-2 degrees when power off?

I agree that could be proper solution.

Regards
Andrej

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Airplane mode RTH

Post by brm »

you need to define the 'stallspeed' and then this speed should be in place rel. to the wind.
when the rel. speed to the wind is below the stallspeed then you need to dive.

regardless of the motor speed the plane should fly.
if not then adjust the cog.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

brm wrote:you need to define the 'stallspeed' and then this speed should be in place rel. to the wind.
when the rel. speed to the wind is below the stallspeed then you need to dive.

For this to work we need to know wind speed and direction...
...and this IMO is impossible/hard without air speed sensor. Maybe long time integration/calculation of level flying with known heading would help but even then it would be impossible to compensate for wind gusts.

brm wrote:regardless of the motor speed the plane should fly.
if not then adjust the cog.

That definitely goes for normal planes without auto leveling electronics but in our case level/horizon mode tries to keep plane level disregarding speed and thus aerodynamic forces that governs planes during glide descend.

Best Regards
Andrej

dr.tom
Posts: 141
Joined: Fri Mar 30, 2012 4:46 pm
Location: Croatia
Contact:

Re: Airplane mode RTH

Post by dr.tom »

Hello,
can this GPS be powered from 3.3V instead of 5V?

http://www.rctimer.com/index.php?gOo=go ... oodsid=763

Image

does anyone know where should i connect VCC to go around the voltage regulator that lowers the 5V to 3.3V,
so I can feed it directly.
maybe on '+' side of big yellow condesator in the picture?

Thanks :D

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

Hard to be sure but I would say the element I marked with red oval is step-down regulator (probably with 65z5 marking). You can measure it and than connect 3.3V on proper leg.
1350571330.jpg

Yellow cap is most probably on high side (5V) not on low (3V).
Ironically (but luckily) those are the elements that will die if you switch polarity (do not ask how I know).

Regards
Andrej

msev
Posts: 186
Joined: Thu Apr 14, 2011 11:49 am

Re: Airplane mode RTH

Post by msev »

Maybe in the next code release from Patrik, that support for airspeed sensor could be merged in :D (hint, hint :P)

crashlander wrote:For this to work we need to know wind speed and direction...
...and this IMO is impossible/hard without air speed sensor.


After I come from holidays I'll start with a few of this flight controller projects, this summer is gonna be sweet :).

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

crashlander wrote:
brm wrote:regardless of the motor speed the plane should fly.
if not then adjust the cog.

That definitely goes for normal planes without auto leveling electronics but in our case level/horizon mode tries to keep plane level disregarding speed and thus aerodynamic forces that governs planes during glide descend.

I agree with Andrej (crashlander), but generally I don't think that stalling plane is real problem of this setup.
Here is why:
- My ACCelerometer is calibrated maybe a little "nose up" because with previous versions of FW_NAV I had problems with overspeed and flutter during automatic navigation so I rather calibrated it little "nose up", but now it can help stalling the plane during gliding. Also Elevator compensation value based on tilt can be too big => plane slows down too much at tight turns.
-My plane engine was OFF, this is the worst and not very usual case.
- I've seen several "almost stalls" of my plane but nothing ever really happened. I think that levelling by ACC is preventing real stall and spiral dive (at least of my plane!). Remember what happens at stall conditions - when plane slows down too much, nose pitches up, this slows down the plane even more and at the end the plane falls. But when you have ACC stabilization and plane starts raising nose, ACC immediately "pushes" elevator and (in my case) recovers the plane.

Rattelling: I have good results with the line resetting the navigation and levelling the plane in close horizontal distance from home (mentioned few posts up). I tested 15m radius and this is still too little but generally it helps a lot. Of course smoothing the navigation (by long moving avarage???) would be perfect (if there is enough resources for that!), also real PID regulator for navigation would probably help. What helps and what not really, it needs to be tested. I can't imagine if existing PID regulator for copters can be used for that :?:
There was also discussion here viewtopic.php?f=7&t=2456&start=120#p33438 about slow introduction of navigation control to allow controlling also very fast planes. Smoothing navigation (only navigation input, not control loops!) can help also with this problem but in the other hand without PID it can make even worse the "snake flight" towards home.
So lots of playing is waiting for us but isn't it what we like? :mrgreen:
Roman

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

rbirdie001 wrote:There was also discussion here viewtopic.php?f=7&t=2456&start=120#p33438 about slow introduction of navigation control to allow controlling also very fast planes.

Even very fast planes will not break apart when actual turns are limited to 15 deg. in bank turns. Since the G force is proportional to degree of banking (http://en.wikipedia.org/wiki/Banked_turn) the only difference is that the radius of turns will be bigger.

Best Regards
Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

msev wrote:Maybe in the next code release from Patrik, that support for airspeed sensor could be merged in :D (hint, hint :P)

I could do it.
But it's already been done by Kaik.
And I don't have the hardware to test it. :(
viewtopic.php?f=8&t=2450

And as Alex said in the thread
Alexinparis wrote:Adding a new sensor type might be a good thing.
But the purpose of this sensor needs to be clearly explain before adding code.
I see no interest for a multi rotor.


You can Bump that tread and explain why it need to be added. ;)

Patrik

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

crashlander wrote:Even very fast planes will not break apart when actual turns are limited to 15 deg. in bank turns. Since the G force is proportional to degree of banking (http://en.wikipedia.org/wiki/Banked_turn) the only difference is that the radius of turns will be bigger.

Hi Andrej,
I can be wrong, but I'm afraid that degree of banking is relative to levelled plane. So in (theoretical) situation when the fast plane is already 45 deg. or even more tilted nose down and diving at 250 km/h when at once navigation is activated (maybe pilot lost control because of lost LOS and he wants to save the plane), it will immediately set full elevator throw to level the plane and wings can break...
OK, I know it's theory :D and if someone does it, he must be aware that MWi isn't "idiotensicher" and really wrong handling can cause problem. Anyway I think, that some smoothing and slower introduction of navigation control woud improve this code. :D

What do you think Patrik? Do you have any idea how to simply filter navigation controls and possibly add PID?
Regards
Roman

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

rbirdie001 wrote:I can be wrong, but I'm afraid that degree of banking is relative to levelled plane. So in (theoretical) situation when the fast plane is already 45 deg. or even more tilted nose down and diving at 250 km/h when at once navigation is activated (maybe pilot lost control because of lost LOS and he wants to save the plane), it will immediately set full elevator throw to level the plane and wings can break...

I agree there are some corner cases in which slow leveling could be better.
But without much finer speed and alt sensing it is impossible to get optimal results (eg. What if the plane is quite low? How many seconds should be given to electronics to level plane?)
And again RTH should be considered failsafe function and thus it should not be too complicated (programmatically and logically).
I have not tested that theory but with multycopters you can achieve slower leveling with lowering P and I maybe it would work the same for planes?

Regards
Andrej

Edit: Some entertaining math 250km/h with 45 deg. dive means that the plane is loosing aprox. 35m/s

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

Some entertaining math 250km/h with 45 deg. dive means that the plane is loosing aprox. 35m/s

:shock: Eject! Eject! :shock:
A Parachute would be nice! :lol:

I use a function to slowdown Flaps.
It could be possible to use similar function for Nav if Nav error is bigger than ex.100.
And if the error is less use full speed.

It could look like this.

Code: Select all

// Test to slowdown servos NOTE!.. Untested
      #define SERVOSPEED   3  // zero to disable  Increase for faster speed reverse with minus
      #define SLOW_ANGLE 100  // Ajust where slow servos activates >> if (dif > SLOW_ANGLE) <<
      static int16_t slowNav = dif;
      if (slowNav < dif ){slowNav+=SERVOSPEED;}else if(slowNav > dif){slowNav-=SERVOSPEED;}     
      if(abs(dif) > SLOW_ANGLE  && SERVOSPEED != 0) dif = (constrain(slowNav,-GPS_MAXCORR*10, GPS_MAXCORR*10));
// Test to slowdown servos *******************

// Limit outputs
.....

The code compiles but is untested in the plane.
The servospeed is dependant on the cykleTime. It adds 3µs to slowNav every loop.

Be careful if testing.

Patrik

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

crashlander wrote:...Some entertaining math 250km/h with 45 deg. dive means that the plane is loosing aprox. 35m/s

Andrej, we don't have to go far to see such *** guy who points his plane nose from 300m towards ground and tries how much speed his plane gains when levelled after 250m of free fall ;) .
One day long time ago I got new Multiplex Easyglider PRO and was so happy how aerodynamical it is, that I have to admit that I was doing it :D. I got "only" 139 km/h when it's wings almost clapped (fortunately EPP is a great material and plane survived), then I finally stopped doing it.
At least I know what are some people capable to try :mrgreen: .
I know there are RC pilots doing it for record with special planes (e.g. guy here http://www.rcspeeds.com/pilot.aspx?p=74 flies 468mph which is about 750 km/h) so my example of 250 km/h was very conservative :D .
Regards
Roman

rbirdie001
Posts: 178
Joined: Fri Apr 01, 2011 10:32 pm
Location: Czech Republic, Prague

Re: Airplane mode RTH

Post by rbirdie001 »

PatrikE wrote:...
I use a function to slowdown Flaps.
It could be possible to use similar function for Nav if Nav error is bigger than ex.100.
And if the error is less use full speed.

It could look like this.

Code: Select all

// Test to slowdown servos NOTE!.. Untested
      #define SERVOSPEED   3  // zero to disable  Increase for faster speed reverse with minus
      #define SLOW_ANGLE 100  // Ajust where slow servos activates >> if (dif > SLOW_ANGLE) <<
      static int16_t slowNav = dif;
      if (slowNav < dif ){slowNav+=SERVOSPEED;}else if(slowNav > dif){slowNav-=SERVOSPEED;}     
      if(abs(dif) > SLOW_ANGLE  && SERVOSPEED != 0) dif = (constrain(slowNav,-GPS_MAXCORR*10, GPS_MAXCORR*10));
// Test to slowdown servos *******************

// Limit outputs
.....
...

Patrik, thanks, I'll (carefully) test it as well as the code you sent me on PM. Hopefully during the weekend but unfortunately it should rain here on the weekend :(
What it does if you invert SERVOSPEED with minus?
Regards
Roman

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

Hi Roman,

If you invert SERVOSPEED with minus it will turn left instead of right.
But i think it should be positive.

Code: Select all

if (slowNav < dif ){slowNav+=SERVOSPEED;}else if(slowNav > dif){slowNav-=SERVOSPEED;}


Do first test on ground.
Set homePos and walk away.
Turn the plane ~180 degrees away from home.
When the dif is greater than SLOW_ANGLE servo should move slower.

I will work whole weekend..
No flying for me! :(

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Airplane mode RTH

Post by brm »

crashlander wrote:
brm wrote:you need to define the 'stallspeed' and then this speed should be in place rel. to the wind.
when the rel. speed to the wind is below the stallspeed then you need to dive.

For this to work we need to know wind speed and direction...
...and this IMO is impossible/hard without air speed sensor. Maybe long time integration/calculation of level flying with known heading would help but even then it would be impossible to compensate for wind gusts.

brm wrote:regardless of the motor speed the plane should fly.
if not then adjust the cog.

That definitely goes for normal planes without auto leveling electronics but in our case level/horizon mode tries to keep plane level disregarding speed and thus aerodynamic forces that governs planes during glide descend.

Best Regards
Andrej


take a crashcourse in physics.
electronics in combination with sw cannot overrule the physics....

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

brm wrote:take a crashcourse in physics.
electronics in combination with sw cannot overrule the physics....

I admit that my physics and aerodynamic knowledge is a bit rusty at best...
It depends how you define stall, if you are looking at it as stall turn's it is one thing, but AF447 (in 2009) was actually stalling from 10km with level wings (and that is very hard if not impossible without help of electronics).

Regards
Andrej

brm
Posts: 287
Joined: Mon Jun 25, 2012 12:00 pm

Re: Airplane mode RTH

Post by brm »

the electronics is much faster as your eyes.
10km what ... height ... depth ... per hour ...
this is exact the feeling i have when i look at mw software components.

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

brm wrote:the electronics is much faster as your eyes.
10km what ... height ... depth ... per hour ...
this is exact the feeling i have when i look at mw software components.

http://en.wikipedia.org/wiki/Air_France_Flight_447

Regards
Andrej

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

One more video from this week (wind test), this time with some comments.
http://www.youtube.com/watch?v=EKm6Imp43_c

Regards
Andrej

PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode RTH

Post by PatrikE »

This really seems to work good now.
Acyually the first proven rescue with RTH!

Have you made any tests with"Long distance" RTH?

EosBandi is doing a rework on the intire GPS code Including Waypoints etc atm ...
He will probably integrate the FixedWing Nav at the same time...

I would like to know what modifications i suggested that you use in the code.
Can you post the FW_Naw file + the settings in config?

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane mode RTH

Post by crashlander »

PatrikE wrote:This really seems to work good now.
Acyually the first proven rescue with RTH!

I'm flying 5.8GHz and i have connected camera/recorder and small 4inch monitor on RX side and when you can see some static in my video the monitor blanks for at least 1 second and if the static continues the monitor stays blank, but 10 yeas old camera/recorder does not have that "nifty" feature and records just a bit of static.... :)

Have you made any tests with"Long distance" RTH?

I believe I tested it from aprox. 400m.

I would like to know what modifications i suggested that you use in the code.
Can you post the FW_Naw file + the settings in config?

- Those test are done with FW_Nav_130322
- I have set narrower home area (50m instead 100m since there are some tall tree's nearby)
- added your suggestion for level wings only during auto-launch
- modified params for my wing (min, max, cruise TH, ESC pulses since I'm using EXT_RANGE ESC... )
- I left mostly stock PID's in GUI
- I'm using Crius AIO Pro V1, UBLOX Neo 5 (from HobbyKing), X5 FW (from HobbyKing), Turnigy Aerodrive D2830/11 on 3S.

Regards
Andrej
Attachments
Archive.zip
Settings an changes
(34.3 KiB) Downloaded 198 times

Post Reply