Airplane mode

This forum is dedicated to software development related to MultiWii.
It is not the right place to submit a setup problem.
Software download
Post Reply
PatrikE
Posts: 1976
Joined: Tue Apr 12, 2011 6:35 pm
Location: Sweden
Contact:

Re: Airplane mode

Post by PatrikE »

Hi.
I can actually compile MultiWii_dev_20120528 in a Promini 5V/16Mhz

Code: Select all

#define FLYING_WING
#define WMP
#define GYRO_SMOOTHING {20, 20, 3}    // separate averaging ranges for roll, pitch, yaw
#define SERIAL_SUM_PPM         ROLL,PITCH,THROTTLE,YAW,AUX1,AUX2,AUX3,AUX4 //For Robe/Hitec/Futaba

And still have a few bytes in spare.

Maby it's time to upgrade to a 328 or a Mega!.. ;)

fallenangel3k
Posts: 6
Joined: Fri Jun 08, 2012 12:21 pm

Re: Airplane mode

Post by fallenangel3k »

hi there, I'm new to this forum and pretty excited about what's going on here... great work!

any chances that someone integrates the fixed wing navigation into the newest dev-build (20120606)? would be nice to be up to date.. ^^

creating a diff would be fine, too. it's hard to finde the differences between the original version and the one with the fixed wing navigation. if I would know what parts have to copied to the new file, to make it work there, I would do it myself.


best greets,

marcus

User avatar
Hamburger
Posts: 2580
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Airplane mode

Post by Hamburger »

if you want latest bang, grab the developers' tree - it is named _shared (under sources / trunk). Try at your own risk as always.

fallenangel3k
Posts: 6
Joined: Fri Jun 08, 2012 12:21 pm

Re: Airplane mode

Post by fallenangel3k »

thanks for the tipp! how do I contribute to the svn, how do I create my own branch?

I coded some lines to use the A2 pin as an additional servo-output to controll the landing-flaps on my FPV-raptor (of course only works when CAMTRIG is not defined!)

the original code in airplane mode was only for flaperons, flaps mixed to ailerons... I wanted more and it works like charme. also made selectable AUX channel for camera-pan/tilt (connected to A1, A0), so it now works with transmitters which dont support AUX3/AUX4, too.

back to my original question.... is the fixed wing navigation already included in the shared trunk? also why we cant simply use the standart gps function already included?

greets,

marcus

User avatar
Hamburger
Posts: 2580
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Airplane mode

Post by Hamburger »

marcus,
for svn write access you must contact Alex. Prior to that you might publish your diff here.

I do not use GPS, so Patrik will have to answer that.

fallenangel3k
Posts: 6
Joined: Fri Jun 08, 2012 12:21 pm

Re: Airplane mode

Post by fallenangel3k »

hi, thanks!

here you can find my diff:

diff for config.h --> http://diffchecker.com/krm8h0e4
diff for dev.h --> http://diffchecker.com/c90vdb3y
diff for output.ino --> http://diffchecker.com/71O60y0r


greets,

marcus

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

Re: Airplane mode

Post by PatrikE »

I can add traditional flaps to the trunk.
Code is ready but I must check with servos first.

The Gps needs more tuning before i commit.

fallenangel3k
Posts: 6
Joined: Fri Jun 08, 2012 12:21 pm

Re: Airplane mode

Post by fallenangel3k »

yes, please do so

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

Re: Airplane mode

Post by PatrikE »

I comitted Flaps to shared.
I have problem with the Gui But everyting works IRL.

/Patrik

fallenangel3k
Posts: 6
Joined: Fri Jun 08, 2012 12:21 pm

Re: Airplane mode

Post by fallenangel3k »

thanks!

you also should include different endpoints for the traditional flaps and the flapperons, just as I did, too.. gives some more flexibility. I want the EP of my flapperons to be way less than the EP of my normal flaps.


regards

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

Re: Airplane mode

Post by PatrikE »

