Airplane RTH BaseFlight

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

Hi Kev,

Looks like correct procedure.
Make full throws for Roll & Elevator in both ways.

You can test the Gui included in this dev version for Arduino FC.
https://multiwii.googlecode.com/svn/bra ... 140402.zip
It have a software TX built in witch i use for testing on the bench.

Good luck.

tanman
Posts: 9
Joined: Sun Jul 22, 2012 2:16 am

Re: Airplane RTH BaseFlight

Post by tanman »

will the RTH still work for planes without rudder?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

tanman wrote:will the RTH still work for planes without rudder?

Yes no problems.
I only fly with Ailerons Elevator on my planes.
But i have heard from others it flies better using Rudder for Navigation.

tanman
Posts: 9
Joined: Sun Jul 22, 2012 2:16 am

Re: Airplane RTH BaseFlight

Post by tanman »

PatrikE wrote:
tanman wrote:will the RTH still work for planes without rudder?

Yes no problems.
I only fly with Ailerons Elevator on my planes.
But i have heard from others it flies better using Rudder for Navigation.


Thanks very much Patrike. One more question I have configured my ublox gps for UBx+NMEA for both protocol in and out as configuring it just for ublox does not make it work (gps is a ublox Neo-6M) what GPS type do I need to set in CLI?

Cheers

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane RTH BaseFlight

Post by crashlander »

In my experience you can set UBX in cli and Baseflight will took care of setting actual module!

Regards
Andrej

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Airplane RTH BaseFlight

Post by scrat »

set gps_type=1

and reset your gps to default in u-blox center software. Baseflight FW will take care of settings.

tanman
Posts: 9
Joined: Sun Jul 22, 2012 2:16 am

Re: Airplane RTH BaseFlight

Post by tanman »

thanks to all. will test this soon

crashlander
Posts: 506
Joined: Thu May 05, 2011 8:13 am
Location: Slovenia

Re: Airplane RTH BaseFlight

Post by crashlander »

@PatrikE: I can see in code that limits for max correction are from -450 to 450
cli.c

Code: Select all

{ "gps_maxcorr", VAR_INT16, &cfg.gps_maxcorr, -450, 450 },
    { "gps_rudder", VAR_INT16, &cfg.gps_rudder,  -450, 450 },
    { "gps_maxclimb", VAR_INT16, &cfg.gps_maxclimb,  -450, 450 },
    { "gps_maxdive", VAR_INT16, &cfg.gps_maxdive,  -450, 450 },


Are those absolute servo pulses from mid (or current stable) or are those degrees *10?

And after that they get multiplied again in fw_nav.c (same as original MWII)

Code: Select all

GPS_angle[PITCH] = constrain(altDiff/10,-cfg.gps_maxclimb*10,cfg.gps_maxdive*10) + ALT_deltaSum;
    GPS_angle[ROLL]  = constrain(navDiff/10,-cfg.gps_maxcorr*10, cfg.gps_maxcorr*10) + NAV_deltaSum;
    GPS_angle[YAW]   = constrain(navDiff/10,-cfg.gps_rudder*10,  cfg.gps_rudder*10 ) + NAV_deltaSum;


Is there any difference between BaseFlight and MWII or are those CLI values (limits) wrong?

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

Hi Andrej,
The limit for Gps is 45degrees *10.
That part is a direct copy from MWii 8bit version.
And you are correct, it should be +/- 45 in cli.c...( Degrees *1 )
In the constrain's the limits should be degrees *10.

As long as cli values is low it should work fine anyway.
Normal values should be 20-40 degrees.

Good catch.
I'll correct it after weekend.

/Patrik

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Airplane RTH BaseFlight

Post by alistairr »

Has this code been added to Baseflight?

timecop
Posts: 1880
Joined: Fri Sep 02, 2011 4:48 pm

Re: Airplane RTH BaseFlight

Post by timecop »

Not yet, but it should be soon

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

Post by theailer »

Best thing I've read this week

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Airplane RTH BaseFlight

Post by alistairr »

Very cool

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Airplane RTH BaseFlight

Post by alistairr »

test flew today a Balsa/Ply built up mid wing plane today with Rev4 acro and $20 Ublox NEO6 with Patrick's programming and it worked flawlessly straight away. I've always used Eagle Tree for my fixed wings in the past but this Naze32 and GPS set up is so compact/light and cheap I'm so impressed. Just need to sort out a way to decode the GPS for antenna tracking...lol but really this is so small it could be fitted to anything. Love it :D

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Airplane RTH BaseFlight

Post by scrat »

