Airplane RTH BaseFlight

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

Re: Airplane RTH BaseFlight

Post by msev »

Great news that you flight-tested it and it works as expected!

vdjc
Posts: 28
Joined: Fri Nov 23, 2012 9:33 pm

Re: Airplane RTH BaseFlight

Post by vdjc »

The code on github has just been updated with the latest sources from Patrick:
https://github.com/sbaron/baseflight/tree/rth_dev

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

Re: Airplane RTH BaseFlight

Post by crashlander »

<EDIT>
I just saw that line in mw.c

Code: Select all

if ((failsafeCnt > 5 * (cfg.failsafe_delay + cfg.failsafe_off_delay)) && !f.FAILSAFE_RTH_ENABLE)

that disables that delay...
</EDIT> :)

I'm missing arduino alternative of

Code: Select all

#define FAILSAFE_OFF_DELAY

In MWII I increase this value to 6000+ (I do not want my plane to shutdown after 30s of FS RTH flight).

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

No need to increase failsafe_off_delay.
It is only active if f.FAILSAFE_RTH_ENABLE is false...

Code: Select all

if ((failsafeCnt > 5 * (cfg.failsafe_delay + cfg.failsafe_off_delay)) && !f.FAILSAFE_RTH_ENABLE)

f.FAILSAFE_RTH_ENABLE is only true for FixedWing in falisafe and with GPSFix.!

If there's no Gps fix it will go in normal falsafe and Disarm
A 5 degree bank is added and the plane will be disarmed after failsafe_off_delay.
And you don't want the plane to continue flying in falsafe for ever.

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

Re: Airplane RTH BaseFlight

Post by Plüschi »

For the first test i need some more info:

- was the version tested with NMEA or UBX-binary GPS ?

- I dont want climbout. How do i disable ?

- I dont want altitude control. Plane will be 100% visual, i to want build up confidence in RTH. How do i disable altitude control ?

- I dont want any fancy failsave features. How do i disable ?

Plane is Easystar2, Afromini controller.

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

Being cautious is never wrong.
Easystar is same type of plane as i tested the code on.

- was the version tested with NMEA or UBX-binary GPS ?
I have only tested NMEA.
But on Arduino I know I2C works equal.
If Ublox works on copters it should work for planes to.

With CLI Tweaking, This should disable Altitude and throttle code as much as possible.

Code: Select all

set climb_throttle = xxxx // Set to same as cruicethrottle value...
set gps_maxdive = 0
set gps_maxclimb = 0
set scaler_throttle = 1
Throttle will still vary a little depending on AltError.
The climbout flag will still be set below RTH Altitude.

- I dont want any fancy failsave features. How do i disable ?

Don't enable...

Code: Select all

feature FAILSAFE
feature FAILSAFE_RTH
Will give you Switch selected RTH Only.
But i recommend feature FAILSAFE as it will Cut throttle and circle down the plane.

I'm not sure how the plane will react on this Hacks.
I think it's safer to just disable Failsafe RTH.

Good luck Testing...
Patrik

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

Re: Airplane RTH BaseFlight

Post by crashlander »

Just back from the field and BaseFlight RTH is tested and WORKING!
Equipment used:
Assassin wing (from Crash Test Hobby)
AfroMini 32 (thanks TC for wonderful mini FC and BaseFlight)
Ublox NEO-5
Orange OpenLRS (OpenLRSng)

Thank you Patrik!

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by crashlander »

In BaseFlight I'm missing MWII' s alternative of

Code: Select all

#define GYRO_SMOOTHING

Since I can not remove fast dive elevon oscillation (on pitch) even when I set

Code: Select all

set gyro_lpf = 10

in CLI.
Second observation is that my wing always "rocket" (with high pitch angle) into climb when it is lower than set height and RTH is enabled even if I set

Code: Select all

set gps_maxclimb = 10

I'm flying in HORIZON mode and that one is also enabled with RTH functions.

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

With some sarcastic comment GYRO_SMOOTHING was removed from Baseflight source just before i checked it out for merging.
Because No one was using it.
MPU6050 is more sensitive than ITG gyros.

RTH is actually intended for Failsafe and not a normal flightmode.
The "Rocket Launch" is to ensure it will reach altitude as fast as possible.

Some sort of GYRO_SMOOTHING is probably needed for FlyingWings.
LPF is not enough.

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

Re: Airplane RTH BaseFlight

Post by timecop »

