SMALL - espritmodel.com SMALL - Telemetry SMALL - Radio
Reply
Thread Tools
Old Apr 23, 2010, 02:43 PM
Hang on, turbulence ahead
Heli Hacker's Avatar
St. Louis
Joined Dec 2007
534 Posts
Discussion
Virtual Flybar - DIY/Open Source - Now 3-axis

This winter I decided to build something that would help me fly better and not crash so much. Using a 32-bit Parallax Propeller processor and a 2-axis IDG500 gyro, I built myself a virtual flybar.

I call it Phubar, for Phase-Universal Flybar.

It allows for adjusting the phase angle of the command inputs and the gyro stabilizing inputs to the swashplate. It has angular gain and rate gain settings (Proportional and Derivative coefficients, for you control systems people) with angular decay so it mimics how a weighted flybar will "follow the heli" after a second or two. The gain, decay, and phasing parameters can be changed using a serial terminal app on the PC that talks to the PhuBar via USB cable.

The whole unit weighs about 13 grams and is 35x35x18mm. By comparison, the stock flybar plus one pair of weights is about 19 grams. It has four receiver inputs - aileron, elevator, aux(pitch), and a spare - and four outputs for servos. An LED lights to tell you when it will accept input via USB, and blinks for 3 seconds when the gyro is calibrating so you know not to move it.

I have only tested it on a HBFP so far, but it is working very well. It took a lot of test flights for me to find the right gain settings. Photos below show the flybarless head and the PhuBar installed. I made the FBL head by removing the flybar and making direct swash-to-head links using link ends and balls from a FireFox 200. TX and RX are Spectrum.

The video below shows how the swash moves as the heli is tilted. Here the phasing is set to zero degrees, so movement on only one axis causes only one servo to respond. Then you see it in flight, with the phasing is set to -45 degrees so as to mimic the 45-degree head arrangement found on the Kestrel, Free Spirit, CB100/CB180, etc. It is pretty stable. About 43 seconds into the video I flick the cyclic stick hard right to show how it recovers from a disturbance. Blink and you will miss it - it recovers that quickly.

I sure am glad to be rid of that P.I.T.A. flybar.

Now I need to do a lot more testing, including on a CP so I can incorporate CCPM mixing. Right now it can only handle two servos that are 90 degrees apart, and I want to generalize the mixing code so it can handle 2,3 or 4 servos where you can specify the position of each servo separately.

If all goes well, I will probably open-source the code and publish /docs/instructions on how to build it and load the software into it. It takes about $105.00 in parts and the ability to solder surface-mount devices (SMDs). I had the printed circuit board made by BatchPCB.com. All the components can be obtained from SparkFun, Digikey, and Parallax.

I would love to put the gyro on the main board, and maybe get the whole thing under 10 grams. But the IDG500 only comes as a leadless chip and I don't yet have the skills/tools to solder leadless chips, so I have to use the Sparkfun gyro breakout board for now.

Oh, and after tuning this thing, I now understand why helicopters with physical weighted Bell flybars tend to wobble a lot when hit by a disturbance or large control input. It's because a Bell flybar can only provide the Proportional term in the stabilization equation. It cannot provide the Rate(derivative) term which can damp out the wobble. Look at the promotional videos of the CB180Z with it's built-in 3-axis gyro AND Bell flybar. With the gyro turned off, it wobbles. With the gyro turned on, much less wobble, because it can apply rate-based control. So it adds the D to the P to make a PD control loop.

VIrtual Flybar on HBFP (1 min 48 sec)
Heli Hacker is offline Find More Posts by Heli Hacker
Last edited by Heli Hacker; Nov 13, 2010 at 12:11 PM. Reason: Cost of components is lower than I thought.
Reply With Quote
Sign up now
to remove ads between posts
Old Apr 23, 2010, 03:08 PM
Registered User
Joined Oct 2009
593 Posts
Very impressive, I think it could change the beginners heli market or flybarless stabilzation market.
aerorotor is offline Find More Posts by aerorotor
Reply With Quote
Old Apr 23, 2010, 03:59 PM
Tucson,AZ
Joined Dec 2007
4,371 Posts
Excellent Work!
Cheers, JohnW
johnIn2SonAZ is offline Find More Posts by johnIn2SonAZ
Site Sponsor
Reply With Quote
Old Apr 23, 2010, 04:20 PM
Cranky old fart
Balr14's Avatar
Germantown, WI.
Joined Oct 2007
21,437 Posts
I second that, it is really slick.
Balr14 is online now Find More Posts by Balr14
Reply With Quote
Old Apr 26, 2010, 09:46 PM
Registered User
Spicewood, Texas
Joined Aug 2009
310 Posts
I am most impressed!
I am an EE who also programs, so I really can appreciate what you have done, too.

