HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Jan 05, 2012, 05:36 PM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
Discussion
OpenAero open-source stabilisation software for KK boards

UPDATE: V1.14.2 files to fix Hybrid PWM now released. These replace the V1.14.1 files for Hybrid PWM mode only.
You can now find the files on the OpenAero Google Code page

UPDATE: Please read the OpenAero User Guide for everything you ever wanted to know

Introduction
OpenAero is an open source aeroplane stabilising software for KK-type boards. It has all the features commonly requested, an LCD menu and even the MultiWii GUI interface. It's now released as V1.14. For those interested in the code, you can see it at the following .repo.

https://nextcopterplus.googlecode.co...trunk/OpenAero

GUI
Have made a new GUI version similar to that of the NeXtcopter project but with proper aeroplane mode and all the copter stuff removed.
In non-stabilised mode the board just passes the RC values through to the servos and in stability mode the board uses the gyros to dampen any unwanted rotation. Autolevel mode will direct the model back to whatever level position you set up when the accelerometer is calibrated, and trimmed on the field via the LCD or GUI.
For conventional PWM receivers (via four cables) I have updated the code so that you are able to select Autolevel mode and/or Stability mode via the former throttle input. The default is for that channel to just switch stability on and off with Autolevel disabled, but you can configure the switch via either power-on stick positions or LCD to also switch in Autolevel as well and/or leave stability on permanently if desired.

Here's a shot of the new V0.2 GUI for the OpenAero. This example shows a model in Flaperon mode (two stabilised servos per wing).


Features
Depending on what type of KK board, and which add-ons you have fitted to them, these are the available features.

- Support for Standard, Flying Wing and Flaperon-equipped models
- Auto arming
- Switchable stability mode
- LCD support for setting flight parameters
- GUI for setting parameters and visualising sensors and stability
- LCD Menu selectable features
P + I gain
LVA voltage *
LVA alarm mode *
Battery voltage readout
Stick centering
Gyro reversing
Servo reversing
Stability switch function
Autolevel switch function
- Lost model alarm*
- In CPPM mode the throttle signal is decoded and passed back out via the THR pin to be connected to an ESC + motor
- Vertical board orientation compile option
- Flying Wing mode
- Stick centering on power-up via Yaw pot
- Adjustable gain via pots or LCD based on a preset - defaults to pots
Roll pot will adjust Roll and Pitch gain (P-term)
Pitch pot will adjust Roll and Pitch I-term
Yaw pot will adjust Yaw gain (P-term) I-term adjustable via LCD or GUI
- Gyro direction can be reversed by setting the Roll pot to zero and using the TX sticks
- Support for CPPM receivers
- Switchable auto-level mode
- Additional Menu selectable features
Accelerometer pitch and roll trim
Autolevel Gyro and Acc P + I gain
Accelerometer calibration
* Needs KK+ board
Connection diagram - PWM Aeroplane V1.14


Connection diagram - CPPM Aeroplane V1.14


Connection diagram - HHybrid PWM Aeroplane V1.14


Connection diagram - N6 CPPM Aeroplane V1.13


Connection diagram - N6 Aeroplane V1.13


Connection diagram - N6 FlaperonV1.13


Videos
fpvguy's test of the new HYBRID PWM mode which allows full five-channel flaperon control with a standard PWM receiver.
Hobbyzone Super Cub with OpenAero (2 min 41 sec)


This is mrfliboy's test flight of the V1.10 beta firmware
Kk board x5 stabilization test (1 min 27 sec)


Here's a video I found on YouTube on a guy using V1.11 on a Bixler.
Skysurfer (Bixler) with the Hobbyking KK V2.1 Board Test Flight (5 min 42 sec)


A really cool video from Brazil showing a model battling strong wind
3 AXIS GYROS ON AIRPLANE - KK OPENAERO AIRPLANE.wmv (3 min 52 sec)


Here's a video that NDw made of his first flight of the code:
kk board OpenAero (1 min 40 sec)


Here's a great video of eyeinsky1 flying his FPV model in aeroplane mode
HK EPP FPV KK OpenAero Test Flight.mov (8 min 25 sec)


Here's a quick look at the LCD menu and GUI
OpenAero LCD and GUI demonstration (3 min 33 sec)


Code change log

V1.14.2
Updates:
- Bugfix for jitter in Hybrid PWM mode.

V1.14.1
Updates:
- Bugfix for stability switch and flaperons in V1.14. Oops.

Files
You can now find the files on the OpenAero Google Code page.

Your Support
OpenAero is a open-source project and is free, however it is also the result of many hundreds of hours of hard work.
If you feel motivated to donate to the project please feel free. I'm always happy to make special versions for people.