Yeah. It was removed because its implementation was kinda poop, as well as setting it (was a 32bit int that people would had to calculate with a binary calculator or something, who'd do that in 2014?).

If there's a clean patch to make this work again, I'll be glad to re-include it. And I don't mean just re-introducing old code ;)
Speaking of patches, if anyone feels like cleaning up and submitting this into baseflight, assuming it follows https://github.com/multiwii/baseflight/wiki/CodingStyle and doesn't break anything else, it will be accepted

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

Re: Airplane RTH BaseFlight

Post by Plüschi »

PatrikE wrote:Some sort of GYRO_SMOOTHING is probably needed for FlyingWings.


Would a lower P or/and I value not be better at solving oscillation?
We should not compensate wrong PID values by shooting the sensor in the knee.

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

Re: Airplane RTH BaseFlight

Post by crashlander »

PatrikE wrote:RTH is actually intended for Failsafe and not a normal flightmode.
The "Rocket Launch" is to ensure it will reach altitude as fast as possible.

It seems that current (Baseflight) code does not use safe max climb parameter (set gps_maxclimb) as set in CLI and would probably stall underpowered planes.

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by crashlander »

Plüschi wrote:
PatrikE wrote:Some sort of GYRO_SMOOTHING is probably needed for FlyingWings.


Would a lower P or/and I value not be better at solving oscillation?
We should not compensate wrong PID values by shooting the sensor in the knee.

In that case only use of airspeed sensor and some kind of "TPA" (APA) based on that would be nice.

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

crashlander wrote:It seems that current (Baseflight) code does not use safe max climb parameter (set gps_maxclimb) as set in CLI and would probably stall underpowered planes.

Regards
Andrej


The limits is applied same way as for Ardu version.
Elevator compensation is added after limiting is done.
It can be why it seems to not work.

Below 20 meters the wings should be level and no elevator compensation added.
After 20m it's allowed to start navigate and elevator is added equal to Roll angle.
If the plane banks ~45 it will add 450µs to elevator.( Almost Full up )

I have seen it on my HK RadJet too.(Arduino board)
First a nice accent to 20m and shoots skywards when it starts navigate.
On the Bixler type it's not so visual.

Climbout flag forces max climb, Elevator Compensation on that Can be BAD.
Maybe check the Climbout flag before allowing compensation would be a solution.
Or cancel climbout after 20m and use alterror + compensation
Today It keeps Full climb + compensation until altitude is reached.

I use Angle mode in GPS modes.
Passthru, Acro or Horizon for flying.


Patrik

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

A airspeed sensor would be optimal and "TPA" (APA) based on that would be nice.
But we can use the fact that we know the angle of attack and throttle and feed "APA" with it.

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

Re: Airplane RTH BaseFlight

Post by crashlander »

PatrikE wrote:A airspeed sensor would be optimal and "TPA" (APA) based on that would be nice.
But we can use the fact that we know the angle of attack and throttle and feed "APA" with it.

That would produce bad oscilations after fast dive, during recovery...

crazyal
Posts: 84
Joined: Tue Sep 04, 2012 11:25 pm

Re: Airplane RTH BaseFlight

Post by crazyal »

I took vdjcs baseflight commit and cleaned it up a bit. The formatting should be allright now, but the global vars shared between gps.c and fw_nav.c are still unclean and should be changed into a clean struct according to timecop.
If anyone wants to proceed with it, here is my change: https://github.com/luggi/baseflight/com ... 8a34e52455

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

Re: Airplane RTH BaseFlight

Post by crashlander »

I have seen it on my HK RadJet too.(Arduino board)
First a nice accent to 20m and shoots skywards when it starts navigate.
On the Bixler type it's not so visual.

O.K. I understand it is true that my BaseFlight wing is very different from my Ardu one (faster and more agile/overpowered).
I have lowered gps_maxclimb to 8 and now it look's nicer. :)
Probably any solution that would not add climbout and elevator compensation together would be O.K. (maybe zeroing compensation while climbout is active?).

Regards
Andrej

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

I have tested to cancel ElevComp But then the climbout feels lame.
gps_maxclimb = 15 degrees.
I guess without compensation gps_maxclimb could be set higher.
And maybe just limit compensation during Climbout.(Next test...)

Patrik

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

Airplane Oscillations BaseFlight

Post by PatrikE »

Oscillations Is not related to RTH But planes in general.

MPU feels more sensitive on Baseflight or something.
I get oscillations on my test plane with lpf 42 hz.
With the Arduino i run with 256 hz on the ITG3200.

Or should MPU6050 be that much more sensitive?

Since Gyro smoothing worked but was shooting it in the knee.
I'm thinking Why not shoot it in both knees to perform better on planes!
Copters react fast on Gyro but planes is slow in reaction.
Fast compensations is also harmful for the servos.

And since LPF_10_HZ Is still not good as crashlander says.
What can we do then?
True airspeed would mean a more complex setup.( Mpu + Gps should be enough )
Radical PID tuning?
Increase Cykletime?
Scale down Gyrovalues?

Averaging Gyro works fine on planes to smoothen the outputs.
Maybe averaging outputs instead?

Any Idéas?

Patrik

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

Re: Airplane RTH BaseFlight

Post by Plüschi »

Me no expert but lets brainstorm:

Thy gyro LPF is here to flatten out vibrations. What it does is to slow down the control loop and introduce a delay. A 10HZ LPF will average measurements over 100ms and introduce 50ms delay (about). The SAME effect can be had by drastically lowering the PID P term. PID I and D terms are a function of the P term and need to be adjusted as well.

Another point is the Level PID values for roll and pitch may be very different on a plane.

I did have a notoriously shaky brushed-geared micro-quad where PID was very hard to adjust. Then i read about using ziegler-nichols to calculate PID factors, and i did use that with an AUX channel as input to ziegler-nichols for testing. This was a 328 tarduino and did fly as smooth as silk ever after.

Note FREQ_TU_PR is oscillation frequency of micro quad, might be much lower (and different roll / pich) on plane:

Code: Select all


#define FREQ_TU_PR 3

    #if defined(DIAL_TUNING)
      int ku;
      int kp;
      #if defined(POT_PR)  // aux channel for gyro PID
        ku = ((constrain(rcData[POT_PR],1000,2000) -1000) << 1) >> 6 ; // * 20/640;
        kp = ku * 3 ;
        conf.pid[PIDROLL].P8 = kp;
        conf.pid[PIDROLL].I8 = (kp << 1)/FREQ_TU_PR;
        conf.pid[PIDROLL].D8 = (kp * FREQ_TU_PR) >> 3;
        conf.pid[PIDPITCH].P8 = kp;
        conf.pid[PIDPITCH].I8 = (kp << 1)/FREQ_TU_PR;
        conf.pid[PIDPITCH].D8 = (kp * FREQ_TU_PR) >> 3;
      #endif
      #if defined(POT_L)  // aux channel for level PID
        ku = ((constrain(rcData[POT_L],1000,2000) -1000) << 1) >> 6 ; // * 20/640;
        kp = ku * 4 ;
        conf.pid[PIDLEVEL].P8 = kp;
        conf.pid[PIDLEVEL].I8 = (kp << 1)/FREQ_TU_PR;
      #endif
    #endif


Unluckily im not able to walk and to test fly this myself atm.

User avatar
treym
Posts: 258
Joined: Sat Jul 21, 2012 12:28 am

Re: Airplane RTH BaseFlight

Post by treym »

Image

POS.HOLD will maintain (as best as possible) plane's 3D position by doing figure 8 or circles using cruise throtle.


Image

looks like it work :)

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Airplane RTH BaseFlight

