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
User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Airplane mode

Post by UndCon »

Hello!
I'm trying to add Airplane mode to MultiWii as I want to stabilize my FPV-airplane to get better videos.

My start is MultiWiiV1_7

I search for FLYING WING in code (10 occurrences) - adding AIRPLANE-code and compiled without any problems

Still I'm not sure I get the correct movement on all 3 axis but that seems pretty obvious to adjust

I need 4 servo outputs (any motor output can be used) If/when motor is added this can be a regular motor output as well

Next is to add code for GUI...
I have no clue how to draw an airplane-symbol - hopefully I'll find out - Ill start by getting GUI to understand the AIRPLANE mode

Ill keep you posted.


HI! (updated 2014-10-03)

Sorry for not being active in this forum. If you need assist with airplane mode you really must visit PatrikE's page with all the best guides

AirplaneMode
Last edited by UndCon on Thu Oct 02, 2014 11:05 pm, edited 1 time in total.

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

Re: Airplane mode

Post by Kayle »

Hi undcon,

this is a good idea. I like to stabilize my fpv plane too. Keep us up to date.

greetings Kayle

Nosepo
Posts: 24
Joined: Thu Jan 20, 2011 11:13 am

Re: Airplane mode

Post by Nosepo »

Uncom, can you make for EasyStar type withou aleirons?? It has only rudder, pitch and trohttle. Thanks

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

I have no gear to test on right now(i'm at work) but here is what Im trying to use...
Same pins as Motor outputs for Quad etc:

L_AILE pin 3
R_AILE pin 9
RUDDER pin 10
ELEVATOR pin 11

By not touching A0/A1 we can still have camera stabilization along with the stabilized airplane
(Flying wing code uses A0/A1 for servo outputs so it's incompatible with camera support)

Motor?
YES if ailerons are connected to only 1 pin and use an Ycable instead of 2 servo's OR ditch camera stab and use A0/A1 as L_AILE/R_AILE

Reason - dont want to force need for PPM

------------------------------------------------------------
I guess we need 1 more mode for Easystar and similar without ailerons - then we can use motor as well

Going to bring Arduino + sensors with me so I can play with them at work ;)

//UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Easystar mode added

MOTOR pin 9
RUDDER pin 10
ELEVATOR pin11

if something does not work - I at least have the same errors on both Airplane and easystar modes :D

//UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Partial success!

The code seems to work.

I have contact with my AR6100 that I connected to one of Jussi's early boards (1.0)
I see movement from Throttle, Rudder, elevator and aileron

Some adjustments to the code required and I need to assemble a test-rig with 4 servos (5 if I count in motor)

Cheers - UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

I wish I could have some sort of simulator...
Now I need power on my Dx7 every time to try changes - if there was a simulator it would be handy to try changes

Something like an Arduino servo-driver is on my wishlist

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

Re: Airplane mode

Post by PatrikE »

I use a BuddyCable from the radio to feed the Mwii with PPM-signal direct via Throttle input on the card..
same way you do with a flight sim.
Then you will bypass TX-module.( Remove if you want)

It works with my Hitec Optic.
My JR X-388S have to low level an don't work.

Not a simulator but the radio will use less power without TX.
It's not nessessary to transmitt 1,5km around you when you only need a short cable.

/Patrik

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

OK - thanks. I have no cable around...isn't that a regular 3.5mm mono-plug on DX7?
How do you connect it to other end to the Arduino?


About my success... I think I must clear the program I use in DX7 as it seems to have mixers applied
I tried to verify stick-moves by changing to QUAD and others but they all acted the same

AUX1, AUX2, MODE1 & MODE2 all moved when I applied aileron :D

//UndCon

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

Re: Airplane mode

Post by PatrikE »

I dont now about DX7.
On my Hitec i use a 3,5mm stereoplug and a servo cable the Arduino.

I twisted the tow leads together and connected to signal on to the Arduino.
The shield goes to Arduino ground.

Charlienofun
Posts: 4
Joined: Thu Jun 09, 2011 4:25 am

Re: Airplane mode

Post by Charlienofun »

UndCon, did you start a new branch for this? I have an easystar I can test with. I tried to PM ya on here but I don't think it worked (got some forum error).

Charlie

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Hi!
I also get errors in forum -after every post I get timeout so I load forum in new browser to verify my posts

No I did not start any branches - I use code I have downloaded earlier

I reprogrammed my DX7 yesterday and it seems promising(reset all mixers)
I see clear throttle, aileron, rudder & elevator inputs in GUI.
I removed all motor meters as I don't think they are needed in this case, but I prepared so they can show servo actions for all surfaces instead.

I copied the code for drawing the flying wing but it does not show up in GUI.
When I can see the drawing in GUI I can start modify to draw an airplane instead of the wing.

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

Re: Airplane mode

Post by PatrikE »

To get the flying wing in Gui.
Try to change in the Serial section.

QUADX have layout 3

Code: Select all

    #elif defined(QUADX)
      serialize8(3);


FLYING_WING uses layout 8

Code: Select all

    #elif defined(FLYING_WING)
      serialize8(8);


I think it will work.
/ Patrik

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

Re: Airplane mode

Post by PatrikE »

UndCon wrote:Hi!
I also get errors in forum -after every post I get timeout so I load forum in new browser to verify my posts


Same problem for me.
Pressing Submit then nothing happens visually.
But the post is saved.

/Patrik

Charlienofun
Posts: 4
Joined: Thu Jun 09, 2011 4:25 am

Re: Airplane mode

Post by Charlienofun »

UndCon,

are you familiar with the fy20 device? http://www.readymaderc.com/store/index.php?main_page=product_info&products_id=297 if your code can support planes that have each alieron servo on a sperate channel (big gliders like multiplex cularis) you are a step ahead of this device!

I think the ideal options/modes would be:

a: Flying wing (elevons) with mixing done in the multii wii so will work with any radio?
b: Plane with 3 control surfaces (rudder, elevator and ailerons on a Y cable or single servo) - this will work with trainers that use rudder for roll you just give up yaw correction and use the aileron connection on the rudder, this is how an easy star would work).
c: Plane with 3 control surfaces (rudder, elevator and ailerons but controlled by two channels on the radio for sailplane mixing eg: crow, full span ailerons etc.) - this seems the most complicated when I think about it...

