Airplane mode RTH

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

choder wrote:So I only need to plug the y harness into either the left or right output from the board. I have tried that and it does not work, the ailerons just move about 20 degrees and lock there and will not respond to input from my tx, but I can see the aileron channel move in the gui. I Will try again later today, it might be possible I am plugging into the wrong output.


I agree with you.

In PatrikE's code, some output pins are moved, after that, all output pins for plane are same with multirotor.(On my multirotor mega board)

If you are using a No-DIY multirotor board, just try all the output pins on your board is OK.

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

fryefryefrye wrote:
choder wrote:So I only need to plug the y harness into either the left or right output from the board. I have tried that and it does not work, the ailerons just move about 20 degrees and lock there and will not respond to input from my tx, but I can see the aileron channel move in the gui. I Will try again later today, it might be possible I am plugging into the wrong output.


I agree with you.

In PatrikE's code, some output pins are moved, after that, all output pins for plane are same with multirotor.(On my multirotor mega board)

If you are using a No-DIY multirotor board, just try all the output pins on your board is OK.



I am using the Hobbyking multiwii pro board here is the link https://www.hobbyking.com/hobbyking/sto ... iwii%20pro

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

PatrikE wrote:Fry is right.
You need 2 outputs only if you want flap function on the ailerons.
But it's easier to trim with separate outputs.


Can I specify the output pin in the code for the ailerons?

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

Re: Airplane mode RTH

Post by PatrikE »

It's possible to remap pins but not without tweaking the code.

with MEGA_HW_PWM_SERVOS enabled will put Ailerons on D11 & D12.
But your Board don't support MEGA_HW_PWM_SERVOS
Comment the line in config.h to use D6 & D7 for ailerons.

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

PatrikE wrote:It's possible to remap pins but not without tweaking the code.

with MEGA_HW_PWM_SERVOS enabled will put Ailerons on D11 & D12.
But your Board don't support MEGA_HW_PWM_SERVOS
Comment the line in config.h to use D6 & D7 for ailerons.


Sorry I am confused on this. I searched the config.h and only found this. So do I change D11 & D12 to d6 and d7? I need some more clarification please.

/********************************** PWM Setup **********************************/
/* activate all 6 hardware PWM outputs Motor 5 = D11 and 6 = D13.
note: not possible on the sparkfun promicro (pin 11 & 13 are not broken out there)
if activated:
Motor 1-6 = 10-bit hardware PWM
Motor 7-8 = 8-bit Software PWM
Servos = 8-bit Software PWM
if deactivated:
Motor 1-4 = 10-bit hardware PWM
Motor 5-8 = 10-bit Software PWM
Servos = 10-bit Software PWM */
//#define HWPWM6

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

Re: Airplane mode RTH

Post by PatrikE »

That part is only for Atmega32u4 Boards.
Check around row 957

Code: Select all

  /***********************             HW PWM Servos             ***********************/ 
    /* HW PWM Servo outputs for Arduino Mega.. moves:
      Pitch   = pin 44
      Roll    = pin 45
      CamTrig = pin 46
      SERVO4  = pin 11 (aileron left for fixed wing or TRI YAW SERVO)
      SERVO5  = pin 12 (aileron right for fixed wing)
      SERVO6  = pin 6   (rudder for fixed wing)
      SERVO7  = pin 7   (elevator for fixed wing)
      SERVO8  = pin 8   (motor for fixed wing)       */

    #define MEGA_HW_PWM_SERVOS

Comment #define MEGA_HW_PWM_SERVOS and outputs should work like this.
Image
Attachments
Servos.png
ServoOutputs without MEGA_HW_PWM_SERVOS
(7.21 KiB) Not downloaded yet

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

Okay this is what it was set at currently

Code: Select all