alistairr wrote:test flew today a Balsa/Ply built up mid wing plane today with Rev4 acro and $20 Ublox NEO6 with Patrick's programming and it worked flawlessly straight away. I've always used Eagle Tree for my fixed wings in the past but this Naze32 and GPS set up is so compact/light and cheap I'm so impressed. Just need to sort out a way to decode the GPS for antenna tracking...lol but really this is so small it could be fitted to anything. Love it :D


Could you be so kind and post a picture of everytnih connected on the plane and what version of Airplane RTH BF did you use. THX!

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Airplane RTH BaseFlight

Post by alistairr »

Google fixed base flight for rc groups thread. It is Patricks firmware. I'll post pic in the next week but it's nothing special. Acro board using ppm feature GPS. Gps powered from spare motor outputs and gps tx and rx to inputs 3 and 4

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Airplane RTH BaseFlight

Post by alistairr »

I've got an afromini in a blunt Nose teksumo but not ready to fly yet. Been distracted by new blackout h quad lol

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Airplane RTH BaseFlight

Post by IceWind »

Just got some afromini to load in a wing.
So test will start soonnnn. :)

Does the .hex file in 1st post is still the newest (tested hopefully) version available?

Thanks!

alistairr
Posts: 51
Joined: Thu Sep 26, 2013 10:30 am

Re: Airplane RTH BaseFlight

Post by alistairr »

Plane with no ailerons



Hi
I've set up a normal 4 channel plane with an acro naze 32 and a blunt nose Teksumo with afro mini. Both have NEO6 GPS and both fly great!! Now I'm playing with a friends FPV plane that only has rudder and elevator (no ailerons) and was wondering what settings will need to be changed to put roll corrections through the rudder for stabilization and GPS navigation. Any help would be greatly appreciated. I've gone back through much of this forum as I thought I had read something but I can't find it.


Thanks

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

I'm not sure but you would probably need a new Mixtable.
Navigation can be done with rudder only.
But the code wouldn't be able to compensate for Roll in that case.

Or maybe connect rudder to aileron port and reduce Maxcorr to 10 degrees.
I think it might work but i can't guarantee it.
Roll compensation will then be added to the rudder.
Only way is to test how it behaves.

cherokee180c
Posts: 7
Joined: Wed Jul 16, 2014 2:08 am

Re: Airplane RTH BaseFlight

Post by cherokee180c »

I already have an AcroNaze 32 board and a full Naze 32 board that I am familiar with for quads. What would I need to do as far as firmware to use for a glider? Does the normal baseflight program have the code or do I need to flash with new hex? Also, can the Naze handle separate L/R aileron channels? Lastly is there a way to enable and disable stabilization via aux channel? I was really looking to test and then just use in Loss of sight RTH scenario until I could see glider again. Do you need the mag and barometer especially if you don't need altitude hold,or can you just add GPS to the Acro board?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

The regular Baseflight works only as a flight stabilizer.
For RTH function on a plane you need to use my modified version.
Separate L/R ailerons is supported.
If you use a Arduino board you can even setup Crowbreaks and flaperons in the controller.(Removed in BF)

You can set up Passthru on a AUX channel for manual control without stabilizing.
The code works without Mag & Baro.
Gps data is used instead.
AcroBoard + GPS works fine.

Maxclimb is set to 15 degrees and is probably not a good value for a glider.
It can be hard to climb without motor.

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Airplane RTH BaseFlight

Post by scrat »

Why can't we implement failsafe RTH to original baseflight and use it with multicopter?

cherokee180c
Posts: 7
Joined: Wed Jul 16, 2014 2:08 am

Re: Airplane RTH BaseFlight

Post by cherokee180c »

PatrikE wrote:The regular Baseflight works only as a flight stabilizer.
For RTH function on a plane you need to use my modified version.
Separate L/R ailerons is supported.
If you use a Arduino board you can even setup Crowbreaks and flaperons in the controller.(Removed in BF)

You can set up Passthru on a AUX channel for manual control without stabilizing.
The code works without Mag & Baro.
Gps data is used instead.
AcroBoard + GPS works fine.

Maxclimb is set to 15 degrees and is probably not a good value for a glider.
It can be hard to climb without motor.


Thanks for the reply. Is the file on post 1 still the latest version? Also I have programmed in crow, so would like to keep that in pass through mode. Is pass through mode just basically a software switch off an aux channel so all the inputs and outputs all go through Naze32 still, just with no stabilization? I will be trying on myFlip32+ first. What is the correct way to set up the separate L/R ailerons? The Naze/Flip can be set up without using PPM for inputs correct? The taranis X8R receivers do not support PPM anymore without adding a converter which is out of stock. If I don't use PPM, how should I connect the Ublox 6M GPS, as I think on the flip it needs to be connected via pins 3 or 4, but it also has an I2C connection. Thanks for all the help. I hope to flash the Flip tonight with your hex if all goes well.

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