fallenangel3k wrote:thanks!
I want the EP of my flapperons to be way less than the EP of my normal flaps.


Ok ill fix that..
And maby possibility to slow down the flaps.
Looks nice if they move during 2 sec or so.. :idea:

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

Re: Airplane mode

Post by msev »

So is atmega328 still enough for all the functions..for example lets say:
- wmp+adxl345
- autodetect gps or gui
-gps rth + pos hold
- option to trigger rth when failsafe (measuring voltage of receiver)
- flaps
-maybe i2c oled lcd for field pid adjustments, no big deal if its not enough room for this

Another thing if in the future waypoints would be added would that be over the top for atmega328?

Btw from where is the code for plane rth, pos hold..did you write from scratch?

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

Re: Airplane mode

Post by PatrikE »

For a Basic setup like.
Gyro+Acc+Gps.
There will be lots of memory left for navigation.

The memory problem comes when you use a 10Dof sensorboard.
And in the ariplane you dont need all the sensors.

For example you can comment the Baro in the config for the board to save tons of memory.
The barocode is memory consuming.


I'm trying to use the exising gpsdata within the project and make the nav from scrach.

//Patrik

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: Airplane mode

Post by dramida »

You should have a look at ardupilot 1 legacy code for GPS nav functions on fixed wing and atmega328. It already has waypoint navigation, rth and circle.
Eos Bandi did the same for AC2 loiter code with great success.

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

Re: Airplane mode

Post by PatrikE »

I have now added Separate endpoints for Flapperons and Flaps.
The servospeed is also configurable via define.
Changes is in _shared.

Kayle
Posts: 141
Joined: Sun Feb 13, 2011 6:45 pm

Re: Airplane mode

Post by Kayle »

Hi,

i ask it some posts ago -> Can i use navigation and stabilisation with your Code on my Fixed Wing ? Only 2 Rudder ?

Kayle

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Airplane mode

Post by copterrichie »

Guys, I just did a search of this forum for "Flaperon", question is anyone doing them with the Airplane mode? If so, how do you have them configured?

Thank you.

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

Re: Airplane mode

Post by PatrikE »

Kayle wrote:Hi,
i ask it some posts ago -> Can i use navigation and stabilisation with your Code on my Fixed Wing ? Only 2 Rudder ?
Kayle


Sorry i missed the question Kayle.

It will be possible to select how you want to navigate.
The setting will look like this.

Code: Select all

    /** Invert the direction for gpsNAV { ROLL,RUDDER,ELEVATOR } **/
    #define GPS_DIRECTION               {  -1,    0,    1    }  /* Set zero to disable invert with -1. */

I'm not shure how stabilisation will work without ailerions... :?
But i think it may work. (Don't hit me if i'm wrong..)

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

Re: Airplane mode

Post by PatrikE »

copterrichie wrote:Guys, I just did a search of this forum for "Flaperon", question is anyone doing them with the Airplane mode? If so, how do you have them configured?
Thank you.

I use flapperons on my plane and it works really good.

Using a 2-Way Switch and send 1000-2000 to MWii on AUX4.
Setting up suitable endpoints in the config.
Change FLAP_INVERT so both ailerions move same direction when flaps is acivated.
Ailerions will still work same way as normal only the center is offset with flapAngel.

Code: Select all

     #define FLAP_CHANNEL     AUX4       // Define the Channel to controll Flaps with.If used.
     #define FLAP_EP      { 1500, 1650 } // Endpooints for flaps on a 2 way switch else set {1020,2000} and program in radio.
     #define FLAP_INVERT    { 1, -1 }    // Change direction om flaps { Wing1, Wing2 }


When used it will bring down the stallspeed and create more lift on the wing.

In _shared the defines have been renamed to FLAPPERONS and Traditional FLAPS have been added.

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Airplane mode

Post by copterrichie »

Awe!!! Thank you.

User avatar
dramida
Posts: 473
Joined: Mon Feb 28, 2011 12:58 pm
Location: Bucharest
Contact:

Re: Airplane mode

Post by dramida »

How in the world i reverse the giro corrections applied to servos for airplane? (MWC dev 6 iun 2012) In config.h i can only reverse the RC inputs... Where is the equivalent of Tricopter YAW DIRECTION?

LAtest edit: I was wrong , it changes also the giro corrections :D

penpen77
Posts: 73
Joined: Tue Jan 24, 2012 10:45 pm

Re: Airplane mode

Post by penpen77 »

i've tested airplane mode this afternoon on a bixler/skysurfer plane, gyro is ok, but i've got some issue on ACC/level mode.... it seems that stick combination for trimming ACC doesn't work.

I've tested on last version (22/06) with ITG3205+adxl345

any idea ? or which part of code is dedicated to specific airplane leveling ?

Edit: other weird part, the "D" value of Level in the GUI (any of them) is the rate of servo, 100 => 100% rate. Is it normal ? Is there other hidden parameters like this one ?

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

Re: Airplane mode

Post by PatrikE »

Can your Radio reach.

Code: Select all

// ******************
// rc functions
// ******************
#define MINCHECK 1100
#define MAXCHECK 1900
Located in MultiWii Tab.

I use dualRates at 120% and 80%.
One for flying and one for stick combinations.

100 => 100% rate. It should be.
But Level "D" will also effect the rates D=9 is Equal to 100%. (@Hamburger discovered this.)
There's no MaxLimit for the rates in the code and you can go higher than 100% if you need.
Only other limit for the servos is 1020-2000 µs,

xuant9
Posts: 12
Joined: Mon Jun 18, 2012 10:33 pm

Re: Airplane mode

Post by xuant9 »

PatrikE wrote:Can your Radio reach.

Code: Select all

// ******************
// rc functions
// ******************
#define MINCHECK 1100
#define MAXCHECK 1900
Located in MultiWii Tab.

I use dualRates at 120% and 80%.
One for flying and one for stick combinations.

100 => 100% rate. It should be.
But Level "D" will also effect the rates D=9 is Equal to 100%. (@Hamburger discovered this.)
There's no MaxLimit for the rates in the code and you can go higher than 100% if you need.
Only other limit for the servos is 1020-2000 µs,



I come to support you, I now is your fans

PatrikE, it's wonderful

penpen77
Posts: 73
Joined: Tue Jan 24, 2012 10:45 pm

Re: Airplane mode

Post by penpen77 »

PatrikE wrote:Can your Radio reach.

Code: Select all

// ******************
// rc functions
// ******************
#define MINCHECK 1100
#define MAXCHECK 1900
Located in MultiWii Tab.


yep, no probs with that, led is blinking at each stick combo for acc trimming and it works fine when i compile for quad mode.

More generally, i thinks it should be great ti be able to see trimming value in GUI, even in quad mode, acc trimming is always painfull....

Just one thing to check, plane leveled, calibration is done. So i switch to acc/level mode, ail/elev perfectly "flat", i tilt a little (not to much, led doesn't blink) the plane,roll for example, aileron are moving and staying at a position which normaly should level the plane (to the difference of gyro mode which is just a correction, ail/elev/rudd doesn't keep the position). Anyway, by trimming ACC and keeping plane tilted(still a little bit), i should see ailerons decrease/increase their position, to correct the new attitude right ?

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

Re: Airplane mode

Post by PatrikE »

To se the trim i the gui you can use debug function.

use this somewhere in the code. ex last in the loop.

Code: Select all

debug[3]=conf.angleTrim[0] for Roll
debug[4]=conf.angleTrim[1] for Nick


It will show in gui as debug 3 & 4.

penpen77
Posts: 73
Joined: Tue Jan 24, 2012 10:45 pm

Re: Airplane mode

Post by penpen77 »

ok, thanks, i see now the prob, the trimming increment is waaaaayyyy too low, +/-2, amplitude of my controle surface are ~500... so, it take eternity to reach a value which produce a real diff. I'll put a conditionnal behavior with AUX to change increment value like Fine/Exp/ExFine