/***********************             HW PWM Servos             ***********************/ 
    /* HW PWM Servo outputs for Arduino Mega.. moves:
      Pitch   = pin 44
      Roll    = pin 45
      CamTrig = pin 46
      SERVO4  = pin 11 (aileron left for fixed wing or TRI YAW SERVO)
      SERVO5  = pin 12 (aileron right for fixed wing)
      SERVO6  = pin 6   (rudder for fixed wing)
      SERVO7  = pin 7   (elevator for fixed wing)
      SERVO8  = pin 8   (motor for fixed wing)       */

    #define MEGA_HW_PWM_SERVOS
 
    /* HW PWM Servo outputs for 32u4 NanoWii, MicroWii etc. - works with either the variable SERVO_RFR_RATE or
     * one of the 3 fixed servo.refresh.rates *
     * Tested only for heli_120, i.e. 1 motor + 4 servos, moves..
     * motor[0] = motor       = pin  6
     * servo[3] = nick  servo = pin 11
     * servo[4] = left  servo = pin 10
     * servo[5] = yaw   servo = pin  5
     * servo[6]  = right servo= pin  9
     */
    //#define A32U4_4_HW_PWM_SERVOS



So I should comment this line #define MEGA_HW_PWM_SERVOS
to make it //#define MEGA_HW_PWM_SERVOS

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

Re: Airplane mode RTH

Post by PatrikE »

Exactly!...

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

Well I have had good luck so far.

All my servos and throttle are working now.

I have a couple of problems

1. In ARM and in HORIZON mode My rudder keeps turning to the right. If I move the rudder stick on the tx it will make it go back to center but within a few seconds with no rudder input the rudder servo keeps turning to full left slowly all on its own. In passthru the rudder operates perfect.
2. I changed something and now I can't get my plane to ARM. It shows it is armed in the RC Controls Settings tab but in the Flight Deck screen it does not show it is ARMED. I did have it working and had full throttle control but now it seems like it won't arm. See the screen shots

Thank you for the help. I will have this thing in the air soon with your help!

a.jpg


b.jpg

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

I dont know what I did but I have the throttle working again. What happened was I turned my power off on my transmitter to see what would happen. Then turned it back on and then it will not ARM. I have to uncheck the 3 ARM settings, write the changes, then recheck the ARM setting to enable ARM then write the settings again. I am assuming I am doing something wrong.

But I still have the rudder leak to the right problem.

c.jpg

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

Re: Airplane mode RTH

Post by PatrikE »

Set Yaw I = 0.
It will stop the drift.

This is how i set my flightmodes.
Image

Board Must be DisArmed to write settings from GUI.
Attachments
Bxes.png
(5.01 KiB) Not downloaded yet

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

Re: Airplane mode RTH

Post by e_lm_70 »

PatrikE wrote:Set Yaw I = 0.
It will stop the drift.

This is how i set my flightmodes.
Image

Board Must be DisArmed to write settings from GUI.


Ok, I see you like quick & dirt solutions :mrgreen:

You post similar solution with dual rate, now suggestiong I=0 is even more dirty too

I made a code change in this aspect on my mutlwii for airplane.

When throttle is zero, then I slowly wind down the I errors ... so before take off my servo can settle ... then I apply power and the holding mode should kick in

Onky issue is on gliding that I have less holding capability due to the I winding doen .. still way better then your solution above

Code change for this was 1 line of code :ugeek:

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

Re: Airplane mode RTH

Post by PatrikE »

Well actually it's a problem based on the PID calculations.
Actually it's one of the most common beginner questions on the forum!
Motors run with different speed before takeoff!


Since i don't use a rudder models i haven't noticed the problem on my planes!
And when the model fly all I-term calculations will work normal.

I can see in Gui that Yaw wind up slowly,It's almost not noticeable on my FC.
But once i touch the TX sticks it centers back.
I guess it's also a question about Sensor Quality .
Some gyros can have more drift than others.
I guess i'm lucky with mine!

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

PatrikE wrote:Set Yaw I = 0.
It will stop the drift.

This is how i set my flightmodes.
Image

Board Must be DisArmed to write settings from GUI.



So I have set it up your way you have in the picture. Everything works good except when I turn my TX power off. When I turn off the TX power the plane goes into ANGLE + GPS HOME. ARM (Throttle) turns off when the TX power goes off. Then when I turn the TX power back on I have to wait 10 seconds or so and then have to toggle the ARM swith (turn it off and back on) to use the throttle. My concern is, what happens when the plane flies out of TX range? Will the board disarm and stop the throttle without the TX connected to the RX, then the plane would have not motor power to try to return home. Here is a screen shot of the GUI with the TX power turned off.