Can we start a new branch for planes? I'v been reading through the 1.7 code I would be happy to put some time into getting all these working if you think its possible. I know I would put one in every plane I have if we got this working!

Charlie

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Hey Charlie!

I know about the fy20...

I added 2 modes so far and want to get them running before I add more.
I still don't get any drawing in GUI so I don't know if my code is working properly or not. I also have to order a new Nunchuck for my tests

EDIT!

I just found more related code in the jar-files in MultiWiiConf-folder...


ALEX - what do I need to add airplane to GUI ??

I have visual studio and can add Eclipse as well if needed
Please guide me so I can continue work
//UndCon

Charlienofun
Posts: 4
Joined: Thu Jun 09, 2011 4:25 am

Re: Airplane mode

Post by Charlienofun »

UndCon wrote:I also have to order a new Nunchuck for my tests


Undcon - PM me your address and I'll send you an extra nunchuck (official one) :)

Charlie

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Thank you very much for your offer Charlie!

PM sent ;)

Now I have to try to modify GUI code...but I'm not totally sure it works

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Come on Alex - at least show some sort of response...If GUI will not work the airplane mode will not happen :evil:

//UndCon

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Airplane mode

Post by Alexinparis »

Hi,

in the GUI code, there are some section dedicated for each model.
For instance, this one for Y4:

Code: Select all

 } else if (multiType == 9) { //Y4
    ellipse(-size,  -size, size, size);
    ellipse(+size,  -size, size, size);
    ellipse(0,  +size, size+2, size+2);
    line(-size,-size, 0,0);
    line(+size,-size, 0,0);
    line(0,+size, 0,0);
    translate(0,0,7);
    ellipse(0,  +size, size, size);

    noLights();
    textFont(font12);
    text("Y4", -5,-50);camera();popMatrix();


for each multiwii type (number 9 here for a Y4) you must draw lines and circle according to the model specification. (ellipse, line, translate, and other graph functions I don't use here)
You can first try to modify a model to draw a plane that will move in 3D.

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Thank you Alex for your feedback. - I did quite a lot of changes to the GUI but nothing gets drawn

I copied the code to draw a flying wing into my 2 airplane modes but when I select them they do not appear
Stick movements from radio is visible.

Does GUI code have to be compiled in any way to work?
I made my changes in MultiWiiConf1_7.pde
Then there is a similar file in the application.windows dir
And there is a java file as well in that folder
Does any of the lib's has to be changed as well?

Besides the airplane mode I have plans for 1 more use for your code ;)
(secret until the day I finish it off and can show cool videos and pictures)

Best regards - UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

OK - this is weird...

I started over...trying to alter the drawing of flying wing.
in the zip we get 2 dirs

MultiWiiV1_7
MultiWiiConf1_7

in MultiWiiConf1_7 we have a pde file
I change the label of "Flying wing" to "Flying frog" and then what?

I start GUI but see no differences
I try to change .pde and .java in source dir

still no changes to the caption over the drawn symbol flying wing.

So what do I have to do to compile new code? and what file do I alter to see effect?

//UndCon

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

Re: Airplane mode

Post by PatrikE »

Do the changes in MultiWiiConf1_7.PDE
Then you must compile the code with Processing.

Processing works almost like the Arduino software

Here is a guide how to install it.
http://wbb.multiwii.com/viewtopic.php?f=18&t=190

I installed it to day and compiled my first Gui. :D

/Patrik

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Thank you Patrik - I will try this ASAP

I really hope this is the missing link to my progress


EDIT:

Processing seems to help out - now I see small changes to GUI.
I'm currently at work so no MultiWii to test on...must continue testing at home

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

Re: Airplane mode

Post by PatrikE »

Played around with the gui.
Came up with this.

Code: Select all

  /*
  // Original Code for FLYING_WING
    line(0,0, 1.8*size,size);line(1.8*size,size,1.8*size,size-30);  line(1.8*size,size-30,0,-1.5*size);
    line(0,0, -1.8*size,+size);line(-1.8*size,size,-1.8*size,+size-30);    line(-1.8*size,size-30,0,-1.5*size);
  */

  // Modifyed code for AEROPLANE
  float Span = size*1.3; 
  float VingRoot = Span*0.25; 

  // Wing
   line(0,0,  Span,0);   line(Span,0, Span, VingRoot);      line(Span, VingRoot, 0,VingRoot);
   line(0,0,  -Span,0);  line(-Span,0, -Span, VingRoot);    line(-Span, VingRoot, 0,VingRoot);
   
  // Stab
   line(-(size*0.4),size,  (size*0.4),size);      line(-(size*0.4),size+5,  (size*0.4),size+5);
   line(-(size*0.4),size,  -(size*0.4),size+5);   line((size*0.4),size,  (size*0.4),size+5); 
   
  // Body 
   line(-2,size,  -2,-size+5); line(2,size,  2,-size+5); line( -2,-size+5,  2,-size+5);
   
  // Fin
   line(0,size-3,0,  0,size,15); line(0,size,15,  0,size+5,15);line(0,size+5,15,  0,size+5,0);
   
   
    noLights();
    textFont(font12);
    text("AEROPLANE", -40,-50);camera();popMatrix();




Image

No Beauty but it looks like a plane.. :o


/Patrik
Attachments
Aero.png
(7.11 KiB) Not downloaded yet

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Nice drawing ;)

Here is the current status

Image

a few sliders showing as well...

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Changed a bit...

Image

Image

