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
copterrichie
Posts: 2261
Joined: Sat Feb 19, 2011 8:30 pm

Re: Airplane mode

Post by copterrichie »

What is the likelihood of at a minimum of adding the following config items to the GUI? Note: is there room to store these variables in EEPROM on the ATMEGA328?

Code: Select all

/***********************          Airplane                       ***********************/
    #define SERVO_RATES      {100, 100, 100, 100, 100, 100, 100, 100} // Rates in 0-100%
    #define SERVO_DIRECTION  { -1,   1,   1,   -1,  1,   1,   1,   1 } // Invert servos by setting -1


The reason I ask is, I am porting the Airplane code to Baseflight (Naze32) and it would be much easier to be able to set these from the GUI. I could also add them to the CLI but it would be much nicer in my opinion, to have a screen in the GUI to handle this.

Thank you

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

Re: Airplane mode

Post by Hamburger »

about same as with SERVO_TRIM for the 8 servo values :)
It is information that is dependant on coptertype - currently has not been done yet.
Desirable yes, but neither GUI nor the serial code allow for an easy addon for this.

(I tried it before the release of v2.1 but gave up on it. For the time being, I do not use the GUI - instead do that parameter tuning via LCD )

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

Re: Airplane mode

Post by copterrichie »

I know Flash memory is very low on the 328 and I never fully understood if EEPROM was the same memory as the flash, is there any EEPROM memory remaining for these variables?

As for my Baseflight, maybe it will be best to use the CLI but it sure would be nice to have a screen in the GUI for this.

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

Re: Airplane mode

Post by copterrichie »

Follow up question: If Airplane, Helicopter or Flying wing is defined, what are the chances of having a special serial protocol (code) just for them?

ReM
Posts: 14
Joined: Sun Jul 08, 2012 12:02 pm
Location: Lithuania

Re: Airplane mode

Post by ReM »

How to change the minthrottle value in Airplane mode? I see, that value is 1020.

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

Re: Airplane mode

Post by Hamburger »

from the spec sheet:
Flash Memory 16 KB (ATmega168) or 32 KB (ATmega328) of which 2 KB used by bootloader
SRAM 1 KB (ATmega168) or 2 KB (ATmega328)
EEPROM 512 bytes (ATmega168) or 1 KB (ATmega328)

eeprom is not at its limits (yet).
yes, it can be done (coded). Serial protocol already has one item destined to be extended for coptertype specific data.
Problems I see:
- on the sending side, depending on coptertype the number of data differs - could be done via #ifdef the different implementations
- on GUI side, must in code create/display/update varying number & different types of interface objects , depending on coptertype.

It can be done, sure. Feel free to code.

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

Re: Airplane mode

Post by copterrichie »

I will do it and post it here, will you review and add it to the code base?

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

Re: Airplane mode

Post by Hamburger »

I can at least try, if none of the more GUI inclined devs will do it.

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

Re: Airplane mode

Post by Hamburger »

Hamburger wrote:I can at least try, if none of the more GUI inclined devs will do it.


sorry, but for the time being I have to revoke the offer.
The current code does not compile for me - lcd+telemetry got broken in r1003. viewtopic.php?f=8&t=2287
I cannot modify and test code on that basis.

Cesco
Posts: 6
Joined: Thu Aug 23, 2012 12:48 am

Re: Airplane mode

Post by Cesco »

I did my first today, a crius SE board and multiwii 2.1, frsky ppm-sum receiver, fpv-raptor pusher plane 1600mm, and i have some questions.

The stabilisation with gyro does work, the gyros + accelerometer leveling does work too.
The "keep altitude" with baro doesent work. Normal?
The mag did not work (i forgot whitch switch on my transmitter enables mag).

Does the current version not use baro + mag ?

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

Re: Airplane mode

Post by PatrikE »

I have not tested Mag only Gyro/Acc.
The Mag should work it should work like for copters that part is exact same!
If you find the right switch i think it will work.

On the Multirotors Barocode change throttle to maintain altitude.
rcCommand[THROTTLE] = initialThrottleHold + BaroPID;
That wouldn't work on a normal airplane.

Throttle on airplane use rcData[THROTTLE].
But the flying wing uses rcCommand[THROTTLE] .

The BaroCode need to be changed for Planes to use elevator if it should work.

Yes Mag should work.
No Baro have no function!

Cesco
Posts: 6
Joined: Thu Aug 23, 2012 12:48 am