HappySundays is offline Find More Posts by HappySundays
Last edited by HappySundays; Sep 29, 2012 at 05:30 PM. Reason: Added info about V1.14.2, updated wiring diagrams
Reply With Quote
Sign up now
to remove ads between posts
Old Jan 05, 2012, 05:37 PM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
OpenAero Nano Test Release!
After numerous requests, I have made a tiny version of OpenAero for Atmel Atmega48-based KK boards.

I managed to pack in the most necessary features and had to remove many others. There is no LCD or GUI support and there is only basic gyro feedback without any PID calculations.

Gyro reversing and Stick centering work similar to before, and I have added new kind of servo reversing which I will explain below. There is still also the switchable stability mode via the throttle input.

Features
- Auto arming
- Switchable stability mode
- Stick centering on power-up via Yaw pot (set to more than 95%)
- Servo reversing on power-up via Yaw pot (set to less than 5%)
- Gyro reversing on power-up via Roll pot (set to less than 5%)
- Adjustable gain via pots
Roll pot will adjust Roll gain
Pitch pot will adjust Pitch gain
Yaw pot will adjust Yaw gain

Servo connections
Aeroplane mode:
M1: Rudder (Reversible)
M2: Reversed rudder
M3: Aileron (Reversible)
M4: Reversed aileron
M5: Elevator (Reversible)
M6: Reversed elevator

Flying Wing mode:
M1: Rudder (Reversible)
M2: Reversed rudder
M3: Left flaperon (Reversible)
M4: Reversed left flaperon
M5: Right flaperon (Reversible)
M6: Reversed right flaperon

The new servo reversing works differently than before. I realised that simply reversing the servo travel is the same as swapping from the normal to reversed output (e.g. M1 to M2) which was kind of pointless. So now you can reverse one half of each channel. This means you can have each pair operate in parallel or the complement of each other. If you need them to operate together but reversed, you can just reversed them on the transmitter.
I shudder to think of what that means for Flying Wings, but trust me, its more useful than it was before

The attached .zip file contains for binaries. I have only tested the non-CPPM Standard version, so use with caution

OAN_m48_STD.hex <-- Standard aeroplane, non-CPPM
OAN_m48_FW.hex <-- Flying Wing, non-CPPM
OAN_m48_STD_CPPM.hex <-- Standard aeroplane, CPPM
OAN_m48_FW_CPPM.hex <-- Flying Wing, CPPM
HappySundays is offline Find More Posts by HappySundays
Last edited by HappySundays; Jan 28, 2012 at 08:25 PM.
Reply With Quote
Old Jan 05, 2012, 05:43 PM
Plane and multirotor's - FPV
DrEvil's Avatar
Moss, Norway
Joined Jun 2007
856 Posts
I'm a follower

KKai
DrEvil is offline Find More Posts by DrEvil
Reply With Quote
Old Jan 05, 2012, 07:25 PM
Registered User
eyeinsky1's Avatar
Halifax NS Canada
Joined Apr 2009
1,486 Posts
Me too
eyeinsky1 is offline Find More Posts by eyeinsky1
Reply With Quote
Old Jan 05, 2012, 07:30 PM
Registered User
bamabaxter's Avatar
United States, MS, Clinton
Joined Apr 2010
401 Posts
x2...this will be great for my fpv setup
bamabaxter is offline Find More Posts by bamabaxter
Reply With Quote
Old Jan 05, 2012, 09:23 PM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
Quote:
Originally Posted by eyeinsky1 View Post
I'm back home! now the fun begins,

I have one question; Will I still be able to use vertical mounted board with no accelerometer or did see some thing about the yaw values (my pitch) are different?
If so I will acomidate, as required.
Happysunday thanks for all the hard work.
Cheers Jerry
Sorry I copied this from the old thread.
As you use it in "Aeroplane mode" you should still be able to make it work vertically as you have been.
Right now I am making a compile option for "Vertical mode" so that you can leave all the cables in the usual place. It will just swap around the gyros for you. I think it's marginally worth it just to simplify the documentation
I've also just added gyro reversal selection from the LCD menu to put a nail in any possible future configuration issues.
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Old Jan 05, 2012, 09:55 PM
Registered User
bamabaxter's Avatar
United States, MS, Clinton
Joined Apr 2010
401 Posts
I think you may have said it earlier, but did you lower the refresh rate on the servos? I also see that in CPPM mode you can "arm" or "disarm" the stabilization etc. Do you think this ability to turn off the stabilization will be available for regular Rx units? Maybe that is what it means and I could be making an idiot of myself.....wouldn't be the first time.
bamabaxter is offline Find More Posts by bamabaxter
Reply With Quote
Old Jan 05, 2012, 11:25 PM
Registered User
eyeinsky1's Avatar
Halifax NS Canada
Joined Apr 2009
1,486 Posts
Quote:
Originally Posted by HappySundays View Post
Sorry I copied this from the old thread.
As you use it in "Aeroplane mode" you should still be able to make it work vertically as you have been.
Right now I am making a compile option for "Vertical mode" so that you can leave all the cables in the usual place. It will just swap around the gyros for you. I think it's marginally worth it just to simplify the documentation
I've also just added gyro reversal selection from the LCD menu to put a nail in any possible future configuration issues.
Just loaded it and it is working great just the default setting though. I cannot get the GUI to work the cycle rate is very high and the GUI freezes but it appear to write to the board and reads values. The P values adjustment doesn’t seem to have any rate changes though. I got no problem giving it a go, some of the gyro rate levels may be little low but certainly is flyable.