bb.jpg


ccc.jpg

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

Re: Airplane mode RTH

Post by PatrikE »

choder wrote:When I turn off the TX power the plane goes into ANGLE + GPS HOME. ARM (Throttle) turns off

Thats a perfect description of when Failsafe function that takes over....
When the plane is within 10 meters from HomePosition the plane will disarmed and make a Failsafe "Landing"

It's also a safety function to ensure the motor don't go to Full if you accidentally turn off the transmitter when you stand over it.

If the plane is >10meter from home when it loose radio control it will.
Enable AngleMode + GpsHome.
When the plane returns home in Failsafe Mode, Motor will be DisArmed and the plane will glide down for a landing.

choder
Posts: 17
Joined: Tue Mar 11, 2014 8:26 pm

Re: Airplane mode RTH

Post by choder »

Ah! Thank you! So it appears I am ready to take my first test flight. When the wind stop blowing and I have time I will take it out for a flight.

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

Re: Airplane mode RTH

Post by msev »

PatrikE Afromini 32 is in stock :D

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

Re: Airplane mode RTH

Post by PatrikE »

I have a Naze32 acro on the bench and started looking at.
;-)

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

Re: Airplane mode RTH

Post by crashlander »

PatrikE wrote:I have a Naze32 acro on the bench and started looking at.
;-)


Look fast! ;) (my AIO Pro has some issues)

aydineser
Posts: 8
Joined: Mon Jun 17, 2013 11:54 am

Re: Airplane mode RTH

Post by aydineser »

Hi Patrik,

As I have seen on above posts, you are using a gps emulator. Are you using a flight simulator (xplane etc.)
for Hardware in Loop testing ? Or you just feed GPS data from serial port ?

If there is a way, I want to try HIL testing of your code ?. As I have seen from EOS videos on GPS NAV thread
he has HIL testing capability.

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

Re: Airplane mode RTH

Post by PatrikE »

I only feed GpsData to serialport or I2C Gps unit.
I don't know if EOS simulator function works with the code.

I have merged FixedWing with EOS
Version: MultiWii2_3-navi-b7
With this Eos Gui should work with his simulator SW.
I have only tested it on the bench yet.

It's time to put it in a plane now but i don't have a suitable plane Atm.
My EZ-Hawk is to small in "Cockpit" !
And The RadJet is absolutely to small!
I need to get a plane with better room in!

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

Re: Airplane mode RTH

Post by msev »

PatrikE wrote:I have a Naze32 acro on the bench and started looking at.
;-)


Sweet, looking forward to new developement on 32-bits :D

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

Re: Airplane mode RTH

Post by PatrikE »

msev wrote:
PatrikE wrote:I have a Naze32 acro on the bench and started looking at.
;-)


Sweet, looking forward to new developement on 32-bits :D

If i only could get that F*c*n Eclips configured to work!..... :twisted:

frog32
Posts: 55
Joined: Sun Nov 20, 2011 9:39 pm

Re: Airplane mode RTH

Post by frog32 »

+1 for 32bit :)

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

Hello PatrikE

I have a try on GPS_HOLD and GPS_HOME today.

On the first power on ,the LED of GPS is not flashing, re-power on GPS LED showing 7+ sat is working.

On the first Battery, everything is working fine, GPS_HOLD and GPS_HOME are working well.

But Strange things happened on the next battery, GPS_HOLD is not working after change the battery, GPS_HOME is working fine at the same time.

Use PC to connect the USB showing the AUX is in the right position for GPS_HOLD, but it will not turn to green for unknown reason. Sat = 8 showing on PC. And GPS_HOME can turn to green at the same time with AUX3.

Setting for AUX1 is Pass-through, angle, angle+ GPS_HOLD. Mode between Pass-through, angle can be switched, but GPS_HOLD will not work.

I try change AUX1 to, angle+ GPS_HOLD ;angle; Pass-through, same result . GPS_HOLD will not work.