Re: Airplane mode

Post by Cesco »

Thanks patrick.
I will try the mag tomorrow.

I would like to test
rcCommand[THROTTLE] -= BaroPID - initialBaro;
rcCommand[PITCH] += BaroPID - initialBaro ;

The simultaneous increase in throttle and elev should make the plane climb while keeping the speed.
I have no idea what range the BaroPID data is and what factor to use with it.

Sebbi
Posts: 478
Joined: Sun Jul 08, 2012 1:08 am
Location: Germany
Contact:

Re: Airplane mode

Post by Sebbi »

Cesco wrote:I did my first today, a crius SE board and multiwii 2.1, frsky ppm-sum receiver, fpv-raptor pusher plane 1600mm, and i have some questions.

The stabilisation with gyro does work, the gyros + accelerometer leveling does work too.
The "keep altitude" with baro doesent work. Normal?
The mag did not work (i forgot whitch switch on my transmitter enables mag).

Does the current version not use baro + mag ?


As far as I can see from the code the altitude hold mode only influences the throttle as this controls altitude on multicopters. That obviously doesn't work on airplanes and it would need to control throttle and elevators to keep the height.

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

Re: Airplane mode

Post by PatrikE »

Baro altitude is in centimeter.
A diff on 1m will effect a lot on controlls.
Perhaps 1/10 to 1/6 or someting?

But if you check baroalt in gui you will notice that it changes ~20cm on the ground.
Also it can be disturbed by the windspeed in air.

But you wouldn't know if not testing it..;)

Cesco
Posts: 6
Joined: Thu Aug 23, 2012 12:48 am

Re: Airplane mode

Post by Cesco »

I have changed the code. But my plane is still in need of repairs. Too slow during landing -> stall -> crash.

Do you guys know a simple airspeed measuring device ? Differential pressure sensors seem hard to find, expensive, and mechanically challenging.

There was a way to measure approx airspeed with the help of 2 temperature sensitive resistors. One would be placed in the airstream, one not, both would be heated with the same amount of current passing trough them, and the temperature differential was an indicator of airspeed.

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

Re: Airplane mode

Post by copterrichie »

This would be a very interesting implementation: https://store.diydrones.com/Kit_MPXV700 ... 2dp-01.htm

I have seen tons of differential pressure sensors on ebay for less then 10 bucks the the above comes with everything needed.

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

Re: Airplane mode

Post by penpen77 »

Is it possible to translate/porting mwii airplane code to ardupilot hardware (the legacy one) to have benefit of mux/failsafe ?

Will AP(L) pinout let that possible ? since servo input/ouput wiring is already set.

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

Re: Airplane mode

Post by Kayle »

Is there any possibility to geht RTH working on Airplane ?

Kayle

dfidalgo
Posts: 23
Joined: Fri Sep 09, 2011 2:16 pm

Re: Airplane mode

Post by dfidalgo »

Sebbi wrote:
As far as I can see from the code the altitude hold mode only influences the throttle as this controls altitude on multicopters. That obviously doesn't work on airplanes and it would need to control throttle and elevators to keep the height.



My EasyGlider crashed many many times, have now the motor a little angled up, so always I throttle up the easyglider climb. I guess that in my plane the altitude hold may work just with throttle control.

Cesco
Posts: 6
Joined: Thu Aug 23, 2012 12:48 am

Re: Airplane mode

Post by Cesco »

After another flight in windy conditios today i did find:

- mag does not work at all
- alt hold does not work at all.

I went deeper inside the code, using the debug[0] output to check BaroPID value and "EstAlt += 10 * (rcData[YAW] - 1500);" to have a controllable altitude.

Now i dont understand the behaviour of BaroPID and i think the PID values are way off. When plane is too high BaroPID goes negative, that is OK. But then when plane returns to correct altitude BaroPID stays negative until the plane is much too low. Then same behaviour upwards. A nice oscillator. This is with stock pid values.

Also, the code doesent run on a atmega1280 ? Servo output is totally broken.

Cesco
Posts: 6
Joined: Thu Aug 23, 2012 12:48 am

Re: Airplane mode

Post by Cesco »

In my attempt to make the airplane code work with the mega1280 i have run into troubles, mainly i dont understand the servo out code at all, while the motor out code is straight and easy. So i did define airplane to have 4 motors.
The advantage of having 4 motors on a mega1280 is i can use hardware pwm to generate the servo signal. No isr's no bitbang, no jitter. The 1280 (and 2560) have enough pwm hardware for 4 or 6 servos. Now the servos want 50hz rate, not 500hz, so i had to activate the /8 prescaler on timers and change the values a bit.
Also i did move the airplane code into the "mixtable()" where all the other mixstuff is too.

