Page 4 of 11
Re: Airplane mode
Posted: Sat Mar 24, 2012 5:49 pm
by PatrikE
Re: Airplane mode
Posted: Sat Mar 24, 2012 8:33 pm
by UndCon
Cool - I will add a post on my site as well and link to your blog.
Now back to the Bixler build...motor replaced with a better one.
//UndCon
Re: Airplane mode
Posted: Mon Mar 26, 2012 10:01 am
by Hamburger
PatrikE,
we might consolidate Airplane and FlyingWing in the future? If you wanted the aileron control surfaces to become elevons (aileron + elevon), then we were there.
But I do not understand your mixing code.
FlyingWing uses
Code: Select all
servo[0] = PITCH_DIRECTION_L * axisPID[PITCH] + ROLL_DIRECTION_L * axisPID[ROLL];
that is same as for most models (just not using the PIDMIX macro)
But for Airplane you use some other mix
Code: Select all
servo[3] =(servoMid[3] + (((axisPID[ROLL]) + (angle[ROLL] /16)) *servoreverse[3])); // Right Ail
Now I am curious. Why do you add the absolute angle into the correction term?
Hamburger
Re: Airplane mode
Posted: Mon Mar 26, 2012 11:20 am
by Alexinparis
@PatrikE
I'm merging code.
some remarks:
1) you defined:
Code: Select all
// To prevent motor to start at reset. atomicServo[7]=5 or 249 if reverseed servo
volatile uint8_t atomicServo[8] = {125,125,125,125,125,125,125,5};
this can't happen as the servo pulse is software generated => no signal during the reset step. => I suppress it
2) I set MOTOR_NUMBER to 0 (do we really need to handle ESCs at 490Hz in a plane ?)
3) I remove things like USE ALL SERVO and use the convention based on: PRI_SERVO_FROM and PRI_SERVO_TO
4) I move plane servo definition from Multiwii.pde to Output.pde (the place where it should be)
Re: Airplane mode
Posted: Mon Mar 26, 2012 2:53 pm
by PatrikE
Hamburger wrote:Why do you add the absolute angle into the correction term?
Your'e right it should work without Asolute angle.
I'll test in the evening.
It would make a easier mix to.
/Patrik
Re: Airplane mode
Posted: Mon Mar 26, 2012 3:02 pm
by PatrikE
Hi Alex,
Alexinparis wrote:1) you defined:
CODE: SELECT ALL
// To prevent motor to start at reset. atomicServo[7]=5 or 249 if reverseed servo
volatile uint8_t atomicServo[8] = {125,125,125,125,125,125,125,5};
this can't happen as the servo pulse is software generated => no signal during the reset step. => I suppress it
2) I set MOTOR_NUMBER to 0 (do we really need to handle ESCs at 490Hz in a plane ?)
3) I remove things like USE ALL SERVO and use the convention based on: PRI_SERVO_FROM and PRI_SERVO_TO
4) I move plane servo definition from Multiwii.pde to Output.pde (the place where it should be)
1: The problem isn't the reset but the Boot when it will set Half trottle... (Can be scary... I have tested it!)
2: Just a theory i had.....
3: Another Theory i wasnt really plased with.
4: Check the last update i made to day in my branch to day.
I have changed the servo definitions in it already and added the settings to Config.h.
I will also do some rework on the mix as Hamburger made a remark on.
And adust the Howto acording to the new servo definitions.
Happy Coding...
/ Patrik
Re: Airplane mode
Posted: Mon Mar 26, 2012 4:23 pm
by PatrikE
I have removed the absolute angle from the mix.
It can explain some problems i had to trim Level mode.
The HowTo is updated.
http://fotoflygarn.blogspot.se/2012/03/ ... -same.htmlwe might consolidate Airplane and FlyingWing in the future? If you wanted the aileron control surfaces to become elevons (aileron + elevon).
Yes and also Flapperons.. (aileron + flaps)
/Patrik
Re: Airplane mode
Posted: Thu Mar 29, 2012 3:44 pm
by Exyator
Hi all,
I'd like to try airplane mode on my FPV Skywalker. I have the cheapo HK-T6A radio from Hobbyking and i ruined my programming cable, so I'm not able to reverse any channels...
Is it possible to reverse the ELE channel in the multiwii code (without changing the gyro direction)?
Thanks in advance,
Exyator
Re: Airplane mode
Posted: Thu Mar 29, 2012 6:29 pm
by PatrikE
It's possible to do...
Rotate the gyro 180 degrees..
CW or CCW( Do Not flip it over... )
It will reverse the Elev.
It will also reverse the ailerions..
If you didn't change the servosettings for reversing.
servo[3] is the same as servo[4] but inverted inverted.
Code: Select all
#define SERVO_DIRECTION { 1, 1, 1, -1, 1, 1, 1, 1 } // Invert servos by setting -1
Code: Select all
servo[3] =(servoMid[3] + (axisPID[ROLL] * servoreverse[3])); // Wing 1
servo[4] =(servoMid[4] + (axisPID[ROLL] * servoreverse[4])); // Wing 2
servo[5] =(servoMid[5] + (axisPID[YAW] * servoreverse[5])); // Rudder
servo[6] =(servoMid[6] + (axisPID[PITCH] * servoreverse[6])); // Elevator
Then you can move the wingservo to the other wingchannel.
If you use both channels just swap Left and Riht.
Change ditrections in TX To match.
Worth a try...
Otherwise you must get a new cable....
God luck.
/Patrik
Re: Airplane mode
Posted: Wed Apr 18, 2012 8:10 pm
by PatrikE
The AriplaneMode is updated with a flapperon function.
Download From Branch.Updated HowTo Guide./Patrik
Re: Airplane mode
Posted: Sat May 12, 2012 9:17 pm
by msev
When talking about the GPS RTH, we have to take into account the accuracy of gps,...so how much meters is the gps inaccuracy concerning altitude? Its within 20m right.. Will the plane fluctuate in altitude or will the altitude somewhat be smoothed out, I don't know how much the gps altitude value fluctuates...
For a plane magneto and baro aren't strickly needed right?
Patrik you are working on plane rth right, thanks for your work! hope eosbandi will also help with the development...Will it also be like a pid loop style controller?
I asked this in the following thread but didn't get a response so I'll ask here again: "I'm planning to buy a Mega board, which has I think 3 serial ports, can I use multiple serial ports at once? For example I would use one to connect my serial gps, another to connect the osd to arduino and the third one to connect a bluetooth module?"
Thank you guys for all the nice work you are doing! Its great! Really mind-blowing!
Re: Airplane mode
Posted: Sun May 13, 2012 7:38 pm
by PatrikE
The plans for the day was testing Gps on the plane....
But it's way to windy to test new features...
A small update instead...
The navigating will be possible using.
Gyro,Acc & Gps.Mag is optional and the heading data can be used from it.
Baro Will not be handled.
I'm also making it possible to use
GPS_SERIAL on a Pro Mini.
The Gui It will be disabled when Gps is used.
//#define GPS_PROMINI // Will disable Gui!.....
Fly to target:Find shortest way to the target.
Altitude:The accuracy of GpsAltitude is a issue.
The plan is to try to stay within 5meters.
Cruise controll:Try to keep a preset speed and compensate for altiudeCahnges.
A windspeed guage would be better to use than Gps.
I have everyting under controll on the testbench.
Time to se what reality say...
![Surprised :o](./images/smilies/icon_e_surprised.gif)
There's probably lots of tuning to do and.....
Just to se when the weather gets better. (Forecasts don't look promising!)
I feel the need of a RC-Car for testing right now..
![Wink ;)](./images/smilies/icon_e_wink.gif)
( Autonomous MWii RC-Car... )
/Patrik
Re: Airplane mode
Posted: Sun May 13, 2012 8:53 pm
by msev
Great! Hope you have a "hat cam" so yoi can make a video of the testing
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Re: Airplane mode
Posted: Thu May 17, 2012 7:51 pm
by msev
Will you make baudrate and refresh-rate for gps selectable? Which will be the default settings? I ask this because I have an arduino lm1881 based osd and it will share gps with multiwii board...
Re: Airplane mode
Posted: Thu May 17, 2012 9:42 pm
by PatrikE
Only thing i will preset is the serial port if ProMini is selected.
Baudrate is a setting.
I make no changes in gps reading.
For some of the functions it will be update rate to smoothen things a bit.
Otherwise it will read data from gps as it comes.
I have done some test and it do return home now....
![Smile :-)](./images/smilies/icon_e_smile.gif)
Its some tuning left to do.
Re: Airplane mode
Posted: Fri May 18, 2012 5:51 am
by Kayle
I have done some test and it do return home now....
![Smile :-)](./images/smilies/icon_e_smile.gif)
That´s awesome. For the "Final Version", do you plan to add "auto circling at home" ?
Kayle
Re: Airplane mode
Posted: Fri May 18, 2012 7:40 am
by frog32
Does it navigate rudder only? Or do you bank the plane? I'm just thinking about flying wings.
Marc
Re: Airplane mode
Posted: Fri May 18, 2012 8:35 am
by PatrikE
Current state.
Really simple navigation aim at home pass home aim again untill someome say else or battery run flat...
Basicly fly in loops around homepos.( In theory a flat eight. )
I do the tests with a plane without rudder.
So yes there is a setting to select rudder or ailerions for navigation..
Both plane and flying wing will work with this.
Its a
Fixed Wing Nav
Re: Airplane mode
Posted: Fri May 18, 2012 11:06 am
by Kayle
VOTE for Video
![Smile :-)](./images/smilies/icon_e_smile.gif)
Kayle
Re: Airplane mode
Posted: Fri May 18, 2012 12:29 pm
by PatrikE
Kayle wrote:VOTE for Video
![Smile :-)](./images/smilies/icon_e_smile.gif)
Kayle
Maby to night...
![Wink ;)](./images/smilies/icon_e_wink.gif)
Re: Airplane mode
Posted: Sat May 19, 2012 10:51 pm
by PatrikE
Sorry no video.
I tried but it was no god.
A plane flying cirkels 100m up for 10 minutes is no fun.
But I uploaded a Beta in the resp instead.
Download FixedWing_Gps_B1.rarThere's 3 functions.
RTH.
Position hold.
Auto speed controll.
Settings in Gui.
GPS. P = Amplifier of direction error
I = Set altitude to return to in Km over homePos
D = Limit maximum banking.
Level mode Must be enabled together with gpsmode.
---------------------------------------------
ALTP = Amplifies altitude correction.
---------------------------------------------
Use
CheckBox BARO to enable automatic cruiseControll
On a separate switch or combined with RTH.
VEL Handles speed
P = Delay throttle compenstion.
D = CruiceSpeed to hold.
---------------------------------------------
Setings to change in config.h
Code: Select all
#define MINTHROTTLE 1000 // For FixedWing To stop motor in Armed mode.
#define MAXTHROTTLE 2000 // To reach full throttle
#define MINCOMMAND 1000 // For FixedWing To stop motor.
#define CRUISE_THROTTLE {1200,1800} // Limit Min & Max throttle for Automatic cruise controll.
#define GPS_DIRECTION { -1, 1, 1} /* Set zero to disable invert with -1. */
And I added support for Gps with ProMini.
Code: Select all
//#define GPS_PROMINI_SERIAL 56700 // Overides everything on serial(0)on ProMini!... Will disable all Gui functions!.....
Enable and set baudrate.
Hope You guys try it..
But i warn you....
It's the most boring plane iw'e ever flown..
Speaking with my neighbur and the hands in my pockets for 10 minutes looking in the air.
/Patrik
Re: Airplane mode
Posted: Sat May 19, 2012 11:42 pm
by frog32
Sounds great for a safety return to home on a fpv plane. What's the needed setup? gyro, accelerometer, gps? or do we need something else?
My flying wing isn't finished and then i need to port this to stm32 because it's what will drive my plane.
Marc
Re: Airplane mode
Posted: Sun May 20, 2012 6:35 am
by PatrikE
The bare minimum to fly with Gps is.
Gyro, Accelerometer & Gps.
The system must be able to fly the plane in level.
The Gps only handles the navigation.
If GpsFix is lost the system fall back to level flight.
Atm it will contiue to where the nose points...
Should be Cirkle around untill new GpsFix.
A mag will be used if it's in the system to.
Baro is not handled.
When the Beta is tested and verified..
Some idés on other functions for Fpv could be god to add..
Geofence.. Max range from home ex. 500m
MinAlt.. Lowest altitude allowed in FpvMode
Bail out.. Climb fast to to rth alt before rth.
Scout.. Hold altitude and cruiseSpeed automaticly and just fly around using rudder.
AutoFlaps.. Automatic flaps based on speed and the need to gain altitude.
Re: Airplane mode
Posted: Sun May 20, 2012 8:45 am
by Kayle
Hi Patrik,
Thanks for the beta. I will test it with a diy imu itg3205, adxl345 and a flytron gps modul + arduino pro mini. I see i don't have to use i2c gps ? I can use serial gps instead of the gui?
Kayle
Re: Airplane mode
Posted: Sun May 20, 2012 9:11 am
by PatrikE
Kayle wrote:Hi Patrik,
Thanks for the beta. I will test it with a diy imu itg3205, adxl345 and a flytron gps modul + arduino pro mini. I see i don't have to use i2c gps ? I can use serial gps instead of the gui?
Kayle
Correct. ProMini with Gps on serial.
BUTYou will loose possibility to debug with Gui..
But i have done all testing usuing.
#define GPS_PROMINI_SERIALAnd lots of trial & error..
To change settings in gui.
1: Comment
#define GPS_PROMINI_SERIAL2: Upload
3: Make changes in gui
4: Uncomment
5: Upload and test...
Not optimal but it's a QuickFix
Re: Airplane mode
Posted: Sun May 20, 2012 9:32 am
by msev
Awesome man! Which gps do you use Patrik? And at what baud and refresh rate?
I'm thinking for Bail out, if plane would be above that altitude it should maintain that higher altitude not go on that set altitude, there should be an exception made.
Next stop, waypoints hehe
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Patrik I have a hipotetical question for you, maybe you could test it out...If you just use only leveling (without gps) and cut the throttle to zero, will accelerometer maintain the plane level till it touches the ground, or will it bank because it stalls?
Re: Airplane mode
Posted: Sun May 20, 2012 9:44 am
by Kayle
@patrik
Ok, but i can use also i2c and use at the same time gui?
Kayle
Re: Airplane mode
Posted: Sun May 20, 2012 10:04 am
by PatrikE
@Kayle
Short anwer..
YES!...
Re: Airplane mode
Posted: Sun May 20, 2012 10:21 am
by Kayle
Thanks
Kayle
Re: Airplane mode
Posted: Sun May 20, 2012 10:26 am
by PatrikE
@msev
I use
This module 5hz @ 56700baud
I think EosBandi have waypoints in his new gps code?..
It´s just to adapt it.
If i cut throttle in level mode my plane keep level on the wings.
When speed drops it sinks slowly.
Probobly untill it lands somewhere.
If you have problem with stall you can set some accTrim to keep speed up. ( depends on model )
But often theres some upwinds and it can soar for a looong time.
My idé about Bail out was if youre close to the groud and lost video!.
Re: Airplane mode
Posted: Sun May 20, 2012 10:36 am
by Kayle
Litte OT question:
I have an osd gps. Can i use the same gps ( only tx line from the gps ) for rth function? Or do i need a seperate gps ?
Kayle
Re: Airplane mode
Posted: Sun May 20, 2012 10:47 am
by PatrikE
My code only uses the generic Gps data already in MWii.
If you can connect the tx line from the gps to the promini it should work?!...
Only one way to find out...
When you have GpsFix The status LED will blink rapidly when motor is NOT ARMED.
Re: Airplane mode
Posted: Sun May 20, 2012 3:43 pm
by PatrikE
And Remember....
PassThru will always override everything and abort.
Re: Airplane mode
Posted: Sun May 20, 2012 8:00 pm
by Kayle
Ok. Can i use sumppm for plane mode and passthru?
Kayle
Re: Airplane mode
Posted: Sun May 20, 2012 8:06 pm
by PatrikE
If you have a free AUX channel you should set passthru.
I use ppm with 8ch and setup my 3way switch
low= passthru, mid= gyro, hi= acc.
I had some problem with the height controll today I must take a better look on that part.
![Crying or Very Sad :cry:](./images/smilies/icon_cry.gif)
Re: Airplane mode
Posted: Mon May 21, 2012 2:26 pm
by frog32
On which version did you build your code? i tried to diff your code and MultiWii_dev_20120504. I found quite a lot of changes.
Re: Airplane mode
Posted: Mon May 21, 2012 2:46 pm
by PatrikE
It's based on Mwii_shared in trunk.
Re: Airplane mode
Posted: Tue May 22, 2012 3:42 pm
by didlawowo69
do you know when release airplane will be integrated in main release of MW ? in 2.1 ?
Re: Airplane mode
Posted: Tue May 22, 2012 5:03 pm
by PatrikE
The airplane is included in MultiWii_dev release in download area.
downloads
Re: Airplane mode
Posted: Fri May 25, 2012 3:43 pm
by Point65
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
A short video after today's test with my Pitts Python using Multiwii in Airplane mode. It's on rails!!
Thanks to all that made this possible.
/Bo
http://youtu.be/pyeUEpfZmhM (Select HD)
Re: Airplane mode
Posted: Fri May 25, 2012 4:08 pm
by Hamburger
Bo,
- size of plane,
- sensors,
- settings
please?
Re: Airplane mode
Posted: Fri May 25, 2012 4:44 pm
by PatrikE
You can really se the gyro working with the elevator..
/ PatrikE
Re: Airplane mode
Posted: Fri May 25, 2012 10:34 pm
by Point65
Hamburger wrote:Bo,
- size of plane,
- sensors,
- settings
please?
Hi,
It's about 1000-1100mm wingspan and I used my Multiwii controller from a quad. Original WMP with P=2. No ACC.
I have some vibrations causing the excessive elevator movements in the video at full trottle. So maybe 1,5 or
some smoothing whould limit the movments. From the ground the plane feels rock solid.
I use the early code that was based on 1.9 (still have some upgrade & testing to do.....)
/Bo
Re: Airplane mode
Posted: Fri May 25, 2012 10:44 pm
by Hamburger
You can set pid.attenuation in gui to 0.5 to lessen gyro noise effect for throttle above 50%
Re: Airplane mode
Posted: Tue May 29, 2012 6:03 pm
by frog32
Any chance getting the fixed wing navigation so use separate variables in gui not using some unused ones? I don't have a flying plane right now so i can't help testing until my flying wing is completed.
Re: Airplane mode
Posted: Thu May 31, 2012 7:57 pm
by krzysztof21
Hello,
The airplane is included in MultiWii_dev release in download area.
dev_20120528
Is there a mistake in recognizing WMP + NC. In version 2.0 works fine but there is no choice for WMP + NC.
While defining dev_20120528 added to WMP and NC, and now soft does not correctly detect this configuration.
What a pity
![Sad :(](./images/smilies/icon_e_sad.gif)
there is Airplane mode
Re: Airplane mode
Posted: Thu May 31, 2012 8:58 pm
by frog32
Yes airplane mode is included but not fixed wing navigation.
Re: Airplane mode
Posted: Thu May 31, 2012 9:43 pm
by PatrikE
In the newest Dev wmp and nb is not default.
They must be defined as any other sensors.
It saves some memory if other sensors is used
Re: Airplane mode
Posted: Thu May 31, 2012 9:52 pm
by Kayle
Yes airplane mode is included but not fixed wing navigation.
Only Airplaye Mode is included ? So i can´t use my Wing with GPS and RTH ?
Kayle
Re: Airplane mode
Posted: Thu May 31, 2012 10:42 pm
by rbirdie001
Hi Guys,
maybe not exactly the right thread but this one seems to live and my question is quite related...
![Wink ;)](./images/smilies/icon_e_wink.gif)
I just added MultiWii stabilization to my flying wing (1,2m wingspan, 800g) and it works almost perfectly but...
I use 1.9 because I had only Arduino168 in the drawer and this is the last one which fits to arduino168, but I don't know if there is significant diff between 1.9 and current version in flying wing code. Only WMP clone, no NK. Firstly I tried P=2, I=0.010 and D=3. In passtrough mode worked normally and I mechanically trimmed plane to have plane well trimmed at AIL+ELE sticks about 1500. When I activated stabilization, plane started roll left and pitch up, I had to set 8 trim beeps to right and 3 down to correct it. Then stabilization worked almost fine. As sometimes tended to oscillate, I reduced to P=0 and because I suspected "I" windup to make it outtrim, I also reduced I=0. Behaviour improved but even with I=0 I still have to trim at least 5 beeps after passtrough/gyro change to keep plane straight. On the GUI there are all GYRO values 0 when the plane isn't moving.
Does anyone noticed this? Any ideas how to correct it? Are there improvements between 1.9 and current dev. version in flying wing mode? (My arduino 328 is on the way
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
)
Thanks!
Roman
Edit: I just again played with it on the table using GUI and found that this difference have something to do with trims. When AIL+ELE sticks are really centered at 1500 and no trim is aplied (but this is unreal, because foam plane is NEVER 100% trimmed with all trims at "0") this jump at switchover is really small. Even more interesting that when I applied PITCH trim and got ROLL error.
![Question :?:](./images/smilies/icon_question.gif)
So another questions: Does anyone understand and can "deadband" help there?