some errors to take care of...also I renamed labels into the pitch,roll naming-standard

//UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

More progress done - now i need to find out how to build the source into a working app...

As is right now I must run application from Processing...

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

Re: Airplane mode

Post by PatrikE »

Open the pde-file with Processing.

Select in meny.
File/Export Application.

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

I tried that but get lots of errors...

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Seems to work as 32bit application - II only tried to start 64bit...

Now I got 32/64 of Win/Lin/Mac ;)

Still some issues in code...and I will mount the board to my Indoor Foamie (Crazy Sukhoi 29 Depron) so I clearly can see rudder moving right ways...

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

Re: Airplane mode

Post by PatrikE »

When is it time for a demo Video?

/Patrik

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Hi!

Sorry for being off for some time. Now I have some time where I can play with this gear again.
(my vacation starts in august)

Hopefully I can sort a few things out during the day.
//UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

I think I got it sorted!

I would like to hook this up to my indoor foamie but I'm not sure it can handle the extra 24grams of my test-rig.

1st test is Easystar mode (elevator/rudder)
2nd test is Skywalker mode(elevator/rudder/aileron)

I have 1 servo on the foamie but the code for Skywalker has 2 aileron outputs(1 is reversed)
(depending on which pin to connect the foamie-aileron on - it will be reversed)

Then if successful I might add some soft throttle control...

To bad it is very windy and raining so I cannot go out to my car to get the foamie...
(parked just outside my work)

Another cool news...
The indoor season is booked and confirmed, Sundays 2011-10-23 to 2012-04-01

//UndCon

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Darn!

It looks good in GUi but does not work when I connect servos.

How do I convert motor outputs to servo outputs?

If I connect a servo to the motor pins it gets very nervous

Compare that to the servos connected to stabilize camera
(I want more controls smooth like camera)

cob
Posts: 37
Joined: Thu Jul 07, 2011 12:00 am

Re: Airplane mode

Post by cob »

If it can help I modified the mwii soft for VTOL flying machine. It use TRI copter to take off and landing and switch to flying wing tilting donw front motors.
Having an analog ACC, A1-2-3 are used. Pins D4-5-6-7 are used for Yaw- Roll-Pitch-servo3 and servo4 to tilt the front motors. see this post: viewtopic.php?f=7&t=497

There is two sections in the soft to be modified to assign differently the pins. In def.h and output.pde
The Motor's pin 9-10-11 and any motor pin activated will run at a high rate for ESC. Servos can't work at that speed. Those pins are to be redefined for servos.
Here is the section in def.h I modified to use pin 4-5-6-7 as servo outputs, just using the existing code for Flying Wing - pin out modified - and adding two servos:
#define DIGITAL_TILT_PITCH_PINMODE pinMode(4,OUTPUT); //VTOL
#define DIGITAL_TILT_PITCH_HIGH PORTD |= 1<<4; //VTOL
#define DIGITAL_TILT_PITCH_LOW PORTD &= ~(1<<4); //VTOL
#define DIGITAL_TILT_ROLL_PINMODE pinMode(5,OUTPUT); //VTOL Roll et Pitch Flying wing out on Pins D5 and D6
#define DIGITAL_TILT_ROLL_HIGH PORTD |= 1<<5; //VTOL
#define DIGITAL_TILT_ROLL_LOW PORTD &= ~(1<<5); //VTOL
#define DIGITAL_TILT_VTOL_PINMODE pinMode(6,OUTPUT); //VTOL Tilting down front motors with AUX2
#define DIGITAL_TILT_VTOL_HIGH PORTD |= 1<<6; //VTOL
#define DIGITAL_TILT_VTOL_LOW PORTD &= ~(1<<6); //VTOL
#define DIGITAL_TILT_VTOL2_PINMODE pinMode(7,OUTPUT); //VTOL
#define DIGITAL_TILT_VTOL2_HIGH PORTD |= 1<<7; //VTOL
#define DIGITAL_TILT_VTOL2_LOW PORTD &= ~(1<<7); //VTOL

