Using an OpenPilot CopterController as a Rate and Auto-level fixed wing stabiliser
I have been playing around with adding GPS enabled auto Return to Home stabilisers to my existing Guardian, HobbyEagle and Lemon stabilisers as a “safety” aid for motor gliders flown at distances where my eyesight isn’t what it was.
I came across this Open Pilot project Atom Flight Controller on Bangood for $15 delivered that was interesting since it takes a GPS sensor and looked like it might do both jobs in one.
“What you get” shows what comes in the package. The flight controller, two cables, a nice little anti vibration mount and a spiffy antenna holder for small quadcopters. The last two are actually both for totally different flight controllers - but hey its Bangood.
Turns out this particular controller has insufficient memory for RTH and I will wait for the new version, the REVO, to become available at Chinese prices. In the meantime I discovered this one makes a very effective low cost and lightweight stabiliser, particularly if you are using a Spektrum transmitter. Using a single Orange satellite and taking the Atom out of its case, you can get a DSM receiver/stabiliser that has 6 output channels plus in flight on/off, and in-flight gain control that does exceptionally good rate stabilisation plus auto levelling and has Flaperon functionality as well. Not bad for less than $25 and 6.3g.
You can connect the Atom with any receiver using the supplied cable but I was particularly interested in making a compact unit using DSMX satellites.
The one using two Lemon satellites and retaining the case has 10 output channels and came in under 20g while the Lemon single satellite version and heat shrunk Atom (my favourite) was just over 9g.
All of what I have done will be obvious to the multi rotor guys but there isn’t a lot around about using this unit for fixed wing. So this thread is really for fixed wing stab users who would like to experiment a bit and get started using a flight controller. The approach is a bit different from the typical Eagletree Guardian or Lemon stab with external rate pots and a bunch of DIP switches. Everything is done on a computer and downloaded to the stab.
Pros and Cons
The Open Pilot software is extremely well thought out and powerful. IMO the interface and user experience is better than anything provided by a vendor stabiliser by a long shot.
The software is the same in Windows, Mac and Linux versions.
You can adjust just about any behaviour variable of the stabiliser
It’s extremely cheap for what it is (A 6 axis stabiliser)
It is very compact and light
It works extremely well just with a single DSM2/X satellite to make a 6.5g airborne system if you take the case off
Did I say it was cheap? How about $25 for a complete DSMX receiver and sophisticated stabiliser with excellent rate and auto levelling capability (pretty much equivalent to an Eagletree Guardian plus receiver).
There is tons of user support out there as it is an open source project.
The Open Pilot software is extremely well thought out and powerful. It can be a bit too much if all you want is a fixed wing stab.
The vast majority of the interest and support is from the multi rotor fraternity. They speak a different language. Some of it unintelligible if you aren’t into multi rotors.
You need a PC to set it up. Not at the field to use it - but if you want to change its programming.
It has some multi rotor quirks (like arming and coupling axes) that you need to be aware of. ALL configuration is done with a PC. There are no external switches for mixing or direction or rate pots.
Open Pilot is an open source flight controller project. The OpenPilot web site is here.
The Open Pilot software that runs on your personal computer (Windows, Mac or Linux) is called the Ground Control Station or GCS. The version of the Ground Control Station you want is on this page.
Make sure you scroll down to Release 15.02.02 and download the variant you need: Linux, Mac or Windows. Do not upgrade past this version 15.02.02 as later versions no longer support the Atom.
Because it is multi rotor software there is a core emphasis on arming and disarming the controller (making sure the motors cannot turn on accidentally). You can imagine the outcome if a programming change inadvertently sent a quadcopter to full power while it was sitting on your bed being set up.
It took me a while to get the hang of it but it is fairly simple if you remember these rules:
1) NOTHING gets changed unless you hit the SAVE button on a screen before you exit it. If a green tick did not appear on the SAVE button, your changes were not saved.
2) Most changes will only happen when the controller is disarmed
3) Disarming often happens automatically when you try and make program a change.
4) Your motor won’t run until the controller is armed
There are whole lot of completed combinations that can be set in the software to arm a multicopter. For fixed wing keep it simple.
You want arming to be allowed when the throttle is down - no other conditions. This means setting “Aways Armed “ in the transmitter screen as the last thing you do before you disconnect it. If not everything will work at the field but your motor will never run. If you haven’t brought a PC there is nothing you can do about it. Guess how I know? Once you get the hang of it you might want to add another condition such as an arming switch for safety but keep it simple to start with.
Arming takes place on the Input screen on the Arming Settings tab. See picture.
Have the controller disarmed while you make any changes. Last thing you do is arm it before you disconnect it from the software. It remembers from then on.
Mix values are commonly a weird number like 127. There’s a reason. It’s to do with program efficiency and the numbers are representing the maximum binary digit available. The values can be between -128 and 127 (256 in 8 bit binary) representing -100 to 100 %
So just think of 127 as 100% so that a "mix" value of 50% would be expressed as 64.
Setting up the Hardware
The Atom has 4 connectors. 3 of these are small white JST-SH (1.0mm pitch) - two 4 pin and one 8 pin. The fourth connector is a MicroB USB connector for the connection to the PC. You will need to obtain a cable for this separately. It is widely used in mobile phones and similar small devices. See Footnote 1.
The Atom arrives with two cables with JST-SH type connectors.
The smaller 4 pin one has single header connectors on each wire. The bigger 8 pin one has 6 standard servo connectors on the wires.
Separate Receiver version
The 8 pin is the one you use if you want to use the Atom with a standard receiver. The normal black servo plug with 3 wires is the aileron connector and also supplies power and ground from the receiver. The others have only a single wire for the servo signal and can be used for up to 5 more channels.
Setting it up is straightforward. Just plug the first connector with 3 wires into your aileron output, the 4th wire into Elevator the 5th into Throttle and the 6th into Rudder. Leave the others unconnected unless you are setting up in-flight gain control (see later) on another receiver channel.
Gotcha: The wires are very thin as they only carry control signals in a multicopter. For fixed wing the red and black will also carry the power to run the servos and are inadequate. Just run a plug-plug wire (see Footnote 2) between a spare output on the receiver and channel 5 on the Atom to act as power connection. Once you get the hang of the software you will be able to assign the channels to suit. In particular throttle does not need to go through the Atom for fixed wing applications and so I am pretty sure you could take throttle direct from the receiver. My main interest is in the compact satellite version so I haven’t done any more experimentation using a separate receiver.
You need to do some very simple soldering to use a satellite. Two wires of the supplied 4 pin cable needs to be joined to the satellite cable, while the third satellite wire has to be connected to the voltage supply to run the satellite. Satellites need 3.3V and the Atom connectors all only supply the voltage of your flight battery or BEC (normally 5V). People have used the 5V supply but in time this will almost inevitably fry a satellite. I investigated the Atom PC board and as luck would have it, there is substantial solder pad on the board which supplies 3.3V from the onboard regulator. The third satellite wire goes to that pad. It requires small soldering iron tip and a steady hand but is quite doable. My eyesight and hand steadiness are well past their use-by date and I managed to do three of these no trouble.I strongly suggest some hot glue to anchor it when you have tested it and it works. If you want to make up a new cable from scratch you need a 4 pin JST-SH 1.0mm pitch connector (using only the outer wires) on the Atom end and a 3 pin JST-ZH 1.5mm pitch connector on the satellite end. I made up some using HobbyKing Orange satellite wires and some 4 pin JST-SH I got on eBay hence the inconsistent colours in my cables. Just make sure the correct pins are joined.
It is FAR easier to bind the satellite to your transmitter using a spare receiver before proceeding. It is possible to bind it just using the satellite and software but it is more complicated.
I ended up making three versions as shown in the first post. A super light one 6 channel using an Orange satellite, a rugged 6 channel heat shrunk version with a Lemon satellite, and a 10 channel version with two Lemon satellites and keeping the Atom case. You can get up to 10 channels out of the Atom if using a satellite, since the 8 pin socket (like all the two 4 pin ones) is multipurpose and can be set up as an input or an output in software. I also did a single satellite version keeping the Atom case. All four work fine.
I have done a thread here on how to build a small extension cable to install a permanent USB connection on the plane. Since the Atom requires connection to a computer to make any changes it might be worth considering.
By a "plug to plug" wire I mean the short connectors used by the flight controller guys to connect receivers to flight controllers. They have a standard black servo plug on each end of a short 3 conductor cable. HobbyKing sell them here.
There is endless entertaining debate on the forum as to whether they are Male-Male (based on the housing) or Female-Female (based on the actual connection. That's why I call them Plug-Plug.
Download the Open Pilot software, plug the Atom into the USB port of your computer, and plug in a flight pack. This can either be by connecting the main flight battery if the Atom is already installed in a plane, or connecting a 4.8V pack or 5V BEC output to a spare connector on the Atom if you are setting up on the bench. The 5th set of pins on the Atom is normally free in a fixed wing setup to connect power to. The software should start with two wizards automatically. Firstly the a big green "Vehicle Setup Wizard" button will appear. After you have finished setting up the vehicle another smaller green "Transmitter Setup Wizard" button will appear. If for any reason they do not, they are available as small buttons near the top of the Vehicle and Input pages.
Just follow the prompts and you will end up with a stabiliser that does excellent rate stabilisation and autoleveling using all the default settings. On my planes it works as well as an Eagletree Guardian. YMMV. The software is very well thought out but it has a lot of stuff that is really multi rotor specific or overkill for a simple stabiliser.
There are more detailed step by step instructions in Post 5 following.
The one thing you do have to check in the Config Hardware screen is that the Flexi Port is set to DSM and the Receiver Port is set to Disabled + One shot.
The satellite plugs into the Flexi Port not the Main Port (both connectors are the same).
Setting up the simple version.
1) Create a new model with Wing Type and Tail type as Normal, no mixes, and servo travel normal and 100%.
2) Bind the satellite to the transmitter using a spare receiver.
3) Connect the bound satellite to the Atom and the Atom to your PC. Power up the Atom and turn on the transmitter.
4) Start the OpenPilot GCS
In the Config tab of the software Check the Hardware tab. It should show DSM on the Flexi Port and Disabled+OneShot on the Receiver Port
5) Click on the big green “Vehicle Setup Wizard button
6) If this is the first time you have used the Atom click the Upgrade button, otherwise just click next. After clicking Next, the screen should show Connection device: USB Copter Control
Detected board type: Open Pilot CopterControl 3D
7) On the next screen chose the right hand button “DSM Sat”.
8) On the next screen chose the second button “Fixed Wing”.
9) On the next screen chose Aileron servo type, Elevon or VTail mix from the drop down.
10) On the next screen chose Analog or Digital servos
The plane is now configured. You can check the Connection Diagram to show which output feeds what servo, but that also appears on the next screen. Double check that the motor is on output 3 and the other servos are correct.
When you click next the servos should come alive.
Now you set the travels and directions.
1) Click start
2) Slide the slider to the right until the motor just starts to run. DON”T OVERDO IT! Back off a fraction and click stop.
3) Click Next. On this screen you set up the servo travels and direction. Leave the transmitter sticks in neutral.
4) Slide the button on the centre slider to set first aileron servo travel in both directions. If you go too far reduce the travel using the buttons on the Min and Max sliders. If the control surface moves in the wrong direction, Stop and click the reverse box.
NOTE: If you are using Dual ailerons you might want to note the minimum and maximum output numbers in order to set the second aileron to the same travel.
Repeat steps 3 and 4 for all control surfaces.
When you exit the calibration screens there is only one option under “Initial Tuning” for fixed wing. Just click next.
On the next screen click Save. You always have to save from the software to load the settings into the controller.
After the controller reboots move on to the Transmitter Setup Wizard by clicking the Green button. The software will automatically disarm the Atom (stop any throttle command).
Follow through the screens choosing Acro and the Mode you fly in.
The Atom will automatically allocate channels and calibrate the transmitter movements to the correct transmitter controls as you move the sticks.
HINT1: Be careful to move each stick ONLY on the axis it asks for.
HINT2: If the screen does not show that the software has picked up the right stick, or you inadvertently move on the wrong axis, do not persevere. Power down the Atom and start again with the Transmitter wizard. I found sometimes it failed to work but restarting the controller fixed the problem. Most times I had forgotten I had the Throttle Kill switched on on the transmitter.
For “Flight Mode” chose the 3 position switch you want to use to control the Atom in flight. For a 7 channel or better Spektrum Tx I recommend Aux2. If you only have a 6 channel you can use Flaps/Aux1. Using Gear will give you only two flight options and you really want 3. That will give you Rate stabilisation/Off/Autolevelling.
Ignore Accessory 0,1 and 2 by clicking Next/Skip.
Follow the instructions to set neutral positions, travel and direction on the next 3 screens.
You are done.
In the Configuration page of the software check the Vehicle tab. It should show the correct assignment of Atom outputs to servos.
Now go to the Input page. Click the RC Input tab. It should show the correct assignment of sticks to Spektrum channels.
Now you set the Flight Mode switch
Click the Flight Mode Switch Settings tab. As you move the switch on the transmitter you will see the slider in the top left move from position 1 to 2 to 3. That’s all we need for fixed wing. Set Manual to the switch position where you want the stabiliser Off. Just chose which of the Stabilisation Modes you want for the other two positions. For fixed wing Stabilised 1 and Stabilised 3 are the appropriate ones for Auto-levelling and Rate stabilisation respectively. Save. Check that all the controls move the correct way.
Leave all the other tabs at default.
IMPORTANT: Now go to Input, Arming Settings and set “Arm airframe using throttle off and:” Always Armed and set the “Arming timeout” to 0. Then click Save. a red X may appear on the Save button but your computer should announce “Armed”.
If you get to the field and everything works but the motor won’t run you have forgotten this step.
Check that all the controls move in the correct direction with the FlightControl switch at Off
Check that the control surfaces move in the correct direction to oppose movement of the plane when “Auto-level is selected (It will also work for Rate mode - it’s just that Auto-level is easier to see). If you have trouble seeing the surface movement when you move the plane put your finger on the surface to feel the direction.
As with all stabilisers it is ABSOLUTELY CRITICAL that you check the correction is in the proper direction.
You can now set Dual Rates and Expo on the transmitter and go fly.
As always it is sensible to take off with the Stab Off and only switch it On when several mistakes high. It worked first time for me though.
If you are happy with the performance you can save all the settings from the “Export UAV settings “ on the File menu of Open Pilot GCS.
Levelling the plane.
With Arming Off go to the Attitude Tab and click the “level” button while the plane is in level flight attitude. I would leave the “Zero gyros while arming the aircraft” checked and then you should hold the aircraft in level flight position while the Atom initialises.
Multi rotor flight controllers are much more complex than fixed wing controllers. They allow complete control over almost all the variables of the stabiliser. The only fixed wing controller that I know of that is similar is the BlueWing IceMan Pro.
It is possible without delving into all the arcane stuff however to set up fairly simple in-flight Master Gain control. When running the Tx Setup wizard, you need to assign a knob/slider to Accessory 0. Then go to the TxPID panel and tick “Enable PID module” and set “Instance 1” to Roll+Pitch Rate.Kp, Control Source to Accessory 0, and the Min and max values to 0.001 and 0.008. This will give a range of in-flight gain for Roll and Pitch on the knob or slider. You need to power cycle the Atom after setting up TxPID. You may have to go into manual calibration in the Input screen and set up all the stick extents including the Master gain knob.slider. It worked perfectly with those values on my Bixler test bed, however I have no idea how it will work on something like a 3D plane.
Explanation: Flight controllers allow individual control over just about any variable. They use a feedback system that has an “Inner loop” which is roughly what we simple stabiliser guys think of as Rate stabilisation and an “Outer loop “ which modifies the Inner loop and is like Heading Hold. In addition the actual correction algorithms consist of three parts: the Proportional reaction to the the gyro error output, the Integration of the error and then the Differentiation of the error. All 3 are used to calculate the correction and the three initials are where the term PID controller comes from.
Flight Controller gurus will be rolling about laughing by now at this description but the point is that ALL these variables (and more) are not only adjustable in software but can be assigned to up to 3 inputs so that you could have 3 independent in-flight gain controls for roll, pitch and yaw if you wanted it.
In other words you could set individual in-flight gains for all three flight axes separately (with various combos of Rate and Attitude) if you have a Transmitter (like the Taranis) with 3 knob/slider controls.
I have only just started to get my head around the possibilities so would be interested in any advice and comments.
The default wizards set up a single axis Roll, Pitch and Yaw stabiliser and that uses (like a lot of simple stabs) a single aileron control. The wizard will set up two aileron servos correctly but that is just an electronic Y-Lead configuration. You do not get the Spektrum Dual Aileron or Flaperon functionality with differential control of each aileron servo from the wizard.
However the Open Pilot software lets you mix up to 5 inputs to any output if you go into the Custom Mix screen (rather than Fixed Wing) and I was able to get proper Flaperon movement from Channels 2 and 6 of my DX8.
The screen shots are attached for anyone who wants to experiment. I got active stabilisation on only one aileron (which works just fine) but it wouldn’t surprise me if you can get Flaperons plus active stabilisation on both ailerons. There is a lot of possibilities with this software I haven’t understood yet. I have feeling that you could get dual aileron servos and dual taileron servos but I don’t fly anything like that.
Reserved for updates
The User Manual for the openPilot software is excellent - although naturally aimed at multi rotors.
The section on "Finding Your Way Around the GCS" is particularly helpful.
NOTE: I have corrected Post#3 which originally had the connectors incorrectly identified. The Atom uses JST-SH 1.00 mm pitch and the Satellite JST-ZH 1.50mm pitch connectors.
To make up the Satellite - Atom cable I recommend these satellite extensions from HobbyKing. If you use an Orange satellite it will come with one in any case.
They are much better quality wires than the ones Lemon supply and HK will sell you a 60cm one and a 90cm one for $2.25. Cut them in half to end up with four flexible and strong satellite connector wires. Simplest way to do the Atom end is to solder the black wire to the black wire, discard the two inner Atom wires and solder the yellow Atom wire to the Grey satellite wire. The orange satellite wire goes to the pad on the PC board.
If you don't wnat to use up your one Atom 4 pin JST-SH connector for any reason, there are two options.
Find a 4 pin JST-SH connector with wires.
This is a typical eBay seller. 10 sets for $6 including postage. The usual good local suppliers like RCConnectors, Spark Fun, MicronWings are also worth trying.
If you want to get all your stuff from Hobbyking I do not believe they sell a 4 pin JST-SH. Beware as they describe some of their normal 2.5mm pitch JST-XH stuff as JST-SH!
They do however sell some 3 pin JST-SH cables. These for example.
Since you only need the two outer wires of the 4 pin connector, you can take two 3 pin ones , remove all but one wire, slice a bit off the plug with an Xacto and make a "4 pin" out of two cut down 3 pins that fits the socket just fine and stays in solidly.
Adjusting Stabilisation - Basics
If you go to Stabilisation Button and the Basic tab you will see the responsiveness that has been set by the default wizard implementation. You can adjust the basic rate and attitude stabilisation response by moving the sliders. This is more or less equivalent to adjusting the "rate" pots on simple fixed wing stabs although you can adjust Rate, Attitude (levelling) and Rate yaw separately. If you feel adventurous then you can add expo to each of the 3 axes and also separately change the Rate response and Attitude response for the three flight axes independently - including altering the Proportional and Integral components.
And that's just on the Basic screen.
There are two more screens with even more control: Advanced and Expert. I told you this software was powerful.
Personally I would start with the Default values and tune things a step at a time if you feel it needs it. The Open Pilot documentation is pretty good if you need an explanation of what anything actually is.
Thank you SO much for doing this!
My next gyro order will be an atom. And/or the larger CC3D.
For a satellite could you edit and add links as examples for wires/connectors needed?
Oh, can you comment on turning the stabilizer off and back on in flight? Can it work like a panic feature?
I will see if i can put together some info on the wires later today.
Yes, the Atom works just like a Guardian. If you switch the Flight Mode from Off to Autolevel, it snaps into level flight - same as Guardian 2D mode. I am pretty sure if you fiddled with all the parameters you could make it behave exactly the same with a HH option as well. The default works extremly well however.
I use Gear as a panic switch normally. I just do a mix on my DX8 from the Gear switch to Aux2 to overide whatever channel 7 is set to by Aux2 and force it to Autolevel position.
Just a heads up.
I had the connectors incorrectly identified in Post#3. It is now fixed. Teach me to do stuff late at night from memory.
I have also added some info on sources for the connecting wire in Post#8
|Category||Thread||Thread Starter||Forum||Replies||Last Post|
|Discussion||Fixed wing PID control refresh rate||derp express||UAV - Unmanned Aerial Vehicles||13||May 19, 2015 11:40 PM|
|Discussion||Re-use WLtoy heli 0.3mp camera as fixed wing cam(need advice)||kevinmce||Electric Plane Talk||1||Mar 06, 2015 07:58 AM|
|Discussion||Aerial mapping using multi's or fixed wing||Procrastinator1||Multirotor Talk||0||Oct 19, 2014 01:02 PM|
|Sold||Lightly used OpenPilot CopterControl board.||rinatka7||Aircraft - Electric - Multirotor (FS/W)||2||Oct 16, 2012 11:42 PM|
|Found||Looking for an OpenPilot CopterControl Board||Howemd||Aircraft - Electric - Multirotor (FS/W)||5||Jul 11, 2012 05:33 PM|