Airplane mode RTH
Airplane mode RTH
Hey there,
I did not follow the airplane development of MultiWii until a few days ago ... I now have an Easy Star II with a NanoWii installed and it does work (the plane is mostly stable by itself though)
Since the NanoWii has over 5000 bytes left when GPS_SERIAL is defined I was wondering if a simple RTH function could be implemented. When switched on the plane should turn into the direction of home (using GPS velocity vector instead of compass) and as a bonus keep a certain height (i know, that would probably need airspeed information). Alternatively it should just keep the plane level with a predefined throttle speed that whould work similar to the quadrocopter failsafe throttle. You'd have to experiment with values that wont let your airplane ascent too much.
My ideal setup would be a GPS connected to the NanoWii serial port RX and sending FrSky telemetry on the TX pin. That would make a super cheap FPV stabilizer setup with failsafe RTH. Possible?
I did not follow the airplane development of MultiWii until a few days ago ... I now have an Easy Star II with a NanoWii installed and it does work (the plane is mostly stable by itself though)
Since the NanoWii has over 5000 bytes left when GPS_SERIAL is defined I was wondering if a simple RTH function could be implemented. When switched on the plane should turn into the direction of home (using GPS velocity vector instead of compass) and as a bonus keep a certain height (i know, that would probably need airspeed information). Alternatively it should just keep the plane level with a predefined throttle speed that whould work similar to the quadrocopter failsafe throttle. You'd have to experiment with values that wont let your airplane ascent too much.
My ideal setup would be a GPS connected to the NanoWii serial port RX and sending FrSky telemetry on the TX pin. That would make a super cheap FPV stabilizer setup with failsafe RTH. Possible?
Re: Airplane mode RTH
Would it be enough if the plane would use the rudder to turn itself in the direction that MultiWii says the waypoint (home) is? In absense of a compass it would have to use the direction from the gps, but since it is a plane and not a multicopter that should be acceptable. When the plane reaches the waypoint it would circle around it depending on how good the angle/horizon mode compensates the rudder.
Anybody willing to implement this? I read about planned RTH functionality for planes in the airplane mode thread, but nothing happened so far or am I missing something?
Anybody willing to implement this? I read about planned RTH functionality for planes in the airplane mode thread, but nothing happened so far or am I missing something?
Re: Airplane mode RTH
Hi Sebbi,
Do you have a suitable plane to test with?
I have a test version ready.
Some PID need to be added to get it to fly stright line.
But it seems to return to launch.
Notice when you enable a GPS mode engine will enter a auto mode.
Run at cruice or climb throttle!
All settings is in config
Remove or change my DEBUG Defs.(just a example how to setup!)
Use this for your fingers health!
#define SAFETY_SWITCH AUX4 // Use a Safty switch for AutoThrottle. Must be over 1700µs
But it can be disabled on your own risk.
And if you feel unsecure on the navigation Take over in time!
We dont want a runnaway...
Passthru disables MWii completly!
I set my switches like this.
AUX3 actually not needed.
Do you have a suitable plane to test with?
I have a test version ready.
Some PID need to be added to get it to fly stright line.
But it seems to return to launch.
Notice when you enable a GPS mode engine will enter a auto mode.
Run at cruice or climb throttle!
All settings is in config
Remove or change my DEBUG Defs.(just a example how to setup!)
Use this for your fingers health!
#define SAFETY_SWITCH AUX4 // Use a Safty switch for AutoThrottle. Must be over 1700µs
But it can be disabled on your own risk.
And if you feel unsecure on the navigation Take over in time!
We dont want a runnaway...
Passthru disables MWii completly!
I set my switches like this.
AUX3 actually not needed.
- Attachments
-
- MultiWii_FWnav 0920.rar
- Fiwed wing Navigation test
- (248.88 KiB) Downloaded 869 times
-
- FXnav.png
- (3.61 KiB) Not downloaded yet
Re: Airplane mode RTH
Hey PatrikE,
from a quick read of your source code it looks like a working solution. Did you test it already? Is it hard to determine a cruise throttle? I have a suitable airplane, but currently no working GPS module. Will order one and let you know how things turned out.
Thanks for the implementation
from a quick read of your source code it looks like a working solution. Did you test it already? Is it hard to determine a cruise throttle? I have a suitable airplane, but currently no working GPS module. Will order one and let you know how things turned out.
Thanks for the implementation
Re: Airplane mode RTH
It's tested but needs work with a Pid function.
Check where you hold the throttlestick in suitable speed and check the Gui what value you have.
Or just estimate;-) Det as i did.
Check where you hold the throttlestick in suitable speed and check the Gui what value you have.
Or just estimate;-) Det as i did.
Re: Airplane mode RTH
I agree, it probably needs a PID controller for the yaw axis. Does it oversteer a lot in your tests? Can you capture a video? (sorry, I am a littlebit excited, maybe I'll find some old GPS module for testing this with you)
About the roll axis, when I use the rudder only my airplane is rolling to the side (without using ailerons). As I understand it horizon mode would take care of that (by using the ailerons) and the RTH function would then be responsible for the plane to still roll a littlebit?
About the roll axis, when I use the rudder only my airplane is rolling to the side (without using ailerons). As I understand it horizon mode would take care of that (by using the ailerons) and the RTH function would then be responsible for the plane to still roll a littlebit?
Re: Airplane mode RTH
It files like a snake in the beginning.
I hve only tested it on short distances. ~200meters
On a long return it probably fly more stright line.
My plane is slow in rollplane and need big input to initiate turns even in passthru!
My setup with GPS added later.
I also think that rudder can be more effective than only roll.
Horizon mode will force the plane to do flat turns with rudder.
If you want roll you need to use a little GPS_NAVCORR
Sorry no video...
To windy today
1500 cruicethrottle was not enough to fight the headwind!
I hve only tested it on short distances. ~200meters
On a long return it probably fly more stright line.
My plane is slow in rollplane and need big input to initiate turns even in passthru!
My setup with GPS added later.
I also think that rudder can be more effective than only roll.
Horizon mode will force the plane to do flat turns with rudder.
If you want roll you need to use a little GPS_NAVCORR
Sorry no video...
To windy today
1500 cruicethrottle was not enough to fight the headwind!
Re: Airplane mode RTH
Patrik did you make any more tests?
Re: Airplane mode RTH
msev wrote:Patrik did you make any more tests?
Yepp!...
Yesterday it performed really good.(Didn't have a camera available.)
I just have some final tests to do.
It's still overshooting some in altitude.
But it's just tuning.
Re: Airplane mode RTH
Do you use a baro? Maybe you could modify mahowiks alt.hold code for our purposes?
Re: Airplane mode RTH
msev wrote:Do you use a baro? Maybe you could modify mahowiks alt.hold code for our purposes?
I don't think using the accelerometer on an airplane would improve altitude holding. Even GPS altitude would be good enough for basic return to me logic (as many commercial OSDs offer)
P.S.: Still waiting for my GPS module to arrive ..
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Airplane mode RTH
Sebbi wrote:
I don't think using the accelerometer on an airplane would improve altitude holding. Even GPS altitude would be good enough for basic return to me logic (as many commercial OSDs offer)
P.S.: Still waiting for my GPS module to arrive ..
Don't say that, you will get flamed for even suggesting that. Ha!
Re: Airplane mode RTH
Well I suppose with a strong enough motor you could try to let an airplane hover over the same spot (basically turning it into a Helicopter/Unocopter). The Mahowiks code (and thus baro/acc altitude measurements) could come in handy
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Airplane mode RTH
The way I see it, anything that is flying above 200 feet, GPS is good enough. Now if we are talking under 50 feet, well that is a totally different story.
Re: Airplane mode RTH
Most more advanced OSDs with RTH use baro now for altitude hold, one notable example is RVOSD (which current fpv distance record holder Roberto Montiel uses), among other people...I believe also some other osds use a baro...Basically we would just need a baro code which is accurate about 5m, the more the better of course.
-
- Posts: 2261
- Joined: Sat Feb 19, 2011 8:30 pm
Re: Airplane mode RTH
I think if my memory is correct, Dennis (Creator of the DIYODS) stated he was getting something like +- 10 meters with his GPS. But again, he also stated, he flies at an altitude of 5000 feet and higher. EEK!
Last edited by copterrichie on Fri Sep 28, 2012 9:14 pm, edited 1 time in total.
Re: Airplane mode RTH
I believe the usual estimate about gps accuracy is 30m ,so your estimate on using it on altitudes over 200 feet is about right...I just don't have a feeling about how the altitude value the gps antenna picks up from the satelites fluctuates,...If it fluctuates badly it wouldn't be nice for the aeroplane..
Re: Airplane mode RTH
From my tests i seems to hold within 5 meters.
It just overcompensates +/- 2m around target alt.(FishTailing)
In a short timespan <5 min..
I need better tuned regulator.
It just overcompensates +/- 2m around target alt.(FishTailing)
In a short timespan <5 min..
I need better tuned regulator.
Re: Airplane mode RTH
Got my GPS, but the plane needs repairs after I landed it on a tree and had to shoot it down with bow & arrows
Re: Airplane mode RTH
Sebbi wrote:Got my GPS, but the plane needs repairs after I landed it on a tree and had to shoot it down with bow & arrows
Great that you got the gps, bad news about the plane .. So soon some more development will come .
Re: Airplane mode RTH
I laded on a tree to this summer.
But i called the Firedepartment!
Only damage was a small scrach under the wing
But i called the Firedepartment!
Only damage was a small scrach under the wing
- NikTheGreek
- Posts: 348
- Joined: Thu Dec 08, 2011 4:17 pm
- Location: Greece
- Contact:
Re: Airplane mode RTH
Sebbi wrote:Got my GPS, but the plane needs repairs after I landed it on a tree and had to shoot it down with bow & arrows
hunting season is open
Re: Airplane mode RTH
I thought the fire department would be too expensive, so i left it up in the tree over night and shot arrows with kite line up there ... elevator came apart first, then one wing after the other and finally the important part of the plane came down. I glued everything back together (it's a Frankenplane now) and hope it is fit to fly again
Any progress on your airplane RTH code from last time, PatrikE?
Any progress on your airplane RTH code from last time, PatrikE?
Re: Airplane mode RTH
Speaking of Huntig seasson...
I will be away for ElkHunting next week meaning no flight testing possible..
I will try to sum up a test version for you to experiment with during the week.
I have dicovered that GPS only is not really god for navigating.
It have a lag of almost 5-10 seconds and overshoot severly!(also mentioned in the ArduPilot code)
When i switched to a FC with MAG it all improved a lot!...
The altitude works quite well.
I will work nightshift to night an will try to upload a test dev before bedtime tomorrow morning;)
Don't expect to much without MAG.
ps.
The firedepartment used it as a prctise
They think this kind of missions it funny in contrast of real dissasters.
You can always ask!...
I will be away for ElkHunting next week meaning no flight testing possible..
I will try to sum up a test version for you to experiment with during the week.
I have dicovered that GPS only is not really god for navigating.
It have a lag of almost 5-10 seconds and overshoot severly!(also mentioned in the ArduPilot code)
When i switched to a FC with MAG it all improved a lot!...
The altitude works quite well.
I will work nightshift to night an will try to upload a test dev before bedtime tomorrow morning;)
Don't expect to much without MAG.
ps.
The firedepartment used it as a prctise
They think this kind of missions it funny in contrast of real dissasters.
You can always ask!...
Re: Airplane mode RTH
Read the Textfile in the rar file for instrutions
MultiWii_FW_NAV_TEST.rar
MultiWii_FW_NAV_TEST.rar
Re: Airplane mode RTH
Nice, thank you. I have a spare mag lying aroundand will try to integrate it. But as long a GPS only RTH "kind of returns" the plane that's ok too, i guess
Re: Airplane mode RTH
Maybe this would be useful as an added function: http://www.rcgroups.com/forums/showthread.php?t=1741164
-
- Posts: 178
- Joined: Fri Apr 01, 2011 10:32 pm
- Location: Czech Republic, Prague
Re: Airplane mode RTH
Hi all,
it seems to be quite silent here...
Whole summer passed so many tests with plane navigation must have been done from the last post. How were the results with the plane RTH?
I just installed MultiWii stabilisation into one of my planes (thanks to all, namely Patrick)- seems to stabilize very nice so RTH should be the next logical step.
On the multicopter now RTH works fine so I hope for planes it will come as well.
Unfortunately I'm unable to code it alone but I can help testing it.
I played recently with 10Hz GPS and found that position data are refreshed very fast - really each 100ms GPS provides new unique position and course but height data are very lagy - seems to be some way internally filtered. When the copter (where I tested it) changed height, it took usually about 10-20 seconds until the height data stabilised on the new value but I'd say that it didn't fluctuate much when the height was stable. I hope it can be used to keep height e.g. this way: it will keep the last known throttle and measure height each e.g. 5 seconds. If height goes up, it will decrease throttle for e.g. 5% and the opposite, keep it for the next 5s, measure again... This should some way work for a SIMPLE emergency RTH if the height regulation is slow enough and height is above 50m. Fortunately in compare to multicopters planes can glide
Maybe this will help.
Roman
it seems to be quite silent here...
Whole summer passed so many tests with plane navigation must have been done from the last post. How were the results with the plane RTH?
I just installed MultiWii stabilisation into one of my planes (thanks to all, namely Patrick)- seems to stabilize very nice so RTH should be the next logical step.
On the multicopter now RTH works fine so I hope for planes it will come as well.
Unfortunately I'm unable to code it alone but I can help testing it.
I played recently with 10Hz GPS and found that position data are refreshed very fast - really each 100ms GPS provides new unique position and course but height data are very lagy - seems to be some way internally filtered. When the copter (where I tested it) changed height, it took usually about 10-20 seconds until the height data stabilised on the new value but I'd say that it didn't fluctuate much when the height was stable. I hope it can be used to keep height e.g. this way: it will keep the last known throttle and measure height each e.g. 5 seconds. If height goes up, it will decrease throttle for e.g. 5% and the opposite, keep it for the next 5s, measure again... This should some way work for a SIMPLE emergency RTH if the height regulation is slow enough and height is above 50m. Fortunately in compare to multicopters planes can glide
Maybe this will help.
Roman
Re: Airplane mode RTH
@ patrik,
Dear, i have Hobbyking Multiwii Board with MPU6050 + HMC5883L + BMP085 Sensors. i want to test your code with RTH function. dear, will it work on Hobbyking board or not?. thanks
Dear, i have Hobbyking Multiwii Board with MPU6050 + HMC5883L + BMP085 Sensors. i want to test your code with RTH function. dear, will it work on Hobbyking board or not?. thanks
Re: Airplane mode RTH
Hi faraz.
The board is supported.
I made some changes in the linked file.
Download it to get the latest changes.
I have -20 degree and can't do any tests atm..
The board is supported.
I made some changes in the linked file.
Download it to get the latest changes.
I have -20 degree and can't do any tests atm..
Re: Airplane mode RTH
Patrike what hapen .Did you test your plane ?
Re: Airplane mode RTH
Sorry but Winter isn't my flying season.
But @faraz have done some flighttests.
Last i heard from him RTH worked.
A PID regulator is still needed to remove the overstering,
Only the P part is included.
But with smaller compensations it returns quite nice.
Feel free to test.
We need to get this working now.
But @faraz have done some flighttests.
Last i heard from him RTH worked.
A PID regulator is still needed to remove the overstering,
Only the P part is included.
But with smaller compensations it returns quite nice.
Feel free to test.
We need to get this working now.
- Attachments
-
- MultiWiiFW_Nav.zip
- (135.92 KiB) Downloaded 676 times
Re: Airplane mode RTH
I agree, lets get this working. It should get warmer and less wet in february
Re: Airplane mode RTH
Sebbi wrote:I agree, lets get this working. It should get warmer and less wet in february
HA! I Would you say March-April around here....
Re: Airplane mode RTH
I tried the current dev version of MultiWii on my NanoWii board (Arduino Leonardo). 23728 bytes of 28672 bytes used when compiled with I2C_GPS ... I hope 5k will be enough for RTH (and FrSky telemetry).
Re: Airplane mode RTH
The RTH code is smaller than 0.7K.
Binary sketch size: 24 350 bytes on a Arduino Leonardo compiled with I2C_GPS
I havn't tested FrSky telemetry.
Binary sketch size: 24 350 bytes on a Arduino Leonardo compiled with I2C_GPS
I havn't tested FrSky telemetry.
Re: Airplane mode RTH
That's very small, wow!
I testcompiled a version with FrSky telemetry and it makes a difference of 2.3K. I am sure this can be optimised further. I have high hopes we can get both features to a state so it can be included in MultiWii
I testcompiled a version with FrSky telemetry and it makes a difference of 2.3K. I am sure this can be optimised further. I have high hopes we can get both features to a state so it can be included in MultiWii
Re: Airplane mode RTH
PatrikE wrote:Sorry but Winter isn't my flying season.
But @faraz have done some flighttests.
Last i heard from him RTH worked.
A PID regulator is still needed to remove the overstering,
Only the P part is included.
But with smaller compensations it returns quite nice.
Feel free to test.
We need to get this working now.
Hi PatrikE,
two questions:
- At the Moment only FixedWing Aircrafts ( like Bixler or Easystar ) are supported ?
- Home Point is set when GPS gets fix ?
Thanks
Kayle
Re: Airplane mode RTH
Home point is set when GPS has a 3D fix, system is armed and it wasn't set before. With the default settings it is set on every arming of the system which might be not desired on airplanes (uncomment DONT_RESET_HOME_AT_ARM in config.h to prevent that).
If you want to reset home without disarming/arming first you can use the gyro calibration stick combination which also resets home (and sets a new ground level altitude when using baro).
If you want to reset home without disarming/arming first you can use the gyro calibration stick combination which also resets home (and sets a new ground level altitude when using baro).
Re: Airplane mode RTH
@Kayle.
From def.h
All airplane models is counted as FixedWing Aircrafts and included in Fixedwing Navigation.
DUALCOPTER & SINGLECOPTER Is probobly not suitable for FW-Navigation.
But Planes and Wings is supposed to work.
From def.h
All airplane models is counted as FixedWing Aircrafts and included in Fixedwing Navigation.
Code: Select all
#if defined (AIRPLANE) || defined(FLYING_WING)|| defined(SINGLECOPTER)|| defined(DUALCOPTER)
#define FIXEDWING
#endif
DUALCOPTER & SINGLECOPTER Is probobly not suitable for FW-Navigation.
But Planes and Wings is supposed to work.
Re: Airplane mode RTH
Thanks Sebbi and PatrikE for your help.
Kay
Kay
Re: Airplane mode RTH
Sebbi wrote: With the default settings it is set on every arming of the system which might be not desired on airplanes (uncomment DONT_RESET_HOME_AT_ARM in config.h to prevent that).
If you want to reset home without disarming/arming first you can use the gyro calibration stick combination which also resets home (and sets a new ground level altitude when using baro).
On Airplane GPS is used for altitude!
If you glide with no throttle one can accidetial Disarm with Yaw or Roll!
A New Home position will be set when it's ReArmed. (Lat,Long,Alt)
Your HomePos can suddenly be 500m away @150m alt.
It's confusing when your debugging!...
Don't ask How i know!...
Re: Airplane mode RTH
That's why I uncomment DONT_RESET_HOME_AT_ARM on MultiWii for my airplane and the arming via the sticks (it's on a switch)
Re: Airplane mode RTH
Maybe It should be hard coded in defines for fixed wing?
-
- Posts: 178
- Joined: Fri Apr 01, 2011 10:32 pm
- Location: Czech Republic, Prague
Re: Airplane mode RTH
Hi!
I just loaded this viewtopic.php?f=7&t=2456&start=30#p29962 fixed wing navigation version into Crius lite 1.0 board to be ready for testing when the weather improves, but I have problem that software wrongly reads throttle channel from the RX.
I'm using 35MHz receiver Corona RP8D1 connected normally via 6 wires to D2,D4-7,D12. I have signal, wiring and enpoints surely OK, with 2.2 pre it reads perfectly. If I load the FW navigation version above, on the GUI all channels except throttle are readed OK, but throttle bar is most of the time stuck on exactly 1500 and sometimes (~once per 2 seconds) for very short moment (~0.1s) jumps to the correct value where really is my throttle stick. Then returns again to 1500. Cycle time is about 3500-3800.
Do you have any idea what's wrong?
Thanks!
Roman
I just loaded this viewtopic.php?f=7&t=2456&start=30#p29962 fixed wing navigation version into Crius lite 1.0 board to be ready for testing when the weather improves, but I have problem that software wrongly reads throttle channel from the RX.
I'm using 35MHz receiver Corona RP8D1 connected normally via 6 wires to D2,D4-7,D12. I have signal, wiring and enpoints surely OK, with 2.2 pre it reads perfectly. If I load the FW navigation version above, on the GUI all channels except throttle are readed OK, but throttle bar is most of the time stuck on exactly 1500 and sometimes (~once per 2 seconds) for very short moment (~0.1s) jumps to the correct value where really is my throttle stick. Then returns again to 1500. Cycle time is about 3500-3800.
Do you have any idea what's wrong?
Thanks!
Roman
Re: Airplane mode RTH
Updated with latest dev,
TX shows correct values now.
On my Crius SE compiled size wa to big to fit.
Opend def.h and commented the BMP085 to free space.
It's not used on Airplane anyway.
*edit
New file location.
TX shows correct values now.
On my Crius SE compiled size wa to big to fit.
Opend def.h and commented the BMP085 to free space.
It's not used on Airplane anyway.
*edit
New file location.
Last edited by PatrikE on Sun Mar 03, 2013 5:10 pm, edited 1 time in total.
-
- Posts: 178
- Joined: Fri Apr 01, 2011 10:32 pm
- Location: Czech Republic, Prague
Re: Airplane mode RTH
Hi Patrik,
I just uploaded that version into my board for plane control and with selected only MPU6050 it compiles OK with about 27kB of size, but unfortunately the throttle reading problem is still there (pure r1356 reads it OK.) You can see the problem captured on that video: http://youtu.be/bYFlp-hBSOE
I'm attaching my config and ask you for any advice - unfortunately alone I'm unable to find and correct the problem in the code.
Thanks!
Roman
I just uploaded that version into my board for plane control and with selected only MPU6050 it compiles OK with about 27kB of size, but unfortunately the throttle reading problem is still there (pure r1356 reads it OK.) You can see the problem captured on that video: http://youtu.be/bYFlp-hBSOE
I'm attaching my config and ask you for any advice - unfortunately alone I'm unable to find and correct the problem in the code.
Thanks!
Roman
PatrikE wrote:Updated with latest dev,
TX shows correct values now.
On my Crius SE compiled size wa to big to fit.
Opend def.h and commented the BMP085 to free space.
It's not used on Airplane anyway.
- Attachments
-
- config.zip
- Config I'm using for Crius Lite 1.0 (only MPU6050)
- (20.09 KiB) Downloaded 557 times
Re: Airplane mode RTH
You have a copy/paste error otherwise your config looks ok.
Check individual sensor orientation and compare with original.
On my setup i have AIRPLANE, GPS_promimi, NMEA, SAFETY_SWITCH and the sensors enabled.
You ave enabled a lot of features in your setup.
FAILSAFE
VBAT
GYROCALIBRATIONFAILSAFE
BUZZER
The only thing that should disturb trottle is FAILSAFE.
Try to enable one function at the time to se where the trouble is caused.
I'll check on my setup and se if i can reproduce the glitches.
Check individual sensor orientation and compare with original.
On my setup i have AIRPLANE, GPS_promimi, NMEA, SAFETY_SWITCH and the sensors enabled.
You ave enabled a lot of features in your setup.
FAILSAFE
VBAT
GYROCALIBRATIONFAILSAFE
BUZZER
The only thing that should disturb trottle is FAILSAFE.
Try to enable one function at the time to se where the trouble is caused.
I'll check on my setup and se if i can reproduce the glitches.