Kayle
Posts: 141
Joined: Sun Feb 13, 2011 6:45 pm

Re: Airplane mode

Post by Kayle »

Hi PatrikE,

It was my fault. I don't mean 2 rudder. I have a flying wing and like to use your code for stabilize my wing and use the rth function.

Here is my flying wing:
Image

Is it possible to use the rth with this wing or must i use a plan with elevator and rudder?

Kayle

Erazotropa
Posts: 5
Joined: Mon Dec 19, 2011 3:39 pm

Re: Airplane mode

Post by Erazotropa »

Hi all,

I was disassembling my quads today, and took out my Crius SE boards.
And wondered if they could be used for my FPV planes..
Then i came accros this topic,

Is this board compatible for the Airplane software?
And can i run a GPS with it with rth function?

These are the specs:
MultiWii SE Standard Edition Hardware configuration:
· ATMEGA328P microcontroller
· ITG3205 three-axis digital gyroscope
· BMA180 triaxial accelerometer
· BMP085 pressure sensor
· HMC5883L axis magnetoresistive sensor (electronic compass)

Many thanks in Advance.

Bjorn

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

Re: Airplane mode

Post by PatrikE »

Your board will work fine.
The gps code for copters dont work for plane.

Im trying to fix a rth for fixed wing atm.
It will work on airplane and flying wings.(i hope...)

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

Re: Airplane mode

Post by msev »

Patrik do you have a 9x with its original module + receiver (8ch or 6 ch) at home? If you have maybe you could test some routine to enable failsafe (rth), when rc signal to receiver is lost?

Did you manage to get any improvement in altitude using just gps? Do you think it would be ok to use just gps or will we have to eventually use a baro?

hwurzburg
Posts: 75
Joined: Sun Jan 01, 2012 3:28 pm

Re: Airplane mode

Post by hwurzburg »

Well, I'm back playing with the MultiWii in a plane...a flying wing this time....
making code modifications....
1. Arm on powerup _ DONE
2. Changing the throttle attenuation curve to start at 1/4 throttle instead of 1/2 throttle....my wing cruises at 1/4 throttle and will oscillate at 1/2 throttle with the gains high like I like em ;) - DONE

Am going to start working on converting the BaroPID to controlling a small range of pitch instead of throttle...I need to smooth the altitude error out a lot more also...using the existing code, I get a lot of throttle variation....I might try lowering the P more too before giving up...

BUT my question is this: does anyone have a utility that can DIFF two sketches, either module by module or in its entirety? so that I can compare differences in the code?


thanks

User avatar
Hamburger
Posts: 2580
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Airplane mode

Post by Hamburger »

I use diff - on *ix or macosx

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

Re: Airplane mode

Post by PatrikE »

I use Winmerge.

Tommie
Posts: 438
Joined: Sun Apr 08, 2012 9:50 am

Re: Airplane mode

Post by Tommie »

Or use a sane versioning system (git/hg/...) whose distributed nature allows you to preserve your local changes and compare them to new upstream versions.

hwurzburg
Posts: 75
Joined: Sun Jan 01, 2012 3:28 pm

Re: Airplane mode

Post by hwurzburg »

thanks PartikE....loving WinMerga...just what I needed....

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: Airplane mode

Post by captaingeek »

hmmmm so how's this working so far? I got a new plane i'd like to test it on. using a 328 with a gyro and acc.

plane's elevon's only.

is it possible?

can you active / deactivate the mw through a tx switch?

kewl stuff guys way to go.

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

Re: Airplane mode

Post by PatrikE »

elevon's only?
Wouldnt FlyingWing mix be great for that?
Otherwise its possible to change the Airplanemix to suit your setup.

You can use Passthru to disable mwc code.
Select a AUX in gui.

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: Airplane mode

Post by captaingeek »