Reprogram and reset setting will not fix this problem

Any ideas?

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

Re: Airplane mode RTH

Post by PatrikE »

Strange..
Have not seen this before.
I'll look in too it.
Must be some Eeprom setting who block it!
Test to clear Eeprom to see if anything happens as a start.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

PatrikE wrote:Strange..
Have not seen this before.
I'll look in too it.
Must be some Eeprom setting who block it!
Test to clear Eeprom to see if anything happens as a start.


My plane dive into river when I switch off the radio to test the fail back.

Maybe some thing wrong in the radio receiver. Because AUX can let the plane running GPS_HOME very well.

My FC board was completely soak in water.

Now, it is enjoy the sunshine, and I will test it later :|

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

Re: Airplane mode RTH

Post by e_lm_70 »

PatrikE wrote:
msev wrote:
PatrikE wrote:I have a Naze32 acro on the bench and started looking at.
;-)


Sweet, looking forward to new developement on 32-bits :D

If i only could get that F*c*n Eclips configured to work!..... :twisted:


I know the pain ... my Eclipse somehow works for STM32 and Brushless Gimbal controller open source ... but was not easy on my Win8 .. and still not perfect

TimeCop does not use Ecplis ... he uses something else (at least he was) .. and it is just 1 click to install ... and project works easily ... just 2000$ license needed ... or you need a workaround "chinese style"

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

Re: Airplane mode RTH

Post by e_lm_70 »

More then naze32

If you can make it work on AfroMini32 it will be perfect.

You don't need neither an advanced baro nor a mag in the control board for a airplane ... so AfroMini32 is perfect for RTH , mission, for airplane

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

PatrikE wrote:Strange..
Have not seen this before.
I'll look in too it.
Must be some Eeprom setting who block it!
Test to clear Eeprom to see if anything happens as a start.


Reason found.

I used a lot of trim on the radio for elev for the second heavy Battery. That caused the GPS_HOLD can not work.

bigcheese
Posts: 10
Joined: Sat Aug 17, 2013 12:17 am

Re: Airplane mode RTH

Post by bigcheese »

Hi,

Question: what Happens if GPS have a Problem during flight? E.g. No gps at all suddenly or jump in gps coordinates suddenly - is there any logic to come save down then when in returning to home ?

bye
cheese

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

Re: Airplane mode RTH

Post by PatrikE »

If you lose Gps during normal RTH enabled by switch
the plane will keep fly in the level mode you selected.
RTH is simply turned off.

In current release the plane will do normal MWii failsafe.
force Angle mode.
Decrease throttle to minthrottle +200 as set in config.
After 20 sec disarm and descend straight forward in Angle mode.