I have not played with the Propellor, but I have read about them. They are 'interesting' sounding. They are not marketing them very strongly, at least in the mainstream engineering press, that I have seen.
Do they work as well as they advertise? Are they horribly buggridden?

I don't think that the idea of parallel has hit the embedded world hard, yet, either. It's still mostly about single MPU power and what you can cram into a chip with a SOC, kind of like the PC world was before multi-core.

Take care,
Kent
akent is offline Find More Posts by akent
Reply With Quote
Old Apr 26, 2010, 10:25 PM
Hang on, turbulence ahead
Heli Hacker's Avatar
St. Louis
Joined Dec 2007
534 Posts
I haven't run into any bugs yet myself, but I have probably seen some discussed in the Parallax user forum. You do have to be careful to use bypass capacitors on the power supply pins to avoid burning out the internal phase-locked-loop.

They discuss this in the forum here:
http://forums.parallax.com/forums/de...?f=25&m=336759

It seems like they are marketed more toward hobby and DIY users than commercial customers.

I think you have to have done this kind of application using a single-core processor to appreciate the multi-core Propeller. Of the eight processors (aka "cogs") on the chip, the Phubar uses one to manage servos, one to accept RX input, one to manage the ADC to grab gyro data, one to do low-pass filtering of the gyro data, and one top-level cog for the 100Hz main update loop. Data is communicated through variables defined in memory common to all cogs. So far I am only using about 8% of the throughput capacity of the top-level cog, and about 25% of the 32Kbytes of external memory.

I have written apps for single-core chips using interrupt handlers, and it is so much easier to just dedicate a processor to each external device that requires real-time interaction.
Heli Hacker is offline Find More Posts by Heli Hacker
Last edited by Heli Hacker; Apr 26, 2010 at 10:39 PM.
Reply With Quote
Old Apr 27, 2010, 07:51 AM
Registered User
USA, NY, Syracuse
Joined May 2005
874 Posts
very nice, I've played with diy pic project, and worked up some code in vmlab for atmel's chips. I even tried to get some of those gyros when sparkfun had there give a way. The propeller chips look very interesting I may have to get some.
beer-man is offline Find More Posts by beer-man
Reply With Quote
Old May 04, 2010, 10:21 PM
Hang on, turbulence ahead
Heli Hacker's Avatar
St. Louis
Joined Dec 2007
534 Posts
I think I found the ideal device for field setup of DIY projects like
the PhuBar. It's a tiny LCD serial terminal called TextStar, made in the UK. It also doubles as a servo analyzer:

http://cats-whisker.com/web/node/7

I'm not seeing any U.S. distributors out there yet, though.
Heli Hacker is offline Find More Posts by Heli Hacker
Reply With Quote
Old May 05, 2010, 03:23 AM
revving and pulling too hard
kiwilama's Avatar
New Zealand's Riviera
Joined Jun 2008
319 Posts
Very cool
kiwilama is offline Find More Posts by kiwilama
Reply With Quote
Old May 05, 2010, 08:56 AM
Registered User
ForceFedDSM's Avatar
Massachusetts
Joined Jun 2008
1,715 Posts
If this is cheaper than the new Turnigy V-bar coming I will build one and try it out on my night flying 450 I am building. I just went fbl on most of my fleet and I have a night flying setup on the way that will need a fbl setup.

Do you think it can handle mild 3d?

BTW I almost forgot......GREAT WORK

ForceFedDSM is offline Find More Posts by ForceFedDSM
Reply With Quote
Old May 05, 2010, 10:53 AM
Hang on, turbulence ahead
Heli Hacker's Avatar
St. Louis
Joined Dec 2007
534 Posts
Quote:
Originally Posted by ForceFedDSM View Post
....Do you think it can handle mild 3d?....
I don't yet have any idea whether it will be capable of 3D. That's pretty far on the horizon yet.

I just now got it installed on my FireFox 200 and hope to start flight testing tomorrow. The generalized N-servo mixing equations are tilting the swash correctly and mixing in the collective. I use the 90-degree 1-servo setting on the DX6i and let the PhuBar do the CCPM mixing.