Elevon's with rudder basically...

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: Airplane mode

Post by captaingeek »

which output's should i use for a wing? throttle d9, left wing 11, right wing 12?

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: Airplane mode

Post by captaingeek »

Here's the plane I'm using it's called a peace drone. Can't wait to see what the video will look like with gyro and level mode active...

http://www.youtube.com/watch?v=488oom90 ... ata_player

User avatar
captaingeek
Posts: 228
Joined: Fri Jan 28, 2011 6:42 pm

Re: Airplane mode

Post by captaingeek »

Can anyone let me know which pins to use for a flying wing setup?

User avatar
Hamburger
Posts: 2580
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Airplane mode

Post by Hamburger »

another setup guide for airplane - not flying wing - can be found here http://fpv-community.de/attachment.php? ... 1344329226

hakank
Posts: 2
Joined: Sat Mar 17, 2012 3:01 pm
Location: Sweden

Re: Airplane mode

Post by hakank »

hwurzburg wrote:Well, I'm back playing with the MultiWii in a plane...a flying wing this time....
making code modifications....
1. Arm on powerup _ DONE
2. Changing the throttle attenuation curve to start at 1/4 throttle instead of 1/2 throttle....my wing cruises at 1/4 throttle and will oscillate at 1/2 throttle with the gains high like I like em ;) - DONE

Am going to start working on converting the BaroPID to controlling a small range of pitch instead of throttle...I need to smooth the altitude error out a lot more also...using the existing code, I get a lot of throttle variation....I might try lowering the P more too before giving up...

BUT my question is this: does anyone have a utility that can DIFF two sketches, either module by module or in its entirety? so that I can compare differences in the code?


thanks


How did you change the throttle attenuation curve to start at 1/4 throttle instead of 1/2 throttle?

Thanks,

/Håkan

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

Re: Airplane mode

Post by PatrikE »

Look up this in MWii fle

Code: Select all

  #define BREAKPOINT 1500

Change to a value where you want TPA to start.

You will still have the issue if you throttle down and dive fast.
On a plane position of the throttleStick and speed can diff a lot!
Maby time to implement speed meassuring?

Kayle
Posts: 141
Joined: Sun Feb 13, 2011 6:45 pm

Re: Airplane mode

Post by Kayle »

Maby time to implement speed meassuring?


Yeah with GPS, RTH and Cycling Function in Airplane Mode :mrgreen: :mrgreen: :mrgreen:

Kay

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Airplane mode

Post by copterrichie »

Hey Guys, I am trying to understand the logic of using Servo to drive the ESC for the Airplane mixing verse Motor when the Flying Wing uses Motor.

Thank you.

Flying Wing:

Code: Select all

#if defined(FLYING_WING)
    motor[0] = rcCommand[THROTTLE];


Airplane:

Code: Select all

if (!f.ARMED){ 
      servo[7] =  MINCOMMAND; // Kill throttle when disarmed
    } else {   
      servo[7] =  rcData[THROTTLE];
    }

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

Re: Airplane mode

Post by PatrikE »

copterrichie wrote:Hey Guys, I am trying to understand the logic of using Servo to drive the ESC


There is still people in remote locations of the world who run methanolBurners.. :shock:

Cheeper analog sevos don't handle 490Hz that good.
But all esc can handle 50Hz.

Just for compabillity!

copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Airplane mode

Post by copterrichie »

Oh, so you are saying they use a servo to control the throttle? Ok, I get it now so I can change that to motor with little or no Impact using an ESC.

Thanks.

User avatar
Hamburger
Posts: 2580
Joined: Tue Mar 01, 2011 2:14 pm
Location: air
Contact:

Re: Airplane mode

Post by Hamburger »

you can compare airplane against helicopter. Same issue.
I implemented a define to switch between servo[] and motor[] logic to control the motor.

One must use motor[] in order to make use of the powermeter feature.
One must use servo[] in order to drive an analog servo which floors the accelerator pedal.

Post Reply