http://www.abusemark.com/downloads/naze32_rev3.pdf
From NAZE32 manual wrote:When GPS feature is enabled, channels 3 and 4 are are used for 3.3V GPS connection.
(3:TX, 4:RX). with CPPM receiver, these are normally unused, with standard receiver,
connect AIL to 1, ELE to 2, THR to 5, RUD to 6, and AUX1/2 to channels 7 and 8.
BaseFlight don't support I2C GPS.

BF handles the mixing.
If Passthru is active The channels will be sent thru the mixer without sensor influence.
BaseFlight don't have mixing for handling ailerons as flaps.

The Transmitter must be setup for normal 4 channel without mixing.
Some of the AUX channels can be connected direct to servos.(Flaps,Towhook release & Airbrakes etc)

To use Crowmix a new mixing function must be added.

cherokee180c
Posts: 7
Joined: Wed Jul 16, 2014 2:08 am

Re: Airplane RTH BaseFlight

Post by cherokee180c »

Thanks again. I learned a ton tonight and was able to flash your hex file into the flip32+. I also enabled mixer airplane and saw how to set up the additional ailerons. I also decided it was best from a physical and programming standpoint to just buy the SBUS to CPPM converter for the FrSky X8R, so now I can easily hook up in CPPM mode. The number of questions I have is dropping rapidly.

Crow should not be a problem, because I only use Crow during landing mode, and I can simply put the Flip into passthrough mode when my landing mode switch is enabled, does that make sense? I think you are recommending for me to have the flap channels go direct to the servos and bypass the Flip controller entirely, correct?
On the ailerons, they work as normal, but have a bias forced in from a curve if camber or reflex is enabled. All this really does is move the center point of the output up for reflex and down for camber. Will the Flip just see this as a normal forced signal and control from that point? I also have aileron differential built in through mixing, but I assume that may be a problem as well? What I don't understand is that the Flip controller can only see the incoming PPM signal for that channel. How does it know if the signal is from mixing or stick movement?

If all this is a problem, I may have to disable stabilization totally when flying normal and then just set everything to off when RTH is enabled.

Is the base PID's close for starting purposes in airplane mode?
Attachments
Screen Shot 2014-08-19 at 9.18.41 PM.png

kaysee
Posts: 41
Joined: Sat Oct 05, 2013 2:38 pm
Location: Malaysia
Contact:

Flying Wing

Post by kaysee »

Hi guys.

I don't know if this thread still active or not, but want to try my luck.

I'm a hardcore mini multirotor fpv'er and recently trying to get back in flying fixed wing and successfully had a couple of fpv flight with a flying wing. Being a enthusiast in trying something new I would like to give this firmware a try on my flying wing using an afromini.
But until now I can't figure out how to get the mixing right. I've flashed Patrick's latest rth baseflight firmware. As for the settings, I'm using Multiwii Conf 2.3 (current baseflight conf require 2.31 to be able to connect) and I use Putty for CLI.
My problem is, I can't get the servos to mix right for nick/elevator. I only get roll/aileron mix weather I'm moving the roll stick or the elevator, only its in the other direction.

Can somebody help me with this. Cant seem to find the answer I'm looking for after a couple of weeks searching.

User avatar
IceWind
Posts: 115
Joined: Fri Mar 25, 2011 2:11 am
Contact:

Re: Airplane RTH BaseFlight

Post by IceWind »

Go here, that is where the action is now >> http://fpvlab.com/forums/showthread.php ... fixed-wing.

kaysee
Posts: 41
Joined: Sat Oct 05, 2013 2:38 pm
Location: Malaysia
Contact:

Re: Airplane RTH BaseFlight

Post by kaysee »

thanx man.

btw I solved my problem by trial n error ;)

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

There is a newer version for Baseflihgt.
baseflight_FW_RTH.rar

You must enable Live mode in the servo tab.
Click the boxes to change direction per servo and axis.
Save to eeprom when you are satisfied.
Explained in the Howto for MWii but the function is the same for Baseflight.
http://fotoflygarn.blogspot.se/2012/03/ ... -same.html

And Yes The FpvLab thread is more active.

kaysee
Posts: 41
Joined: Sat Oct 05, 2013 2:38 pm
Location: Malaysia
Contact:

Re: Airplane RTH BaseFlight

Post by kaysee »

I don't know how I can missed that when I did the research. It's all there!
Thank you very much PatrikE. Can't wait to give it a try.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Are this .hex file can work correctly on stm32F103c8t6 (with 64K flash) based boards or on stm32F103c8t6 (with 128K flash), only ?

scrat
Posts: 925
Joined: Mon Oct 15, 2012 9:47 am
Location: Slovenia

Re: Airplane RTH BaseFlight

Post by scrat »

128k only.

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

The size of the hexfile is >200.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Which level of GPS support exist in this code ? Is it can fly on airplane by WP, correctly ? Or RTH only ?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

RTH & PH...
It's been included in Baseflight master now.
Select use developer firmware in the flasher window.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Position Hold ? In airplanne mode ? but how it look like in airplane ?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

Sets a Waypoint in 3D and continuisly fly to it.
It will fly in a circle or figure 8 randomly to turn around to hit it again and maintaining altitude.

RTH will do the same after it hit home Pos.
Unless it's in failsafe..
Then it will Disarm and circle down.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Hi Patrik. You good know baseflight code. How difficult add to it " navigation of single waypoint". Just flight in one a predetermined point from any current position
it's almost like holding the position, but the plane flies to the point that not remember, but at the coordinates are specified in advance. for example through the RC protocol of MW. Point cord are set via serialRC and and periodically check is it reach this point via serialRC/

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

I guess you can use MSP_WP to set a WP even for Baseflight.
You should be able to use the MWii EZ-Gui for android to test.

I have not tested it but it might work.


Otherwise hard coded position but that's not practical in field.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Hi Patrik. I want to try develop fork of yours code with extended GPS functions, and some other sweet things. But code on trunk where yours code changes are merged, do not compiling correctly. Do I can found yours current code in some other repository ?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

Check out official baseflight from git.
It's merged to master branch now.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

thanks, problem solved. I just change my toolchain from codebench to standard GNU-arm and all compiling good. Problem was because I have no Keil and use Eclipse for development. In first time I try make it via description on rcgroups forum but this instructions to old for compiling current baseflight code

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Now I planing add USB support in code, as alternate way for setup device... and fo serialRC so

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

SerialRC already works.
But not like in MWii where MSP_RC works direct and overwrites PPM/PWM channels.

I have modified MWiiGui with a Software TX.
https://db.tt/68d9KJeZ
I use this Gui for benchtesting.
Without props!...

To enable SerialRC in CLI.

Code: Select all

feature SERIALRX
set serialrx_type=4


https://github.com/multiwii/baseflight/ ... upner-SUMD

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

I know. I already using serialRC from gamepad in mwii via serial and via IP, from my modified version mwiiconf(viewtopic.php?f=8&t=4953&p=53732&hilit=joystick#p53731) But for that I was made little change in wii code, so - for prevent "pulsing mixing" data from RC and serial RC (just disable usual RC via additional #define and it check in next code, but this not best way)
I want to add serialRC not only via seral, and so via USB/ I think this will be useful, for some features. I know cleanflight already have usb VCP support, but I don`t know is it can work with GPS in airplane mode :?

But what differ in serialRC baseflight compare to multiwii ?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

If you activate serial RC in baseflight i think RX based is disabled and only Serial is active.

In MWii Serial will replace the channels if they have valid data.
It means you can use both at the same time.
ex.
Let a normal TX with PPM send 8 channels and control everything.
If you start the serial and send zero as command on the first 6 channels and valid inputs on ch 7&8.
Serial will overwrite the two last channels to control a gimbal or headtracker...

Almost like a DualCommand system.
And BF can only handle one at a time.

You can send the serialRC data on USB port on BF.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Hi Patrik/ On weekend I added usb-vcp support to my hardware in cleanflight code. ( in there it was for stm32F3XX devices, only/ I added it for stm32F1XX, too)/ I think do repeat this for baseflight, but not shure is the interesting for author (timecop) porting baseflight code for nonafro hardware. What do you thunk about porting yours code for airplane to cleanflшght ? If you agree, do I can try it to do ?

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

I have looked at cleanflight but i get confused by all the fragmented code.
You're welcome to port it.
As long as you follow open source rules it's ok.

Shual
Posts: 17
Joined: Tue Jul 22, 2014 7:23 pm
Location: Ukraine

Re: Airplane RTH BaseFlight

Post by Shual »

Ok, but first questions: how I can find yours changes in basic baseflight code. For simplifying this, do you can say me in which basefligt files you puts this changes, (if you no difficult, so)

Post Reply