Cheers Jerry
eyeinsky1 is offline Find More Posts by eyeinsky1
Reply With Quote
Old Jan 05, 2012, 11:34 PM
Air Crash Expert
sawman's Avatar
Louisiana
Joined Oct 2005
1,207 Posts
I'm in too.
I do have a question though. In the event of failure, are the signals passed through? The reason I ask, is past experience with rate gyro failures locks the control surface. I had two failures on a flying wing but was able to land with just one elevon working.
sawman is offline Find More Posts by sawman
Reply With Quote
Old Jan 06, 2012, 12:17 AM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
Quote:
Originally Posted by bamabaxter View Post
I think you may have said it earlier, but did you lower the refresh rate on the servos? I also see that in CPPM mode you can "arm" or "disarm" the stabilization etc. Do you think this ability to turn off the stabilization will be available for regular Rx units? Maybe that is what it means and I could be making an idiot of myself.....wouldn't be the first time.
Yep, servo rate is now standard analog servo speed of 50Hz. As such, I discovered that I can do some tricks and have very stable servo output. Seems to work well.
The only way to do it with a "regular" RX would be to use an existing channel. The throttle is usually used for the motor in all but gliders. Some flying wings have no rudder, but it's hardly something you could hope for for all models.
Unfortunately the KK has only four inputs. I like to keep the throttle connected to the board as it acts as in interlock to stop things like GUI or LCD mode somehow activating during flight.
With CPPM you have 8 channels ready to play with. And RX's are pretty cheap
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Old Jan 06, 2012, 12:21 AM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
Quote:
Originally Posted by eyeinsky1 View Post
Just loaded it and it is working great just the default setting though. I cannot get the GUI to work the cycle rate is very high and the GUI freezes but it appear to write to the board and reads values. The P values adjustment doesn’t seem to have any rate changes though. I got no problem giving it a go, some of the gyro rate levels may be little low but certainly is flyable.

Cheers Jerry
Hi Jerry,
The GUI is Java based and *extremely* CPU hungry. You must have nothing else running and a fairly grunty CPU for it to run smoothly. That's out of my control unfortunately. It should run very smoothly under the right conditions. You can see a few videos of it on the NeXtcopter thread.
The values all change... just click on them and drag the mouse left or right.

Also, remember that you can use the pots to up the gyro rate as they have priority unless you switch them off via the LCD. When I tried it last night I found the gyros quite exessive at anything more than the middle pot setting.

@Everyone

I'd love it if people (particularly with flying wings) could tell me how they find the gyro polarity.
I hope to release V1.06 tonight with the reversible gyros, corrected Flying Wing mixing and a few other things.
I do have a delta slope soarer I wil try it on myself also. Thanks!

Update:

Oh boy - the flying wing mixing is indeed totally screwed up lol I have it connected to my flying wing slope model and it's just...wrong.
Will be fixed very soon
HappySundays is offline Find More Posts by HappySundays
Last edited by HappySundays; Jan 06, 2012 at 01:48 AM.
Reply With Quote
Old Jan 06, 2012, 12:23 AM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
Quote:
Originally Posted by sawman View Post
I'm in too.
I do have a question though. In the event of failure, are the signals passed through? The reason I ask, is past experience with rate gyro failures locks the control surface. I had two failures on a flying wing but was able to land with just one elevon working.
OK, you'll have to define "failure" for me to answer. Currently the software believes the gyros. If for some reason one goes hard to one extreme, well, that will suck on the basic version because you can't even switch it off.
On the advanced one you can just switch off the stability control and the signals are passed through.
If the KK board fails it's game over regardless.
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Old Jan 06, 2012, 02:41 AM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
Code updated to V1.06a - Should be almost right now
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Old Jan 06, 2012, 07:33 AM
NDw
Registered User
Ireland, Limerick, Kilmallock
Joined Aug 2010
2,123 Posts
Quoting from the other thread