here is the section in output.pde which is actually creating the PPM for servos by a cyclic run of High and Low state timed by milliseconds (sorry for the lenght..). The rule in this section is explained just before the section : pulse high servo 0 -> do nothing for 1000 us -> do nothing for [0 to 1000] us -> pulse down servo 0
DIGITAL_TILT_VTOL_HIGH/low and DIGITAL_TILT_VTOL2_HIGH/low are the two servos I added to tilt the 2 front motors configuring in TRI or Flying Wing mode.

ISR(TIMER0_COMPA_vect) {
static uint8_t state = 0;
static uint8_t count;
if (state == 0) {
//http://billgrundmann.wordpress.com/2009/03/03/to-use-or-not-use-writedigital/
#if defined(TRI) || defined (BI) || defined(VTOL)
DIGITAL_SERVO_TRI_HIGH
#endif
OCR0A+= 250; // 1000 us
state++ ;
} else if (state == 1) {
OCR0A+= atomicServo[0]; // 1000 + [0-1020] us
state++;
} else if (state == 2) {
#if defined(TRI) || defined (BI) || defined(VTOL)
DIGITAL_SERVO_TRI_LOW
#endif
#if defined(BI)
DIGITAL_BI_LEFT_HIGH
#endif
#if defined(SERVO_TILT) || defined(GIMBAL) || defined(FLYING_WING) || defined(VTOL)
DIGITAL_TILT_PITCH_HIGH
#endif
OCR0A+= 250; // 1000 us
state++;
} else if (state == 3) {
OCR0A+= atomicServo[1]; // 1000 + [0-1020] us
state++;
} else if (state == 4) {
#if defined(SERVO_TILT) || defined(GIMBAL) || defined(FLYING_WING) || defined(VTOL)
DIGITAL_TILT_PITCH_LOW
DIGITAL_TILT_ROLL_HIGH
#endif
#if defined(BI)
DIGITAL_BI_LEFT_LOW
#endif
state++;
OCR0A+= 250; // 1000 us
} else if (state == 5) {
OCR0A+= atomicServo[2]; // 1000 + [0-1020] us
state++;
} else if (state == 6) {
#if defined(SERVO_TILT) || defined(GIMBAL) || defined(FLYING_WING) || defined(VTOL)
DIGITAL_TILT_ROLL_LOW
DIGITAL_TILT_VTOL_HIGH
#endif
#if defined(CAMTRIG)
DIGITAL_CAM_HIGH
#endif
state++;
OCR0A+= 250; // 1000 us
} else if (state == 7) {
OCR0A+= atomicServo[3]; // 1000 + [0-1020] us
state++;
} else if (state == 8) {
#if defined(CAMTRIG)
DIGITAL_CAM_LOW
#endif
#if defined(VTOL)
DIGITAL_TILT_VTOL_LOW
DIGITAL_TILT_VTOL2_HIGH
#endif
state++;
OCR0A+= 250; // 1000 us
} else if (state == 9) {
OCR0A+= atomicServo[4]; // 1000 + [0-1020] us
state++;
} else if (state == 10) {
#if defined(VTOL)
DIGITAL_TILT_VTOL2_LOW
#endif

count = 12; // 12 x 1000 us
state++; //11
OCR0A+= 250; // 1000 us
} else if (state == 11) {
if (count > 0) count--;
else state = 0;
OCR0A+= 250;
}
}
#endif

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Hello!

Thanks for your help.

I'm not sure what you are doing here (or me :) )

I added pins like yours in multiwii.pde

Pinmode PortB high, low etc for all corresponding features.

I'm not sure about the rest of your post...

Stillee
Posts: 5
Joined: Tue Jul 12, 2011 2:25 am

Re: Airplane mode

Post by Stillee »

Hi,

I'am interested too :)
Very good project.
I can test some code on my AXN Cloud from HK for super stable fpv :)
Have you seen the ardupilot code ?

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