Passtrough doesent work, i had to tweak the "output" to the conf utility, and probably some other stuff doesent work, but servo signal generation works.

Now you may ask why the trouble to go for a 1280 (or 2560) ? For me it was the number of serial devices. I want to connect a serial gps and i want to sent frsky telemetry data and the conf-gui should still work. I need 3 serial lines, not only 1.

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

Re: Airplane mode

Post by msev »

Cool that you guys are giving some love to the airplane branch :D...Why don't you guys use some code from arduplane code? There is also a port from Jean-Louis Nadine..Once you'll get things working it might be cool if you would post some video of how your plane flys on multiwii?

dfidalgo
Posts: 23
Joined: Fri Sep 09, 2011 2:16 pm

Re: Airplane mode

Post by dfidalgo »

msev wrote:Cool that you guys are giving some love to the airplane branch :D...Why don't you guys use some code from arduplane code? There is also a port from Jean-Louis Nadine..Once you'll get things working it might be cool if you would post some video of how your plane flys on multiwii?


Hi msev,

Do you have a link to this port (jean-Louis Nadine) ?
I have a Ardupilot Legacy around here, but I never bought the Fma sensors... :roll:

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

Re: Airplane mode

Post by msev »

Here is the iink: https://code.google.com/p/ardupilotdev/downloads/list It is especially tailored for Crius All in one pro board.
Its very awesome, the only thing that bothers me is that he doesn't want to implement detection of turnigy 9x receiver loss of signal...So that it would initiate failsafe when turnigy receiver looses signal...The 9x receiver has a specific behaviour on loss of signal, it stops outputting signal on throttle channel and remains last position on other channels..so the board would have to look only on throttle channel...But he really doesn't want to implement that...Would you help me implement that?

dfidalgo
Posts: 23
Joined: Fri Sep 09, 2011 2:16 pm

Re: Airplane mode

Post by dfidalgo »

Ohhh THANKS msev!!! That is what I'm looking for!
I have Tri's & Quads with Multiwii, and I love it, but for the airplane mode we must wait for new improvements... :/
I'll take some time reading this ardupilot port, Thank you ;)

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

Re: Airplane mode

Post by msev »

No problem :), can you help me out with that 9x receiver support?

Cesco
Posts: 6
Joined: Thu Aug 23, 2012 12:48 am

Re: Airplane mode

Post by Cesco »

Thanks msev. I have that crius AIO board but did not have the link to this version of ardupilot.

About mulitiwii i have the impression the code has become very big with tons of defines. For someone new it is quite difficult to work trough all the options and not loose it (concentration).

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

Re: Airplane mode

Post by PatrikE »

@Cesco

Yuo wrote.
- mag does not work at all

Mag only controlls rudder.
If you only have ailerions you need to add the dif to Roll
to get it to work.

frog32
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Airplane mode

Post by frog32 »

@patrik: how is the fixedwing navigation going? had you time to tweak it since you first postet the news about it?

greetings marc

dfidalgo
Posts: 23
Joined: Fri Sep 09, 2011 2:16 pm

Re: Airplane mode

Post by dfidalgo »

msev wrote:No problem :), can you help me out with that 9x receiver support?


Sorry msev, I don't have sufficient acknowledge to help you, but I suggest to buy another Tx module and receiver with standard Failsafe, brand (JR?) compatible with your Turnigy 9x, I suppose that solves your problem.

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

Re: Airplane mode

Post by Kayle »

frog32 wrote:@patrik: how is the fixedwing navigation going? had you time to tweak it since you first postet the news about it?

greetings marc


+1

Kayle

dfidalgo
Posts: 23
Joined: Fri Sep 09, 2011 2:16 pm

Re: Airplane mode

Post by dfidalgo »

+2 :)

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

Re: Airplane mode

Post by msev »

+100 :D

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

Re: Airplane mode

Post by copterrichie »

It is never too late to learn to code. :)

But seriously, we should use this forum to share what coding we do know and others can jump in as needed.

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

Re: Airplane mode

Post by msev »

Any news on some multiwii-flavoured arduplane port :D....That would be nice !

dfidalgo
Posts: 23
Joined: Fri Sep 09, 2011 2:16 pm

