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
Greg Covey
Posts: 11
Joined: Tue Feb 05, 2013 11:20 pm
Location: Rochester, NY USA
Contact:

Re: Airplane mode

Post by Greg Covey »

I found a technique to zeroize the offset between PASSTHRU and Horizon mode. First, I recorded my trims from a level flight test. Next, I moved the trims, one surface at a time, so that I found a spot where the surface did not change deflection between PASSTHRU and Horizon modes. I recorded these new trim settings and then visibly checked the difference in the control surface deflection between the two trim settings. I then adjusted the linkages to match the original settings when set to the new trim settings. The actual defection change was minor so it was a small linkage change.

The result is zero deflection change between a proven level flight PASSTHRU mode and Horizon mode. I am not sure if there is a better solution but this worked so I am ready to test fly my Multiwii airplane in Horizon mode.

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

Re: Airplane mode

Post by PatrikE »

A mechanically correct trimmed plane is always an advantage.
MWii takes care of the most trim errors in acro and Acc modes.
It will even fly relatively tail heavy-
But main goal is to trim the plane to fly good in Passthru.

Michael van der hoek
Posts: 39
Joined: Fri Nov 29, 2013 1:33 pm

Airplane mode

Post by Michael van der hoek »

Uhm, what is passthru if i may ask ?

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

Re: Airplane mode

Post by msev »

Passthru means that signal from receiver is passed-through the FC to the servos unchanged, so you get same deflections in control surface like you weren't using a FC. Basically like "manual" mode, with no input from FC.

Flutter
Posts: 1
Joined: Wed Feb 05, 2014 7:28 am

Re: Airplane mode

Post by Flutter »

Hi everyone.

I have the same trouble as surf_akinys and disq with my Crius AIOP v1 and MultiWii 2.2 (Version for Remzibi OSD).
If defined MEGA_HW_PWM_SERVOS, ailerons are on D11, D12, but no rudder and elevator.
If commented //#define MEGA_HW_PWM_SERVOS there are rudder & elevator on D2, D5, but no ailerons.
Though GUI indicates everything OK.
I have tried all recomendations above in this theme including Patrik's def.h and surf_akinys' s variant but nothing works. Also flashed pure MWii 2.2 - no changes.
I can't change MWii version to 2.3 because of Remzibi support.
So please how can I fix it?
P.S. May be it's important. Rx Frsky D4R-II is in PPMSum mode.

zinets
Posts: 3
Joined: Sat Feb 15, 2014 9:51 am

Re: Airplane mode

Post by zinets »

hi guys, need help

i made plane, ailerons, V-tail; test it and now try to use my crius se v2 for in-flight stabilization

one thing cant make: i want to turn-off "arming" feature; it's safe for me, motor turns off by switch on rc. Arming with stick is very-very bad idea because my plane has "rudder", and i can't setup arming with AUX* because technical issues with my FC (i suspect i kill one of input channel on flight control)

so i want just turn off arming all time - i try to setup it in multiwii-gui, it works only one time, and after reboot motor always armed off

im trying not change source code - only config.h file and custom include file with motor mix; any advices? define MOTOR_OFF (or something like this) i uncomment

sorry for simple english, i hope anybody helps me :)

p.s. i use MW 2.3

schome1
Posts: 6
Joined: Sat Dec 28, 2013 5:07 pm

Post by schome1 »


e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Airplane mode

Post by e_lm_70 »

zinets wrote:hi guys, need help

i made plane, ailerons, V-tail; test it and now try to use my crius se v2 for in-flight stabilization

one thing cant make: i want to turn-off "arming" feature; it's safe for me, motor turns off by switch on rc. Arming with stick is very-very bad idea because my plane has "rudder", and i can't setup arming with AUX* because technical issues with my FC (i suspect i kill one of input channel on flight control)

so i want just turn off arming all time - i try to setup it in multiwii-gui, it works only one time, and after reboot motor always armed off

im trying not change source code - only config.h file and custom include file with motor mix; any advices? define MOTOR_OFF (or something like this) i uncomment

sorry for simple english, i hope anybody helps me :)

p.s. i use MW 2.3


I had your same issue ... actually I did not even try to fly my airplane without making a software change.

For me the solution is quite simple ...