I had to assemble a new circuit board with right-angle connector headers so it would fit in the lower bay on the FireFox. See the little white box in the photo. The skids are part HB skid, part coat-hanger, with very wide stance - next best thing to training gear when testing a new stabilizer system.
Heli Hacker is offline Find More Posts by Heli Hacker
Last edited by Heli Hacker; May 05, 2010 at 11:25 AM.
Reply With Quote
Old May 05, 2010, 11:07 AM
Registered User
ForceFedDSM's Avatar
Massachusetts
Joined Jun 2008
1,715 Posts
Very interested. Please post flight report of the ccpm firefox.
ForceFedDSM is offline Find More Posts by ForceFedDSM
Reply With Quote
Old May 05, 2010, 01:03 PM
Registered User
Sweden
Joined Jan 2010
567 Posts
Too bad that the gyro is not "absolute" ie. able to level the heli. Would be awesome to have the heli level automatically when you let go of the sticks.

However do those things work anyway? Are there really "absolute" gyros with no drif, or do they just use gravity as a reference (which will not work too well with 3D?)
sandos is offline Find More Posts by sandos
Reply With Quote
Old May 05, 2010, 03:36 PM
Hang on, turbulence ahead
Heli Hacker's Avatar
St. Louis
Joined Dec 2007
534 Posts
The devices capable of absolute self-leveling either use imagers to see the horizon or the ground, or they use a three-axis gyro plus three-axis accelerometer to form a complete attitude/heading reference system that can compensate for gyro drift and keep track of where "level" is.

That's a large chunk of sophistication above what I am trying for.

I can turn the angular decay value down to zero on mine, and it will stay level for a little while, but gyro drift will soon enough cause it to be not-so-level. The decay not only makes it behave more like a physical flybar, but also hides the gyro drift by zeroing out the sensed deviation from level within a second or two. Basically, it is only concerned with where it is in relation to where it was a couple of seconds ago, and forgets where it was further back than that.
Heli Hacker is offline Find More Posts by Heli Hacker
Last edited by Heli Hacker; May 05, 2010 at 03:48 PM.
Reply With Quote
Old May 09, 2010, 07:34 PM
Hang on, turbulence ahead
Heli Hacker's Avatar
St. Louis
Joined Dec 2007
534 Posts
The wind keeps blowing here in Missouri which makes it hard to do test flights, but I managed to get the FireFox in the air today. The PhuBar really helps me to control it and keep it level. It's almost as easy to fly as my CX2/Kestrel hybrid, and clearly flies better in the wind. I had to fly without the canopy for CG reasons; the receiver needs to be moved to the rear before I will be able to fly with canopy.

Interestingly enough, it does well on the same gain and decay settings that I used on the Honeybee. I had expected to have to do a lot more adjusting of parameters to fit a new helicopter. Maybe that explains how the commercial vbars can come set with default gains that will at least get you in the air regardless of what heli you have, with just a bit of tweaking needed to optimize or to loosen it up for 3D. The one difference was that the FireFox seems to do much better with 0 degree phasing, while the Honeybee seems to like 45-degree phasing best. I don't yet understand why, but maybe it has to do with much higher headspeed.

Pardon the crappy video, but my keychain type-1 camera is all I have to record with right now. I hope to have a better one in a week or so. You can see the gusty wind in the trees. I spent a lot of my energy fighting the shifting currents, including a lot of updrafts and downdrafts. I could blame a downdraft for pushing me into the grass that one time, but my piloting skills are surely to blame. And I have yet to set up the dx6i as well as it could be. This is my first CP helicopter.

But notice that even when it went into the grass, the heli stayed level. A good thing,too, because if the blades had so much as touched the grass I'm sure I would have had to straighten the mainshaft, which on the FireFox is made of steel so soft you can bend it with your bare hands. Now that I know I can control it more easily, I need to invest in a better helicopter.

The audio is really weird, but you can just make out the sound of me flicking the cyclic hard occasionally to test the stability. Those are the only times that you see the heli bobbing much.

I hope to do more FF with it soon, but we are expecting 3 days of rainy weather, so it may be a while.


FireFox test with PhuBar Virtual Flybar (2 min 51 sec)


Edit: Here is a better video now that I have a better camera:
PhuFox 2.avi (1 min 6 sec)
Heli Hacker is offline Find More Posts by Heli Hacker
Last edited by Heli Hacker; May 27, 2010 at 12:33 AM.
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Found my winter project more coffee Dock Talk 24 Feb 03, 2010 04:03 PM
Discussion My winter project. Thekid3418 Flying Wings 12 Jan 03, 2010 11:49 PM
Finally started my winter project P-51 fan Parkflyers 35 Jan 20, 2004 11:00 AM