Re: Airplane mode

Post by dfidalgo »

The project multiwii is fantastic, I'm sorry there is so little interest in the airplane platform. I have here a CRIUS all in one and a shield with a MP6050 waiting for your developments. If this remains stalled, I will be forced to use the arduplaneng that is ready for gps navigation, but 100% new for me :( .
Where is Patrike????

KaiK
Posts: 58
Joined: Thu Jul 28, 2011 8:32 pm
Contact:

Re: Airplane mode

Post by KaiK »

Cesco wrote:In my attempt to make the airplane code work with the mega1280 i have run into troubles, mainly i dont understand the servo out code at all, while the motor out code is straight and easy. So i did define airplane to have 4 motors.
The advantage of having 4 motors on a mega1280 is i can use hardware pwm to generate the servo signal. No isr's no bitbang, no jitter. The 1280 (and 2560) have enough pwm hardware for 4 or 6 servos. Now the servos want 50hz rate, not 500hz, so i had to activate the /8 prescaler on timers and change the values a bit.
Also i did move the airplane code into the "mixtable()" where all the other mixstuff is too.

Passtrough doesent work, i had to tweak the "output" to the conf utility, and probably some other stuff doesent work, but servo signal generation works.

Now you may ask why the trouble to go for a 1280 (or 2560) ? For me it was the number of serial devices. I want to connect a serial gps and i want to sent frsky telemetry data and the conf-gui should still work. I need 3 serial lines, not only 1.



I think I have same problems as Cesco desribed...
Documented here: viewtopic.php?f=8&t=2385&p=22350#p22350

Ideas on that?

shagerott
Posts: 2
Joined: Sun Sep 30, 2012 1:47 pm

Re: Airplane mode

Post by shagerott »

Cesco wrote:In my attempt to make the airplane code work with the mega1280 i have run into troubles, mainly i dont understand the servo out code at all, while the motor out code is straight and easy. So i did define airplane to have 4 motors.
The advantage of having 4 motors on a mega1280 is i can use hardware pwm to generate the servo signal. No isr's no bitbang, no jitter. The 1280 (and 2560) have enough pwm hardware for 4 or 6 servos. Now the servos want 50hz rate, not 500hz, so i had to activate the /8 prescaler on timers and change the values a bit.
Also i did move the airplane code into the "mixtable()" where all the other mixstuff is too.

Passtrough doesent work, i had to tweak the "output" to the conf utility, and probably some other stuff doesent work, but servo signal generation works.

Now you may ask why the trouble to go for a 1280 (or 2560) ? For me it was the number of serial devices. I want to connect a serial gps and i want to sent frsky telemetry data and the conf-gui should still work. I need 3 serial lines, not only 1.


I'm interested in doing the same thing. Can you post the changes you made in output.ino to achieve the lower update rate for the servos? Thanks!

KaiK
Posts: 58
Joined: Thu Jul 28, 2011 8:32 pm
Contact:

AW: Airplane mode

Post by KaiK »

Problem wasnt the updaterate, but a wrong variable declaration causing a overflow.

Just checkout or download the latest output.ino from shared in repository...

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

Re: Airplane mode

Post by PatrikE »

Servos on MEGA boards is fixed.
In newest Dev-release Not V2.1!
http://code.google.com/p/multiwii/downloads/list

User avatar
DinoBravo
Posts: 6
Joined: Tue Jul 12, 2011 9:43 pm
Location: Canada

Re: Airplane mode

Post by DinoBravo »

How to change the Wing Ch12 to Ch9?

I have a warthox board for a multicopter and channel 12 has not been pinned out on the board. Pin 9 is one of the outputs on the board.
(btw the processor is a Promini).

I have tried changing the pin assignments in the def.h file, but have not been able to bring pin 9 to life.
Essentially tried swapping all the pin 9 and pin 12 assignments.
#define POWERPIN_PINMODE pinMode (9, OUTPUT);
//#define POWERPIN_PINMODE pinMode (12, OUTPUT);

Thanks for your help.

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

Re: Airplane mode

Post by PatrikE »

D9 => servo[7] is assigned to throttle and programmed with killswitch.

You can paste this QuickFix after the servoMix for airplane.
I do it like this on a FC who don't have D12 pinned out.