Post by Truglodite »

I'm feeling a bit humbled trying to get this working on my wing (no tail). Looks like flying wing is no longer included as a CLI option (correct?), and I get errors compiling rth_dev. I'm not familiar enough with the environment to decipher what's going wrong with this error, but I have no problems compiling normal baseflight and harakiri for my copters using the same procedure. I was going to look in to editing the mixers for my purposes, but I don't want to start if I can't finish. I copied the error output below.

Code: Select all

Finished building: ../lib/CMSIS/CM3/CoreSupport/core_cm3.c
 
Building target: Baseflight_rth_dev.elf
Invoking: ARM Sourcery Windows GCC C Linker
arm-none-eabi-gcc -T"C:\Users\Kevin\Documents\RC hobby\FPV\baseflight\workspace\Baseflight_rth_dev\stm32_flash.ld" -Xlinker --gc-sections -Wl,-Map,Baseflight_rth_dev.map -mcpu=cortex-m3 -mthumb -o "Baseflight_rth_dev.elf"  ./src/baseflight_startups/startup_stm32f10x_md_gcc.o  ./src/buzzer.o ./src/cli.o ./src/config.o ./src/drv_adc.o ./src/drv_adc_fy90q.o ./src/drv_adxl345.o ./src/drv_bma280.o ./src/drv_bmp085.o ./src/drv_gpio.o ./src/drv_hcsr04.o ./src/drv_hmc5883l.o ./src/drv_i2c.o ./src/drv_i2c_soft.o ./src/drv_l3g4200d.o ./src/drv_ledring.o ./src/drv_mma845x.o ./src/drv_mpu3050.o ./src/drv_mpu6050.o ./src/drv_ms5611.o ./src/drv_pwm.o ./src/drv_pwm_fy90q.o ./src/drv_serial.o ./src/drv_softserial.o ./src/drv_spi.o ./src/drv_system.o ./src/drv_timer.o ./src/drv_uart.o ./src/fw_nav.o ./src/gps.o ./src/imu.o ./src/main.o ./src/mixer.o ./src/mw.o ./src/printf.o ./src/sbus.o ./src/sensors.o ./src/serial.o ./src/spektrum.o ./src/sumd.o ./src/telemetry_common.o ./src/telemetry_frsky.o ./src/telemetry_hott.o ./src/utils.o  ./lib/STM32F10x_StdPeriph_Driver/src/misc.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_adc.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_bkp.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_can.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_cec.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dac.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dbgmcu.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_dma.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_exti.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_flash.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_fsmc.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_gpio.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_i2c.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_iwdg.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_pwr.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rcc.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_rtc.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_sdio.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_spi.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_tim.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_usart.o ./lib/STM32F10x_StdPeriph_Driver/src/stm32f10x_wwdg.o  ./lib/CMSIS/CM3/DeviceSupport/ST/STM32F10x/system_stm32f10x.o  ./lib/CMSIS/CM3/CoreSupport/core_cm3.o   -lm
c:/program files (x86)/codesourcery/sourcery_codebench_lite_for_arm_eabi/bin/../lib/gcc/arm-none-eabi/4.7.3/../../../../arm-none-eabi/lib/thumb2\libc.a(lib_a-sbrkr.o): In function `_sbrk_r':
sbrkr.c:(.text+0x12): undefined reference to `_sbrk'
collect2.exe: error: ld returned 1 exit status
cs-make: *** [Baseflight_rth_dev.elf] Error 1