Quote:
Originally Posted by HappySundays View Post
You can just reverse that channel on your TX to sort that out. On my TX, being JR I often have to reverse channels for certain things to work out.
In V1.05, I didn't change any of the RC polarity, so if the Flaperons were doing the right thing then, they should be now. And, if they were not doing the right thing, I could have fixed that in V1.05... Only thing I changed was how the gyros interact with them.
You (and everyone) should go through this setup procedure so as to not get confused.

For Flying Wings Only
1. Put the KK PCB in the correct orientation with the arrow facing forwards. No exceptions.
2. Plug the servos into the default outputs and see how the flying surfaces move without making changes to your transmitter. For a flying wing M3/M4 are the Normal/Reversed output for the LEFT side, and M5/M6 are the same for the RIGHT side.
3. Try the elevator. Do they both move together and the correct way? If they are moving opposite to each other with elevator input, change one servo to the inverted output for that side (i.e. M3<>M4 or M5<>M6). Now they will be together. If they both move together but the wrong way, move both to the opposite output.
4. Try the aileron. Do they move the correct way? If they are not moving the correct way you'll likely have to reverse the TX channel.

OK, that's the RC part sorted out. Now the tricky part. You have to remember that the gyros are connected to the outputs in a set way BUT independent of the RC inputs. That means if you find that the gyros are moving your elevator UP when it should be DOWN, then you can cater for that.

1. With the model trimmed neutral and with all the flying surfaces moving CORRECTLY as you expect, sharply pitch the model nose DOWN. Do not add any roll into this. The elevator should jump UP. If it moves further down, then you'll have to reverse the servo connections to both sides and then reverse the elevator on the TX side. This means that the TX work the same way (as it has been reversed twice) but the gyro will now be opposite (as it was reversed only once).
Your elevator function will be working now.
2. Last hurdle. Try the ailerons again with your TX to confirm that they are correct as you may have just reversed the servos in the last step. If they are now reversed, reverse the TX channel for ailerons. Now the ailerons will again be moving in the right direction..
...BUT....
Is the roll gyro now moving in the correct way? Sharply roll the model to the right. The LEFT side should jump UP. If it does - you're all set. If not, well that's a problem for a flying wing as you can't change the servos without upsetting the elevator function. Tell me if this is the case and I will make a version with JUST the roll gyro reversed. Then it will definitely be right

You can see why I am loathe to making reversible gyros as it adds to mass confusion when setting up. Once we have the Flying Wing model set up then I really don't think it will be a problem.

Of course Aeroplane mode doesn't have this issue as all its controls and surfaces are independent.

UPDATE: Serves me right for doing a quick edit before going to work. I think I just reversed the Flying Wing mixing but left the gyros the same lol. Having said that, the only way to be sure is to follow the steps above and tell me at that last step whether the roll gyro is reversed or not.


Thanks for the detailed steps in trying to get things working right.
I didn't even think of swapping the servos on the board.

I've loaded veriosn 1.06 and everything is going right ioncluding the gyro direction up until

" If not, well that's a problem for a flying wing as you can't change the servos without upsetting the elevator function. Tell me if this is the case and I will make a version with JUST the roll gyro reversed. Then it will definitely be right "


The roll gyro is going in the wrong direction

Edit, but only on the right aileron. THe left one is right(I think, it is sometimes hard to test the roll gyro without acidently pitching the plane( Edit again; yes it def seems the left one is right and and the right one is wrong))!
NDw is offline Find More Posts by NDw
Last edited by NDw; Jan 06, 2012 at 07:46 AM.
Reply With Quote
Old Jan 06, 2012, 07:50 AM
Enjoying the sunshine
HappySundays's Avatar
Australia, NSW, Sydney
Joined Feb 2011
3,031 Posts
So if the roll gyro works on one side but not the other, that means both sides move the same way with gyro input? And they also move the same way for elevators then? That seems very odd.
Can you ignore that long explanation I wrote earlier and just connect the left side (viewed from behind) to M3 and the right to M5. When I tried it myself today I remembered how much of a challenge it is to set up. Everything interacts with each other and the board has to be oriented correctly.
I know 1.06 can be set up as I was able to do so myself. I did have to fiddle with TX Channel reversing though.
HappySundays is offline Find More Posts by HappySundays
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion CL-OSD a open source osd software for E-OSD and G-OSD callelj FPV Equipment 4074 Oct 31, 2014 09:07 AM
Discussion NeXtcopterPlus open-source release for KK and KK+ boards HappySundays Multirotor Electronics 812 Jan 09, 2013 04:10 PM
Discussion KK Open source programing eyeinsky1 Multirotor Talk 4 Dec 30, 2011 04:02 PM
Discussion Rob's Open Source Frame for KK & MK Rober-t Multirotor Talk 1 Dec 07, 2011 08:31 AM
Discussion Interesting open-source stabilisation device! Hogster Aerial Photography 0 Apr 03, 2008 09:02 PM