HI! I am aware of ardupilot - but my ideas is to use the current MultiWii and sensors (cheap platform) for this.

To learn more about this I am currently programming a "servo multi mode feature"
It is clear that my problem is the communication on motor outputs that I have to lower...

Stillee
Posts: 5
Joined: Tue Jul 12, 2011 2:25 am

Re: Airplane mode

Post by Stillee »

Good :)

If you need a beta Tester, i'have a "ready to go" board (Pro Mini + WM+ + Nunchuk )

I'am so interested in your project of cheap stabilisation board

;)

cob
Posts: 37
Joined: Thu Jul 07, 2011 12:00 am

Re: Airplane mode

Post by cob »

Hi all,
I progressed toward my VTOL project. I'm still stumbling on the correct mixes for Roll and Pitch (Flying Wing mode) sharing the PID of the TRI mode.
For now I added and external Vtail Mixer (some bucks by HobbyKing) in order to Not have to inverse Roll command on the radio as it would also reverse the Roll command on TRI config.
PatrickE gave me some clue to solve that problem.
Maybe this post viewtopic.php?f=8&t=518 can help.
The point is that mixing are different depending on the way servos are seated on the wing. As I'm using both config of Multiwii (TRI and FlyingWing) switched alternatively I can't change something on FlyingWing config without having changes also on TRI mode.
If it may help... ;)

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

Re: Airplane mode

Post by PatrikE »

Aeroplane mode redy for Betatest. :D
Everything looks right on the table.
It's now ready for IRL testflight.
Any vouleteers?

It handles 3 servos and 1 ESC output.
Using
A0 => ROLL
A1 => ELEVATOR/NICk
3 => RUDDER/YAW
9 => ESC at 490hz same as the multirotors.( muliple engines can be added if neded!)

For those not flying electic.... :?
ThrottleServo can be connected direct to thro-ch on reciver.
Or connect to Yaw if rudder is not used on model.
It's just to change YAW to THROTTLE for servo[0] in the code.

There is a RX-passthru mode.
Sending RX-signals stright to servos.
(AUX1 <1500 means passthru)

And a MWii mode.(AUX1 >1500)
Use AUX2 to switch between GYRO and STABLE in MWii-mode

Setup servodirections and Maximum throws in the code.
output tab.

Code: Select all

#ifdef AEROPLANE     
   if(abs(rcData[AUX1])>1500)   {  //Use aux1 to activate Passthru or MWii mode
  //  invert the sign before axisPID to reverse servos GyroResponse
    servo[0]  = constrain(1500 + (axisPID[YAW] ), 1020, 2000);                       //   DO 3
    servo[1]  = constrain(1500 - (axisPID[ROLL]  + (angle[ROLL] /16)) , 1020, 2000); //  A1/Roll  Adjust MaxThrow here
    servo[2]  = constrain(1500 + (axisPID[PITCH] + (angle[PITCH] /16)), 1020, 2000); // A0/Nick   
    motor[0] = constrain( rcData[THROTTLE] , 1020, 2000);                        //  490hz ESC PIN9
    }else{
 // Direct passthru from RX
 // 3000-rcData[AXIS] Will reverse servos RX inputs//
    servo[0]  = constrain( rcData[YAW] , 1020, 2000);        //   DO 3
    servo[1]  = constrain( 3000-rcData[ROLL] , 1020, 2000);  //   A1/Roll
    servo[2]  = constrain( rcData[PITCH], 1020, 2000);       //   A0/Nick   
    motor[0]  = constrain( rcData[THROTTLE] , 1020, 2000);   //  490hz ESC PIN9
    }
   #endif

Compatible with 714 MultiWiiConf but only showing PID settings.
To se graphics use my modified MultiWiiConf.
(Needs Processing to run)http://wbb.multiwii.com/viewtopic.php?f=18&t=190

Config via gui.
select Stable or Acro
Adjust PID's

