HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jun 25, 2013, 07:42 PM
Registered User
Joined Aug 2003
2,661 Posts
Discussion
Whitespy $15.00 Flip MWC flying wing mode

I bought the flip multiwii controller from Whitespy. The MW firmware has an option for flying wing, so I decided to try it out in flying wing since I have a tricopter already with an APM2.5 .

I'm using Arduino 1.0.3 to compile and upload via the USB on the Flip. I'm using the MultiWii 2.2 as a starting point. I needed to make a few changes, nothing big, but the stock firmware puts the flying wing servo output exactly where there arent any header pins soldered. If I had the headers, I could have soldered some onto the board and my first change wouldnt be needed.

I didnt have them, so I changed this in the code, starting on about line 208 in def.h sketch:

#define SERVO_1_PINMODE pinMode(11,OUTPUT); // TILT_PITCH - WING left
#define SERVO_1_PIN_HIGH PORTB |= 1<<3;
#define SERVO_1_PIN_LOW PORTB &= ~(1<<3);
#define SERVO_2_PINMODE pinMode(10,OUTPUT); // TILT_ROLL - WING right
#define SERVO_2_PIN_HIGH PORTB |= 1<<2;
#define SERVO_2_PIN_LOW PORTB &= ~(1<<2);
#define SERVO_3_PINMODE pinMode(A2,OUTPUT); // CAM TRIG - alt TILT_PITCH
#define SERVO_3_PIN_HIGH PORTC |= 1<<2;
#define SERVO_3_PIN_LOW PORTC &= ~(1<<2);
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Sign up now
to remove ads between posts
Old Jun 25, 2013, 08:11 PM
Registered User
Joined Aug 2003
2,661 Posts
That moves the pins to the pins on the Flip labeled 10 and 11 on PortB. The flying wing variant of the multiwii code puts them on A1, A0 which are connected to portC of the Atmega328. The ESC connects on the Flip without any change needed.

That's all I changed, but I did need to uncomment the flying wing option in config.h. In config.h, there is also a section for servo directions which I missed the first time I tested it in the air.

I should mention I'm using the PPM output on my Frsky Rx to simplify the radio input. That gets connected to the throttle input pin and I also uncommented in config.h the PPM option. The Flip sees I want PPM and there is signal on throttle and then decodes it.

I used the GUI to setup ch5 high as level mode and passthrough mode, which allows RC input is on Ch6.

The first air test proved I had the servo directions good for passthrough, but when I went into level it was backwards and that's bad. The ch5 switch worked instantly and got me out of level mode.

After that test, I didnt want to give up on it so I went home and looked at the code again. That was when I saw where to change servo direction. It's simply a +1 or a -1 that determines in Rx sketch which direction the servos will move. Again, there are options in config.h to make that easy.

So, tonight was the second in air test. I armed using the yaw stick which turns on the red LED on the Flip. I throttled up and tossed it and got up a bit and hit ch5 to try level. This is where I will need to make changes to PID's. The plane is stable on its own, but with level mode it was making big oscillations in roll. Pitch seemed good.

That's where I am right now and thought some might be interested to know. The little $15.00 Flip MultiWii controller will stabilize a flying wing, but there is some basic changes needed and I havent made them all yet.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Jun 26, 2013, 03:55 PM
Registered User
Joined Aug 2003
2,661 Posts
I might get a chance to test this again tonight. I made two mistakes in the post above. The blue LED comes on when armed. The mixing for Flying Wing is in the Output sketch, not Rx.

Depending on your servo layout, you might need to make changes in that section of Output. The servo directions is just a +/- 1 even though it has a variable name. What's important is that servos move right in passthrough and level. There's an if then else for Flying Wing mixing.

I changed my roll PID using the GUI available from Whitespy's site. About the GUI, I have two versions. For some reason, I cant change the PIDs using the original java based MultiWii GUI, but the newer GUI doesnt show the Aux1 and Aux2 setup correctly. I use one to change PIDs and the other to setup my switch.

So, next test will be with a lower Roll P to see if I can get the oscillation down. The I term might need lowering too, but one adjustment at a time to avoid confusion.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Jun 29, 2013, 07:17 PM
Registered User
Joined Aug 2003
2,661 Posts
I lowered the P on roll to 2.5 and tested it and the corrections are still too big. It also wanted to dive more than I'm comfortable with. I think the problem is the multirotor PID's are not even in the ballpark for my plane.