Code: Select all

         // Assisted modes (gyro only or gyro+acc according to AUX configuration in Gui
      servo[3]  =(servoMid[3] + ((axisPID[ROLL] + flapperons[0]) *servoReverse[3]));   //   Wing 1
      servo[4]  =(servoMid[4] + ((axisPID[ROLL] + flapperons[1]) *servoReverse[4]));   //   Wing 2
      servo[5]  =(servoMid[5] + (axisPID[YAW]                    *servoReverse[5]));   //   Rudder
      servo[6]  =(servoMid[6] + (axisPID[PITCH]                  *servoReverse[6]));   //   Elevator   
    } 
/*************************************************************/
//  QuickFix to copy D12 to D9! //
      servo[7]  = servo[3];  // QuickFix!...... !!!!
/*************************************************************/
    #endif

It will overwrite the killswitch code for the throttle.

NigelUno
Posts: 2
Joined: Thu Jan 20, 2011 11:10 am

Re: Airplane mode

Post by NigelUno »

A couple of flights with Multiwii (Airplane Mode) and my PID Attenuation mod (http://www.rcgroups.com/forums/showthread.php?t=1741164)

The plane is the Eaglewing from BevRC (not so good FPV plane :( ) and still needs some PID tuning.

http://www.youtube.com/watch?v=72qsNK6k ... e=youtu.be

Ciao

Luca

VU2ATX
Posts: 3
Joined: Sat Oct 27, 2012 7:55 pm

Re: Airplane mode

Post by VU2ATX »

Hi PatrikE!

I am new to this forum and very much interested in Multi-Wii Airplane Mode, have two boards;

1. Crius Upgrade Version MWC MultiWii Standard Edition Flight Controller V1.0 SE
http://www.goodluckbuy.com/crius-upgrad ... -0-se.html

2. MultiWii SE V2.0 Flight Controller w/FTDI
http://www.hobbyking.com/hobbyking/stor ... duct=27108

Would like to use the boards on Easystar and Skywalker, please help me chose the appropriate f/w.

Regards
VU2ATX

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

Re: Airplane mode

Post by PatrikE »

Latest stable version is always safest Current is V2.1.

The dev versions have the Horizon mode witch is very nice for the plane.
Horizon is softer than Angle mode.

I always fly latest code in _shared dev1232 should be quite safe.

VU2ATX
Posts: 3
Joined: Sat Oct 27, 2012 7:55 pm

Re: Airplane mode

Post by VU2ATX »

Hi PatrikE !

Thanks a lot for the prompt Reply.
By _shared dev1232 do you mean http://multiwii.googlecode.com/files/Mu ... _r1232.zip ?
I need bit more guidance on selection boards in the config.h file, for my two boards mentioned in above post.

Regards
VU2ATX

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

Re: Airplane mode

Post by PatrikE »

Hi VU2ATX,
Thats the correct file.

The GLB board is a Crius SE upgraded with i2c pinouts
//#define CRIUS_SE // Crius MultiWii SE

The FC from HK
//#define HK_MultiWii_SE_V2 // Hobbyking board with MPU6050 + HMC5883L + BMP085

/Patrik

VU2ATX
Posts: 3
Joined: Sat Oct 27, 2012 7:55 pm

Re: Airplane mode

Post by VU2ATX »

Hi PatrikE !
Thanks a lot for the clarity !

Regards
VU2ATX

Perry
Posts: 11
Joined: Mon Mar 19, 2012 10:09 pm

Re: Airplane mode

Post by Perry »

hALLO!
I hope to find a little help.

On my plane I must to reverse the servo of the pitch.
When I try to do it I change the value in the string:


/*********************** Airplane ***********************/
#define SERVO_RATES {100, 100, 100, 100, 100, 100, 100, 100} // Rates in 0-100%
#define SERVO_DIRECTION { 1, 1, 1, -1, 1, 1, 1, 1 } // Invert servos by setting -1

so

/*********************** Airplane ***********************/
#define SERVO_RATES {100, 100, 100, 100, 100, 100, 100, 100} // Rates in 0-100%
#define SERVO_DIRECTION { 1, 1, -1, -1, 1, 1, 1, 1 } // Invert servos by setting -1

but anything appears to change when I charge the modified software.

Why?
What's wrong?

Thanks

Perry

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

Re: Airplane mode

Post by PatrikE »

Airplane use servo 3 to 7.

In the original servomix for airplane.
{ servo0, s1, s2, Wing1, Wing2, Rudd, Elev, Thro }

And you have chnged direction on servo 2 who isn't used.
That's what's wrong.

Post Reply