Inside the multiwii.cpp you have the following line:
void go_disarm() {
if (f.ARMED) {
f.ARMED = 0;

Just comment out "f.ARMED = 0;" or change it to " f.ARMED = 1;"


In this way the airplane once armed will be armed all the time, till your don't unplug the battery.

You have the issue that once landed you need to be carefully keep the Throttle all the time to lowest level, else you can damage something or somebody ... but this is a issue for every airplane without a stabilization system on it.

On other mod that I did .. is to have a trigger that every time I flip from stable to PASSTHRU mode, I do force a gyro calibration. I don't see any other way for properly calibrate my gyro ... I'm not fast enough when I put the battery on for keep my airplane fully steady ... and the stick position do cause to activate servo, that will make vibrations. So ... I prefer this way for be sure gyro are properly calibrated

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Airplane mode

Post by e_lm_70 »

" I flip from stable to PASSTHRU mode, I do force a gyro calibration."

Clearly only when the control board it is not ARMED

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

Re: Airplane mode

Post by PatrikE »

I always Calibrate with sticks before takeoff.
Throttle LOW + Elevator UP & Rudder Left.
Servos freeze during the calibration.
Centers after calibration is finished.
The board must be unArmed.

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

Re: Airplane mode

Post by PatrikE »

@zinets
If you have Dualrates on the Radio you can have Hi rates to ARM and do other stickComands.
Switch to Lower rates after you Armed.
That way you can't unArm in air.

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Airplane mode

Post by e_lm_70 »

PatrikE wrote:I always Calibrate with sticks before takeoff.
Throttle LOW + Elevator UP & Rudder Left.
Servos freeze during the calibration.
Centers after calibration is finished.
The board must be unArmed.


My servo don't freeze while in the extreme position ... maybe I use cheap servo, maybe I use extreme servo travel

Still I don't like that just before start gyro calibration I "shake" my airplane .. and the shaking can last for enough time for compromise the accuracy on Gyro calibration.

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Airplane mode

Post by e_lm_70 »

PatrikE wrote:@zinets
If you have Dualrates on the Radio you can have Hi rates to ARM and do other stickComands.
Switch to Lower rates after you Armed.
That way you can't unArm in air.


Why people should accept this limitation ?
I want to fly also on full rate, and don't risk to switch off my motor in a critical moment ... what is wrong with this ?

Why bother if once you arm the airplane you can't disarm unless you remove the battery ?

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

Re: Airplane mode

Post by PatrikE »

That was just a suggestion for a user how to solve it without hacking code.

Maybe there should be a #DISABLE_STICK_DISARM in config.

Code: Select all

    // Disable the risk to disarm a Planes in with Sticks.
    // It's still possible to Disarm with AUX switch
     #define DISABLE_STICK_DISARM


It will mean you can Arm with sticks but not Disarm.
Failsafe Disams after FAILSAFE_OFF_DELAY time have run out.

e_lm_70 wrote:Shaking can last for enough time for compromise the accuracy on Gyro calibration.

Code: Select all

  /************************        continuous gyro calibration        ********************/
  /* Gyrocalibration will be repeated if copter is moving during calibration. */
    //#define GYROCALIBRATIONFAILSAFE

Works for Planes too!

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Airplane mode

Post by felixrising »

I've suggested this before, but I'm not a coder so can't contribute a patch (sorry)... Maybe put check in to verify if plane is stationary (ie not moving last couple of seconds - no acc vector / magnitude change), if plane is moving then it cannot be disarmed if already armed. Something similar for multi-rotor craft would be great with regard to throttle below mincheck disables attitude control... anyway, I digress.

Gyro Calibration has some tilt detection.. https://code.google.com/p/multiwii/sour ... rs.cpp#318

Code: Select all

          if (calibratingG % 10 == 0) {
            if(abs(imu.gyroADC[axis] - previousGyroADC[axis]) > 8) tilt=1;
            previousGyroADC[axis] = imu.gyroADC[axis];
...

davidmc36
Posts: 2
Joined: Mon Oct 14, 2013 2:49 pm

Re: Airplane mode

Post by davidmc36 »

Subscribe

e_lm_70
Posts: 297
Joined: Fri Aug 09, 2013 8:35 pm

Re: Airplane mode

Post by e_lm_70 »

PatrikE wrote:That was just a suggestion for a user how to solve it without hacking code.

Maybe there should be a #DISABLE_STICK_DISARM in config.


PatrikE wrote:
e_lm_70 wrote:Shaking can last for enough time for compromise the accuracy on Gyro calibration.

Code: Select all

  /************************        continuous gyro calibration        ********************/
  /* Gyrocalibration will be repeated if copter is moving during calibration. */
    //#define GYROCALIBRATIONFAILSAFE

Works for Planes too!


Yes, since MW 2.3 or 2.2 there is the option to block gyro calibration till the "copter/bird" is sensed as still.

Still, personally, I don't trust much this option, it is putting a sensible task on the edge.

What I did add in my code is a hack, I'm aware of it

Still I think have a box for airplane for force the gyro calibration does make a lot of sense to me. This will be the best option.

Anyhow, my I know when you airplane rth mode will be part of official multiwii ?

Is there anything that we can do for support this ?
Airplane RTH should be in the mainstream of MultiWii, it is looking a common goal for everybody flying multiwii on an airplane.

This for my understanding will also open to have EOS waypoint navigation also for airplane.

Thanks

e_lm_70

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

Re: Airplane mode

Post by PatrikE »

I have a few last fixes i need to test.
Mostly Failsafe handling without GPS.
will put the plane in AngleMode and add 5 degrees banked turn until failsafe timer cuts the motor.(20 Sec default in config)
The plane continues descend in circle after DisArmed.

Otherwise i just want test reports. good or bad experiences.

There's still a nasty bug in RTH....
Don't allow motorstop during Climbout to RTH altitude.
It will Stall the plane totally.

I'm trying to merge it with EOS WP-Nav atm.
I have some problem with logic differences between pane and copter.

Magik30
Posts: 30
Joined: Sun Sep 29, 2013 4:19 pm

Re: Airplane mode

Post by Magik30 »

Hi
I have a twin engines electric , model superhero, no rudder, just wing elevon mixer.
I'd like to do with differential engine to turn right or left.
just use the gas, and the differential yaw
I have a CRIUS SE.
it is posible?
Code exists?
Last edited by Magik30 on Mon Mar 31, 2014 9:49 pm, edited 2 times in total.

i3dm
Posts: 57
Joined: Tue Oct 01, 2013 4:48 pm

Re: Airplane mode

Post by i3dm »

PatrikE wrote:There's still a nasty bug in RTH....
Don't allow motorstop during Climbout to RTH altitude.
It will Stall the plane totally.


what do we need to do to avoid this?

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

Re: Airplane mode

Post by PatrikE »

Atm...
Don't throttle back fully during RTH!
I will limit the Elevator when motors is stopped to prevent stall in next release.

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

Re: Airplane mode

Post by PatrikE »

Magik30 wrote:Hi
I have a twin engines electric , model superhero, no rudder, just wing elevon mixer.
I'd like to do with differential engine to turn right or left.
just use the gas, and the differential yaw
I have a CRIUS SE.
it is posible?
Code exists?


No code exists and need a special mixtable.
Just need add a extra motor to FlyingWing.
Not impossible to fix.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: Airplane mode

Post by Plüschi »

Questions (noob to airplane mode):

Is there a easy-read list of changes done in PatrikE airplane?

The gps velocity in my test setup, using navisim as gps emulator, is very jumpy. I did have to smooth that velocity vector to get decent results. Is a real gps velocity also jumpy or is that smooth?

My planes need aile and rudder to turn nicely. Is there some sort of rudder-aile mixing in the code and where ?

A plane only needs "direction to home" coupled to rudder to do basic RTH. Right?

I have a mag-less "gyro - gps" sensor fusion. Basically this relies on gyro for North direction, and uses gps direction to compensate for drift. This makes direction lag-free and accurate, and also doesent mind gps dropouts or standstills for some time. Intrested?

Edit: What i found today:

The ParickE "beef" is in gps.c, provc FW_NAV().
The calculated corrections are fed into GPS_angle[] which is then used in the main pid loop.
Altitude corrections go into pitch and throttle, while direction goes into yaw and roll.

Overall this looks very good :)
Last edited by Plüschi on Tue Apr 01, 2014 8:07 pm, edited 1 time in total.

User avatar
shikra
Posts: 783
Joined: Wed Mar 30, 2011 7:58 pm

Re: Airplane mode

Post by shikra »

Yeah - I'm kinda interested too in a bit of an overview.

i3dm
Posts: 57
Joined: Tue Oct 01, 2013 4:48 pm

Re: Airplane mode

Post by i3dm »

PatrikE wrote:Atm...
Don't throttle back fully during RTH!
I will limit the Elevator when motors is stopped to prevent stall in next release.


i thought multiwii controlled the throttle during RTH?

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

Re: Airplane mode

Post by PatrikE »

@ Plüschi
It's a good summary of the function.

I just compare Ground Heading with direction to target and use to compensate Roll/Yaw.
Altitude from Gps is used to control elevator.
Throttle is mainly controlled depending on Altitude errors and Attack angle.

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

Re: Airplane mode

Post by PatrikE »

@i3dm

#define MOTORSTOP.
Will stop motor if throttle all way back. (Even in RTH)
It's a nice safety feature when handling and Preflight checking the plane on ground.
If you enable RTH on ground the motor will start at almost full throttle to start climbout.

Failsafe will override MOTORSTOP.

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: Airplane mode

Post by Plüschi »

Simulation of (what i think) PatrikE does when plane reaches home point (P factor is limiting):
Image

If i hard limit the banking angle i get this:
Image

A tangential approach to the circle with hard limited banking angle:
Image

A nicer approach is to start tangential mode only when distance_to_home is less than 3*circle_radius:
Image

Processing source including tangential approach code is attached.
Attachments
planenavi_circle.zip
(826 Bytes) Downloaded 193 times

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: Airplane mode

Post by Plüschi »

Making it better:
For the promicro ( $19 nanowii ) i wonder why not use the A32U4_4_HW_PWM_SERVOS define. You just have to skip around the "not a helicopter" warning messege and it works. Its ALL hardware PWM with #define A32U4_4_HW_PWM_SERVOS. Pins are changed, 9 elev, 10 aile1, 5 yaw, 6 thro, 11 aile2. Hardware PWM means no jitter and no problems, better resolution and stability.

One upping the thing:
By not using aile2 and mapping yaw to pin11 instead of pin5 then pin 13 can then be used as ICP input for timer3. This would mean ppm-sum signal goes to pin13 and ppmsum would become hi-res and jitter-free hardware timed input. But its lots of work.

felixrising
Posts: 244
Joined: Sat Mar 23, 2013 12:34 am
Location: Australia

Re: Airplane mode

Post by felixrising »

Anyone want to port this to baseflight? ;)

serpa4
Posts: 1
Joined: Fri Dec 27, 2013 10:38 pm

Re: Airplane mode

Post by serpa4 »

Good day all.
I have two flight boards of which I know nothing about.
1) MWC MultiWii Lite Lightweight Version 4 Axis Flight Control Board. http://www.myrcmart.com/mwc-multiwii-lite-lightweight-version-axis-flight-control-board-p-6204.html