Takeoff in Passthru and activate at safe height.(One can never know) :o
May the Force be with you....

God luck...

/Patrik
Attachments
Aero.png
MultiWii_AEROLANE.rar
(103.03 KiB) Downloaded 292 times

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Cool - how did u solve the update to servo?

I didnt manage that...


I did not want to use A0/A1 as I intend to keep camera stabilization..

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

Re: Airplane mode

Post by PatrikE »

I may have an alternative solution comming up..;)
But now i'm going for a trip to Gotheburg and will be back at friday.

It's something to start with and se if it works... :geek:

See ya later... 8-)

/Patrik

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

Yes it is.
My code is almost done and the only problem I have is to reduce the communication to servos.
(I'm using motor pins for this)

Everything else is done...
//UndCon

Alexinparis
Posts: 1630
Joined: Wed Jan 19, 2011 9:07 pm

Re: Airplane mode

Post by Alexinparis »

UndCon wrote:Cool - how did u solve the update to servo?

I didnt manage that...


I did not want to use A0/A1 as I intend to keep camera stabilization..


Hi,

Currently, the number of manageable servo is 4.
I think it's possible to extend this value up to 10 with the current code principle.
I think it's not a good idea to try to tune the fefresh rate (490Hz -> 50Hz) of motor outputs for this need. extending the number of servo output should be much easier.

User avatar
UndCon
Posts: 293
Joined: Mon Feb 21, 2011 2:10 pm

Re: Airplane mode

Post by UndCon »

I agree on that one Alex. I had lots of trouble trying to get servo running on motor pins.
Using A0 and A1 was easier.

//UndCon

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

Re: Airplane mode

Post by PatrikE »

I Used the existing servos in the code.

I had problems using servo(3).
It moved with servo(1)
Maby something i messed up..
I don't fully understand the code there..:(

I tested to use the tip from Cob and tried to write to pin 6.
It works... Almost...
Only thing is the amplitude was to low for the servo to work.

It would be nice to Have more servos defined.

/Patrik

Rangarid
Posts: 6
Joined: Thu Jul 28, 2011 6:45 pm

Re: Airplane mode

Post by Rangarid »

Hi,

i'm pretty interested in this too. Did anyone fly with that yet? Does it have full gyro+acc support, so it always levels to straight flight when you release the control sticks?

I wanted to change code from flying wing to plane too, but didnt have the time to do so yet. I just purchased a flyduino. Its compatible to multiwii code but its easier to use then a Arduino with WiiCopter Board. It also has more pins since its a Mega. My IMU will be a BMA020 and a WMP.

If you need a tester for your code i will help. Same with developing code, dont have that much experience with arduino yet, but i learned programming for a few years now. So maybe we can start something from scratch together based on the MultiWii but without all that copter stuff. Maybe it will be easier to access the servos etc if we start from scratch, then we have a better overview of the code and we could add more than 4 servos.

I plan to add GPS later as well. I already have the knowledge on how to calculate speed, distance and angles between two points from GPS. Had a thesis about this last year, where i wrote a tool in Java to import GPS tracks and paint them in a window with speed and distance.

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

Re: Airplane mode

Post by PatrikE »

Hi
Does it have full gyro+acc support, so it always levels to straight flight when you release the control sticks?

YES.... 8-)
If you want...

I made the maiden flight with the Aeroplane mode today. 8-)
First time in a long time that my legs was shakeing before flying. (Nervous.. :shock: )

Everyting worked as it should.
Takeoff in Passthru. AUX<1500
Swich to MultiWii AUX>1500
Activate Stable AUX2 selected via gui. (LEVEL model)

Maby my FunFly model capable to roll 600°/sec and loops in 5 meters with full rates is the best testbed. :twisted:
At least not with standard PID.
It overcompensated and oscilated.
But with a more a ordinary modell or other PID's it's safe to fly.

A Easystar or a trainer probably works with standard PID's .
Some PID tuning and it will fly on rails.

/Patrik

Post Reply