Open to suggestions on PID tuning.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Jun 29, 2013, 09:47 PM
Registered User
Joined Aug 2003
2,661 Posts
I Binged PID and found a wiki on PID tuning. I changed the PIDs by setting I and D to 0 as a starting point. I changed P to 0.5 to start. I looked at the Ardupilot as an example and I and D are basically 0 with a very small P, so why not try that.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Jul 20, 2013, 10:03 PM
Registered User
guyaneze's Avatar
gainesville FL
Joined Jan 2002
1,403 Posts
interested
guyaneze is offline Find More Posts by guyaneze
Reply With Quote
Old Jul 22, 2013, 11:11 PM
Registered User
United States, TX, Cypress
Joined Jan 2012
952 Posts
I will follow your progress as I may do this too
corsair2014 is online now Find More Posts by corsair2014
Reply With Quote
Old Jul 26, 2013, 07:59 AM
Registered User
AlanFlorida's Avatar
USA, FL, Palm Harbor
Joined Jul 2004
2,116 Posts
Looking forward to hearing about your progress. Thanks!
AlanFlorida is offline Find More Posts by AlanFlorida
Reply With Quote
Old Aug 02, 2013, 05:48 AM
Registered User
Joined Aug 2003
2,661 Posts
I took it out again, see post #12. I reset all the PID's and adjusted the Level PIDs which seems to be the right thing to adjust.
HELModels is offline Find More Posts by HELModels
Last edited by HELModels; Aug 03, 2013 at 10:37 AM.
Reply With Quote  (Disabled)
Old Aug 02, 2013, 08:37 AM
Registered User
Joined Aug 2003
2,661 Posts
Here's a picture of where the servos and ESC hook up, after the minor code change to put flying wing servo output onto the board.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Aug 02, 2013, 11:33 PM
Registered User
Joined Sep 2001
6,190 Posts
I'm going to follow along and contribute as I have one I setup with Flying Wing mode for my FPV Teksumo. I'm still figuring out my cg, reflex and rates before I try and put it on to test.
cactus is offline Find More Posts by cactus
Reply With Quote
Old Aug 03, 2013, 09:05 AM
Registered User
Joined Aug 2003
2,661 Posts
cactus, post what you try.

I just flew it, it was in acro mode. It held whatever attitude I put it in. I had reset all the PID's and then lowered the level PID's, but I forgot to set my mode switch and acro is the default. I couldnt understand why it would get in an attitude and I'd let go and it wouldnt go back to level. That's acro mode. The good news was it was stable with only changing the level PIDs.

I'm going out again today, and I'm trying horizon mode. If I understand that mode, it should return to level but somehow it is supposed to also hold an attitude.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Aug 03, 2013, 01:18 PM
Registered User
Joined Aug 2003
2,661 Posts
OK, I just tried it in Horizon mode with the Level PID's turned down 50%, and the board remounted and recalbirated. The Pitch, Roll, Yaw PIDs are stock. It didnt hit any trees so I got to see how good or not. I launched in Horizon mode and it held level until I made the first turn which it did without any surprises. I made about 4 laps and it generally stayed level without twitchin all over. When I wanted to turn, it tended to hold the bank. I did have to nudge pitch a little, so the turns werent perfectly level. That could have been my thumb.

I was pretty satisfied though with how it was acting and then all of a sudden, after doing so well, it went into some weird oscillation again. I didnt touch anything to see if it might come out of it and it did, but something still needs adjustment.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Old Aug 03, 2013, 01:39 PM
Registered User
Joined Sep 2001
6,190 Posts
Well, I may not be able to now. My Teksumo bit the dust on some test glides/flights this morning. It flew like crap from the start so I am not sad to see it go in the trash bin after pulling all the carbon rods out.
cactus is offline Find More Posts by cactus
Reply With Quote
Old Aug 04, 2013, 02:16 PM
Registered User
Joined Aug 2003
2,661 Posts
Damn, I wont be able to test for awhile. I crashed again and it was in manual this time. I tried to get back in the air and the Rx wasnt getting any power. I took the cover off the Rx and got out the magnifying glass and R7 on the FrSky broke off. I guess it needs that one.
HELModels is offline Find More Posts by HELModels
Reply With Quote  (Disabled)
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Build Log NEW: whitespy MWC Pro 2.0 FC +MTEK GPS for MultiWii (now w/UBlox GPS) kinderkram Multirotor Electronics 2481 Mar 05, 2015 12:44 PM
Discussion Case for Whitespy MWC Pro 2.0 FC hcker2000 Multirotor Electronics 18 Aug 06, 2013 04:03 PM
Discussion MWC Flip 1.5 having trouble flipping djas3616 Multirotor Electronics 9 Jun 09, 2013 01:39 PM
Sold Flip Gps POD's - MultiWii Flip MWC 1.5 WattFreq Aircraft - Electric - Multirotor (FS/W) 7 May 23, 2013 01:41 PM
Question How do I install a Lemon RX 6 ch on a Flip MWC cruiser73 Multirotor Electronics 6 Apr 22, 2013 10:06 AM