and this

2) MWC MultiWii SE V3.0 Flight Control Board Standard Edition Mini Aircraft Compatible. http://www.myrcmart.com/product_info.php?products_id=6815

I need to stabilize a flying wing that is difficult to lauch and nothing else. Which board is best (SEv3 I'm pretty sure)? Where can I learn how to load the correct software and make it fly a wing? I bought a hex copter and it came as an extra part. Now I need it for a wing (if it can do it).

I know nothing about programing it. However, I use an AMP board in my quad and the GUI makes it easy to pick what I fly and just check little boxes and it does the rest. Is the SEv3 have a similar GUI for airplanes?

If anyone can point me in the right direction, I'll read up and learn.

simply
Posts: 3
Joined: Mon Jun 18, 2012 9:26 pm

Re: Airplane mode

Post by simply »

I've an issue I've seen in both 2.2 and 2.3 in Airplane mode, and I kind of hope I've just missed something...

In Passthrough, with all sticks centered, no trim and plane level on table, servo outputs are centered, verified with GUI (output 1500)

But as soon as I switch from Passthrough to Stable mode, servo outputs for Ailerons (Wing1,Wing2) change about 20-50us.
Sticks still centered and plane level, ie nothing moved.

Has anyone else experienced this phenomenon, know what causes it, has a solution?

Thanks in advance!
//

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

Re: Airplane mode

Post by PatrikE »

It's just PID regulator adding sensor compensation.
Nothing to worry about.
Just make sure it's centered in Passthru.

simply
Posts: 3
Joined: Mon Jun 18, 2012 9:26 pm

Re: Airplane mode

Post by simply »

PatrikE wrote:It's just PID regulator adding sensor compensation.
Nothing to worry about.
Just make sure it's centered in Passthru.


OK, but why compensate for practically nothing? Or will it not happen when IRL when flying?

It _looks_ bad, especially on a small funfighter that have very small span between full up/down aileron, around +/- 200us around MID :S

//

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

Re: Airplane mode

Post by PatrikE »

With "Stable mode" do you mean Acro or Horizon/Angle?
If its Horizon/Angle the plane will compensate if its tilted in any direction.

All the tiny error calculations adding up.
MWii is trying to compensate and nothing happens because the plane is static on the table.
Everything will even out when the plane is in motion.


Start in passthru and when you are comfortable switch to Acro.
Horizon or Angle is next step.

You can start with Half P value for Gyro (1.5) first test.

simply
Posts: 3
Joined: Mon Jun 18, 2012 9:26 pm

Re: Airplane mode

Post by simply »

PatrikE wrote:With "Stable mode" do you mean Acro or Horizon/Angle?
If its Horizon/Angle the plane will compensate if its tilted in any direction.


Sorry, with Stable I mean Acro, gyro only. And the plane is not tilted and it's calibrated in this position, not moved after calibration. All sensors in GUI flatlined...

PatrikE wrote:All the tiny error calculations adding up.
MWii is trying to compensate and nothing happens because the plane is static on the table.
Everything will even out when the plane is in motion.


Yeah, but even if it's only around 20us, it's freakishly a lot of movement for this small aircraft - On my Bixler it's hardly noticeable ;)

oh well, will try and see what happens...

Thanks!

//

zinets
Posts: 3
Joined: Sat Feb 15, 2014 9:51 am

Re: Airplane mode

Post by zinets »

hi

i (again) have one stupid question :)