In next verison i have added a 5 degree banked turn in Angle mode if GPS is lost in failsafe mode.
Will do a descending circle.(if thermal doesn't lifts it!...)

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Airplane mode RTH

Post by Crashpilot1000 »

Hi! Sorry for OT post but I have a question concerning planes. Mine is still sitting on the shelf..
Planes require lift and have a stall speed. Gliders don't need to have the motor running all the time. GPS will not report back the actual airspeed under the wings. So how is an automatic mode supposed to work without that info? I found some info of how to get TAS from the GPS, I wonder how that works. How is that problem tackled here? A baselinethrottle for automatic modes? Short info would be nice.
Cheers
Rob

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

Re: Airplane mode RTH

Post by PatrikE »

If i dont misunderstand completely..
TAS calcs is done by flying predetermined patterns and compare crosstrack error based on Gps direction and compass.
A little too complicated.
Should be simpler to implement a true airspeed gauge.

Todays version uses Altitude error and angle of attack to control throttle.
Min Gps throttle and cruise throttle can be set in the config for GPS.

A minimum ground speed check is made to ensure the plane travels forward and not backwards.
Throttle will be added as a I term to build up speed.

But measured AirSpeed would be the best.

TAS is too complicated for me!
http://www.caa.gov.tw/APFile/big5/files/tas_fnl3.pdf

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

PatrikE wrote:Todays version uses Altitude error and angle of attack to control throttle.
Min Gps throttle and cruise throttle can be set in the config for GPS.

A minimum ground speed check is made to ensure the plane travels forward and not backwards.
Throttle will be added as a I term to build up speed.


I think my plane was more power saving in GPS_HOLD then ANGLE mode :D

User avatar
Crashpilot1000
Posts: 631
Joined: Tue Apr 03, 2012 7:38 pm

Re: Airplane mode RTH

Post by Crashpilot1000 »

Thanks PatrikE and fryefryefrye for the info! Sorry for that question but my last plane experience was 25years ago with a cessna (methanol/nitromethane/oil fuel) and crap 27Mhz RC .. - RIP.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

PatrikE wrote:Todays version uses Altitude error and angle of attack to control throttle.
Min Gps throttle and cruise throttle can be set in the config for GPS.

A minimum ground speed check is made to ensure the plane travels forward and not backwards.
Throttle will be added as a I term to build up speed.


Today, I'm using Sky Surfer X8 with 3S 5000mah, 2212 KV980, 9'Propeller.

77 minutes in the air in GPS_HOLD mode. Your nav code was very impressive.

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

Re: Airplane mode RTH

Post by PatrikE »

Thanks.
I have seen that my batteries lasts long too.
It's just a matter of finding the sweet spot for the cruise throttle setting.
Then it just make compensations to maintain altitude.

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

AW: Airplane mode RTH

Post by Kayle »

Hello to all,

are the servo reactions in rth mode smooth or straight ? Is there any timer used to update the servo value ?

Greetings Kayle

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

Re: Airplane mode RTH

Post by PatrikE »

Gyro/Acc compensation is same as in normal FixedWing mode.
During navigation NavCode is run in 5Hz and make servoUpdate quite smooth.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

@ PatrikE

One small problem:

when plane just cross the destination point, for a moment, it have not made the decision which turn it will make.

It will left, right, left, right, left, right, for few times in 5 seconds.

Finally, the plane make the decision and turn.

===============================================

Do you have any plan to make it circle? It will be much better.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

@ PatrikE

Do you have any plan to use the OSD?

I have Integrated RemzibiOSD support in your nav code and it can be compiled, and I will test it when I got the OSD.

A lot of modify from ino to cpp/h. :-(

http://www.rcgroups.com/forums/showthread.php?t=1899490

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

Re: Airplane mode RTH

Post by PatrikE »

You can try to force it to select way earlier by lowering if (abs(navDiff) > 175) to ex 120.

Code: Select all

/ Wrap Heading 180
      if (navDiff <= - 180) navDiff += 360;
      if (navDiff >= + 180) navDiff -= 360;
      if (abs(navDiff) > 175) navDiff  = 175;          // Force a left turn.


I only have Minim OSD.
RemzibiOSD maybe should be added to MWii separately.

But test it first.

pacoswava
Posts: 6
Joined: Thu Mar 27, 2014 3:56 am

Re: Airplane mode RTH

Post by pacoswava »

Been having an issue with the lastest firmware. For some reason it is just stuck in angle+rth. All my switches show that they are working in the gui, all control is still there, but none of the switches allow me to take it out of rth.

For referrence, I'm using witespy's Pro Mini board with the 6m gps module. His stock fw works and I have full control, but the fixedwing fw doesn't. Any suggestions as to why this would be happening?

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

Re: Airplane mode RTH

Post by PatrikE »

It's probably the Failsafe function that detects unusual values.
ex throttle reaches lower than failsafe threshold (Set to 980µs in config).

Change the ex threshold value in config.h or limit the rates on your transmitter.

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

Re: Airplane mode RTH

Post by i3dm »

Patrik,

can i use the copter method to trim my plane with multiwii airplane?


How to trim your Copter: version 1.7 and more

1. Trim in “acro” = headholding mode:
Calibration is made on each power on, but you can do it manually like before:
Full throttle down + full yaw left + full pitch backward
Just fly in acro mode and trim your copter with the trims on your transmitter.
No need to land, just do it in the air and trim as long as it looks good for you.

2. Trim in “stable” = ACC mode:
1. You have to trim your copter in “acro” mode before.
So your copter is perfectly trimmed in acro mode.
Otherwise you are overmixing trims from acro mode to stable mode and you have to trim stable mode again.

2. You have to calibrate ACC.
Copter must be stable and level at the ground.
Motors disarmed.
Full throttle up + full yaw left + full pitch backward

3. Now start motors and fly in stable mode.
Normally its better to start here as normal in acro mode and switch to stable mode while in the air.
Because if stable mode needs much trim, its easier to fly in acro mode.

Okay, so you are now with stable mode in the air and the copter drifts to the right and backwards.
Switch back to acro (easier to land) and land your copter.
Disarm motors.

4. Now trim the ACC mode.
Don’t touch your trims on the transmitter.
Give full throttle (must be >1900)
With the help of your roll and pitch stick you could now trim the ACC mode.
full PITCH forward/backward and full ROLL left/right (2 axis possibilities) will trim the level mode according to the neutral angle you want to change.
The status LED will blink to confirm each ticks.

So for instance, you have to move the pitch stick full forward about 4-5x.
That means from neutral to full and back to neutral, 4-5 times.
You will here the buzzer each time beep and see the led each time blink, when move full forward.
The same for the roll axis.

After that start your motors and do again 3. until your copter is complete in level in ACC mode.

If you want to reset the ACC trims, just do step 2. (ACC calibration)

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

Re: Airplane mode RTH

Post by PatrikE »

In "Acro"Gyros will eat up some trim errors.
It's better to fly in “PassThru” and trim the plane first
Adjust linkages on the plane until it fly good with zero trims.(In a perfect world..)

Otherwise you can follow your plan ;)

pacoswava
Posts: 6
Joined: Thu Mar 27, 2014 3:56 am

Re: Airplane mode RTH

Post by pacoswava »

PatrikE wrote:It's probably the Failsafe function that detects unusual values.
ex throttle reaches lower than failsafe threshold (Set to 980µs in config).

Change the ex threshold value in config.h or limit the rates on your transmitter.


This is exactly what I needed. Throttle was way low. For some reason the ESC I have starts clear down at 900. I adjusted the threshold a little as well as adjusting some throw in the tx. Arms with no issues now. I also noticed that I had to pull back my elevator throws as well. When I'd pull full elevator it would go into failsafe. This is a scratch built plane, so I'm needing to go back to making mechanical adjustments instead of relying on digital adjustments like I have on standard fixed wings.

Thanks again for your help PatrikE.

fryefryefrye
Posts: 57
Joined: Thu Apr 11, 2013 7:19 am

Re: Airplane mode RTH

Post by fryefryefrye »

Hello PatrikE
I found the plane was active too much when I move the elevator stick. So I reduce the percentage in the radio, But I lost the stick combination function after that.

So, I reset the the radio, and try to do it in the code. Do you think it's OK? May be we need a setting for plane here.


Code: Select all

errorAngle= constrain(rc + GPS_angle[axis],-500,+500) - att.angle[axis] + conf.angleTrim[axis]; 


was changed to :

Code: Select all

     if (axis == PITCH)
     {
     errorAngle= constrain(rc*0.7 + GPS_angle[axis],-500,+500) - att.angle[axis] + conf.angleTrim[axis];
     }
     else
     {
      errorAngle= constrain(rc + GPS_angle[axis],-500,+500) - att.angle[axis] + conf.angleTrim[axis];
     }

denism
Posts: 17
Joined: Fri Feb 21, 2014 7:09 am

Re: Airplane mode RTH

Post by denism »

Patrick, so is it
if (abs(navDiff) > 120) navDiff = 120;
or
if (abs(navDiff) > 120) navDiff = 175;

Flaps ailerons violently on the bench during the test.

PatrikE wrote:You can try to force it to select way earlier by lowering if (abs(navDiff) > 175) to ex 120.

Code: Select all

/ Wrap Heading 180
      if (navDiff <= - 180) navDiff += 360;
      if (navDiff >= + 180) navDiff -= 360;
      if (abs(navDiff) > 175) navDiff  = 175;          // Force a left turn.


I only have Minim OSD.
RemzibiOSD maybe should be added to MWii separately.

But test it first.

Post Reply