Can anyone help point me in the right direction to get my AfroMini working on my wing?

Kev

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

Re: Airplane RTH BaseFlight

Post by timecop »

mixer flying_wing works, no?
you shouldn't have to edit anything.
sbrk shit is some gnu garbage, stop using codesourcery and ONLY use gcc-arm-embedded and don't generate makefiles in eclipse, only use provided Makefile

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Airplane RTH BaseFlight

Post by Truglodite »

Showing my newbness here... got it figured out and found the mixer. Thanks again timecop.

Kev

subaru4wd
Posts: 316
Joined: Sat Dec 08, 2012 2:16 am

Re: Airplane RTH BaseFlight

Post by subaru4wd »

Im setting up an AfroMini for my FPV Plane. Im not sure exactly what servo's go where? It is a 3 channel plane, and I assume the motor ESC goes on THR, but i have two servo's for the Ailerons and one for Elevator and i am not sure which S pins to use for which.

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

Im not 100% sure but I think i connected like this.

Code: Select all

6 => Elevator
5 => Rudder
4 => Wing 2
3 => Wing 1
2 => -
1 => ESC

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Airplane RTH BaseFlight

Post by Truglodite »

I have flown my flyingwing to some degree of success with Plane RTH firmware (rate, stab, passthrough fly well). It just needs some more up elevator travel to slow for landing. I started to play in the servo tab and ran in to troubles. I read this post by crashlander about servo setup, but it doesn't elaborate on how to deal with elevon mixing:

http://fpvlab.com/forums/showthread.php ... post493533

I played with the checkboxes and values; they had effects but I couldn't brew up what I need. This plane needs full mechanical up travel, without servos stalling from roll stick or roll gyro input (bigger digital servos too... stall is very bad). Baseflight must have a global servo travel setting, but I don't know where to find it. An example of what I mean by global travel... in OpenAero2 (for KK2), you have one page where you can set travels for each servo so they don't bind no matter what you do with the tuning and rates. Then there's another page on OA2 where the user can adjust pitch/roll rates independently, and of course there are gyro PIDs.

I can find the pitch and roll rates, and of course the PIDs in the GUI, but not the definitive "left wing servo limits" and "right wing servo limits" I was hoping to find. Can baseflight do this? If so, can someone point me to the right settings?

Thanks,
Kev

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

Re: Airplane RTH BaseFlight

Post by PatrikE »

In baseflight you can adjust Rates per axis from CLI Tab.
set fixedwing_rollrate = 0.500
set fixedwing_pitchrate = 0.500
Range 0 - 1.0

And Setting Min & Max in servoTab should set absolute endpoints for each servo.

Truglodite
Posts: 48
Joined: Sat Jun 22, 2013 2:37 am

Re: Airplane RTH BaseFlight

Post by Truglodite »

Thanks PatrickE... to be complete regarding the servoTab Min/Max... I should apply full elevator and aileron on my TX when setting the servo enpoints, correct? Ie... up/right makes R servo go max up, set R servo up... down/left makes R servo go max down, set R servo down... etc repeat using up/left and down/right to set L servo limits... correct? I was kind of hoping my TX wouldn't be required, but I guess if this works then it's good enough.

Kev

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.

Post Reply