crius se v2 board, bixler, no gps; mwii 2.3 without any changes (my expiriens with mwii - qcopter(s), plane & flying wing)

this time if i switch to angle/horizont mode, controller make throtle 90-100%! Why? is there any define in config.h for it?

baro and/or magnetometer can affect motor's behavior?

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

Re: Airplane mode

Post by PatrikE »

For planes BaroMode will control throttle Not Elevator
It's meant for copter use where throttle is used for controlling altitude.
It's a little wrong approach for planes...

Otherwise i don't think throttle should be controlled in V2.3.
You can test to clear Eeprom.
Is all servo/Esc on correct pins?

Start with only your FC + Airplane & receiver.

You can test the Fixed wing Nav branch instead.
FW_Nav_1140402.zip
It will work just as good without GPS attached.
And it have improved failsafe for planes.
Don't forget to enable #define FAILSAFE
Without GPS It will set the plane in a turn instead of flying off with level wings.
With Gps it will do return to home.

Patrik

Jarzas
Posts: 1
Joined: Fri Jun 27, 2014 3:33 pm

Re: Airplane mode

Post by Jarzas »

Hi

I have a Promini board and I want to use pin12 to AUX2 (Promini settings #define RCAUXPIN12).
With copter the AUX2 is working ok and follow pin12,
but with aeroplane the AUX2 follows ROLL channel and pin12 don't do anything.
This happen with mw2.3 , with older mw2.2 version it's works correctly.

Any idea?

User avatar
Plüschi
Posts: 433
Joined: Thu Feb 21, 2013 6:09 am

Re: Airplane mode

Post by Plüschi »

I have a nanowii board from HK. The $19 one. Very small and light with dsmx sat. Does patrike code run on this with hardware pwm servo?
IS there a 328 / 32u4 plane fork yet?

I intend to add a GPS but not with a heavy patch antenna, i want a wire / leaf ant. Anyone experience with that?

The whole thing should go on my slowstick, this
Image

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

Re: Airplane mode

Post by captaingeek »

any recommendations on using this for a flying wing? IE only 2 servos?

theailer
Posts: 49
Joined: Tue Sep 24, 2013 9:06 pm

Re: Airplane mode

Post by theailer »

captaingeek wrote:any recommendations on using this for a flying wing? IE only 2 servos?

It's pretty straight forward. Just type mixer flying_wing in cli to enable it.

Joseph97
Posts: 16
Joined: Sun Jun 08, 2014 8:15 pm
Location: US of A

Re: Airplane mode

Post by Joseph97 »

Plüschi wrote:I intend to add a GPS but not with a heavy patch antenna


Maybe try this: http://www.rcgroups.com/forums/showthread.php?t=2012386. I'm using it with great success with PatrikE code on a 4 ounce foamie. Or it should be possible to replace the heavy patch on a regular GPS with your own version of this antenna at very low cost.
Attachments
one_gram_gps.jpg

rubadub
Posts: 154
Joined: Mon Apr 28, 2014 2:36 am

Re: Airplane mode

Post by rubadub »

PatrikE wrote:For planes BaroMode will control throttle Not Elevator
It's meant for copter use where throttle is used for controlling altitude.
It's a little wrong approach for planes...

Otherwise i don't think throttle should be controlled in V2.3.
You can test to clear Eeprom.
Is all servo/Esc on correct pins?

Start with only your FC + Airplane & receiver.

You can test the Fixed wing Nav branch instead.
FW_Nav_1140402.zip
It will work just as good without GPS attached.
And it have improved failsafe for planes.
Don't forget to enable #define FAILSAFE
Without GPS It will set the plane in a turn instead of flying off with level wings.
With Gps it will do return to home.

Patrik


new here.
I'm trying to setup Patrik's fixed wing code on a teksumo flying wing.
questions:
- I understand why the standard 'baro' mode is useless for the current fixed wing implementation, but why isn't the actual sensor value from the baro being used? For example, I took a look at the 'FW_NAV()' function in GPS.cpp. Based on the code in that function, the GPS altitude is being used for altitude corrections when in RTH mode. Wouldn't it make more sense to use the altitude calculated from the baro sensor? Can someone please explain why this is setup this way? I'd much rather trust my baro sensor for altitude readings than the GPS-calculated altitude (or at least would like to have the option to enable this).

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

Re: Airplane mode

Post by PatrikE »

The Idéa behind it is that it should work with a minimum of sensors.
And there can be problem if the Baro is affected by airspeed.
GPS altitude is good enough for RTH But not precision Navigation.
My plane rarely diff more than 2-3 meters in alt.'

In void FW_NAV() you can change it to use Baro.

Code: Select all

  // Calculated Altitude over home in meters
  //int16_t curr_Alt = GPS_altitude - GPS_home[ALT]; // GPS_Altitude
  int16_t curr_Alt = alt.EstAlt/100; // Test with BaroAltitude
GPS use Meters and Baro cm That's why it's divided by 100.

Patrik

rubadub
Posts: 154
Joined: Mon Apr 28, 2014 2:36 am

Re: Airplane mode

Post by rubadub »

PatrikE wrote:The Idéa behind it is that it should work with a minimum of sensors.
And there can be problem if the Baro is affected by airspeed.
GPS altitude is good enough for RTH But not precision Navigation.
My plane rarely diff more than 2-3 meters in alt.'

In void FW_NAV() you can change it to use Baro.

Code: Select all

  // Calculated Altitude over home in meters
  //int16_t curr_Alt = GPS_altitude - GPS_home[ALT]; // GPS_Altitude
  int16_t curr_Alt = alt.EstAlt/100; // Test with BaroAltitude
GPS use Meters and Baro cm That's why it's divided by 100.

Patrik

cool, thanks for the help Patrik.
Ok, I think I see your point about pressure vs airspeed; I'm assuming you mean because the airflow could cause a pressure drop? What if the baro sensor is foam-shielded?

Also, any ideas on how one might try to fuse the GPS and baro height, perhaps add some kind of complementary filter or something?

rubadub
Posts: 154
Joined: Mon Apr 28, 2014 2:36 am

Re: Airplane mode

Post by rubadub »

another issue that I'm finding is that ANGLE mode is enabled by default during testing (ANGLE box is green in MWGUI) and I can't disable it.
I have FAILSAFE disabled in config.h and I have no receiver connected to the FC.
THR channel reads 1350 & ROLL reads 1450 (not sure why, should be at 1500).
All other channels are at 1500. All AUX switches are disabled.
I checked the code and can't find where ANGLE is being enabled by default.
ANGLE_FW.png

any ideas why this is happening?

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

Re: Airplane mode

Post by PatrikE »

It's Failsafe!..
Failsafe throttle is 1350 if you have not changed it.
Roll 1450 is there to put the plane in a large left turn instead of flying level for ever.(Flyaway)
Start Transmitter and Angle mode should be disabled.

Make sure you commented FAILSAFE in config.

rubadub
Posts: 154
Joined: Mon Apr 28, 2014 2:36 am

Re: Airplane mode

Post by rubadub »

PatrikE wrote:It's Failsafe!..
Failsafe throttle is 1350 if you have not changed it.
Roll 1450 is there to put the plane in a large left turn instead of flying level for ever.(Flyaway)
Start Transmitter and Angle mode should be disabled.

Make sure you commented FAILSAFE in config.


yes, but the strange thing is that FAILSAFE is completely disabled in the config, I triple-checked, and it is definitely disabled...

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

Re: Airplane mode

Post by PatrikE »

In gps.h.
#define FAILSAFE // Enable RTH failsafe incl Auto DisARM at home to autoland

Comment that too.

Post Reply