advertise
trademarks

Pixhawk FBW-A & Autotune Lethargic – RESOLVED

Pixhawk / APM Plane FBW-A & Autotune Lethargic – RESOLVE

 


Getting my CrashTestHobby.com Reaper XL deltawing RC plane with an RTFHawk (Pixhawk) flight controller running APM Plane 3.2.0 firmware up and flying has been a challenge.  I’ve built a tricopter which utilized an APM 2.6 flight controller and thought I was prepared.  After all, it uses Mission Planner and I knew my way around that well enough.

Prior to the first flight, I had all key components installed, powered up, and functional.  My FrSky Taranis was programmed.  The two Zippy 2700mah 3s batteries were duct taped to the top of the wing so the wing’s center of gravity (CG) was the prescribed 9 inches back from its leading edge.  The RTFHawk armed, GPS locked, and the engine spun up to full throttle generating tons of thrust.  The elevons responded correctly to Taranis stick inputs and plane pitch and roll movements.  I was ready.  I had thought of everything.  This was going to be easy.

Boy, was I wrong!  There was one problem after another.  The most challenging was how lethargic roll and pitch outputs were in FBW-A mode.  Since the same PID values and other parameters, like max and min pitch and max roll angle limits are used in other automatic flight modes such as loiter and RTL, my plane was effectively grounded.  This article chronicles the process it took to find the problems and solutions.

 

Maiden Flight

I was confident in the aircraft, but not in my skill.  I asked a more experienced pilot in our club (Nelson) to maiden the plane.  Everything checked out and the moment had arrived.  Toss…up it went.  Trim was only slightly out.  A few quick trim adjustments were made.  “It feels really heavy in the air”, I heard.  “Give me higher rates”.  I flipped the rates switch to high.  “It doesn’t feel right”.  I asked if the CG was good.  “It’s way under powered.  It still feels really heavy.  CG is pretty good I think.”  The plane was circling the field about 100 feet up.  It reached the corner of the field and the engine shut off while the plane was banked.  I heard “Uh Oh, what was that?” and the plane stalled and nosed straight down.  The pilot leveled it out and pull it out of its dive but it still pancaked into the ground.

I went out to inspect the damage.  One of the batteries was ejected.  Other than that, there wasn’t even a scratch or a dent.  Nelson reminded me that we have had RF interference problems from that area of the field.  When I asked him if he was still willing to give it another try, he suggested that I unplug the flight controller and go totally manual.  That is not what I wanted to hear.  I was expecting to toss my Reaper in the air to verify the center of gravity and the begin flying missions.  Oh well.


It took another 3 flights that day to get the plane balanced and trim set.  It turned out that the plane was tail heavy and each flight I added a little nose weight.  I added 2.5 oz. of lead and 5 quarters to the front of the plane before it finally started flying right and Nelson began doing loops and rolls, high speed dives, and vertical corkscrews.  “Now that’s reaperish” I heard.  “Its flying like a reaper now.”  It surely was not underpowered.

Lessons Learned

Basics Before Technology When maidening a new plane, set all technology aside.  Prove the airframe and fly as bare bones as possible.  By eliminating the flight controller, I would be certain that any further problems would be aircraft related and not because of some random parameter I overlooked.

 

FBW-A and Autotune

The extra weight wouldn’t be a problem, I thought.  I am going to add a Mobius and FPV camera anyway.  Later that night I created the permanent cutouts for the batteries and began re-installing the RTFHawk.  I added Autotune as a flight mode, set the AUTOTUNE_LEVEL parameter to 5 (default) and read up on the procedures to use it.  It seemed simple enough. According to my understanding…

  1. Get the plane in the air to a safe altitude and speed and switch to Autotune Mode.
  2. Tune roll first.  Move the aileron stick full left and hold for about 2 seconds, then quickly to full right and hold. Do this for several minutes.
  3. Next tune pitch.  Follow the same procedure as for roll by moving the elevator stick.
  4. If the plane ever becomes unstable, quickly switch out of Autotune mode.  This will restore PIDs to previously stabile levels.


The following week was my turn to pilot the Reaper.  I enlisted my brother as copilot and drove out to his house in the country.  He as 20 acres of mostly clear property.  Preflight checks indicated the plane, radio, and ground station were good.  I advanced the throttle to full and signaled my brother to toss the plane in the air.  It dipped down and skimmed the grass.  I cut the throttle and landed.  We tried again.  Second try it leveled out and pancaked right into the ground.  “What is going on?” I asked myself.  We gave it one more try.  This time it skimmed the ground for about 20 feet before it started to gain altitude… slowly.  I gritted my teeth because 500 feet away were a bunch of tall trees and at the rate the plane was climbing I didn’t know if it would make it.  It just barely cleared the trees and I started the first turn.

The plane was very sluggish.  So this is what feeling heavy means.  “It won’t turn”, I yelled to my brother.  I finally got it turned around and the plane was following my brother’s south property line which would take it behind his house and out of sight.  I was still trying to gain altitude.  I asked for a right turn which would bring the plane across its original takeoff heading and towards an open area of the property.   It wagged a little but would not turn.  It is a good thing that Self-level mode was working because at that point, I lost sight of the plane as it flew behind the house.  I took my hands off the sticks and ran to the other side of the house and there it was.  I got it higher and flew several large laps around the field before bringing it in.  I never took it out of self-level mode.  I was at a loss.  What now?

Later that night while checking over the plane, I discovered the problem.  The propeller was on backwards.  The numbers on the top of the propeller were facing towards the rear of the plane.  What a rookie mistake.  I’d have to wait another week to try out Autotune.

Subsequent Attempts

The next week came and I was out at the local flying field.  This field was larger than my brother’s property and after last week, I needed that.  Everything checked out fine.  When tossed in the air the plane gained altitude quickly.  When I started the first turn, it responded quickly.  It gained altitude much faster with good pitch and roll authority.  I made a few laps around the field which went great I decided to try medium rates.  As soon as I flicked the switch, the plane rolled over on its back and dove towards the ground.  I pulled up and now the plane was flying straight up.  I switched back to low rates and the plane leveled off all by itself.  Whoa…I won’t do that again.  My rates curve need a little adjusting.

Another lap around the field and everything looked good.  I switched to Fly-By-Wire A (FBW-A) mode.  The plane stayed level.  At the end of the field I asked for a turn and the plane banked shallowly.  I moved the aileron stick all the way over but the plane didn’t respond proportionally.  The plane made a lazy turn around and came back overhead.  Now what, I thought.  I switched back to Self-level and landed.

I did some reading.  FBW-A is a rate limited mode where the flight controller holds the pitch and roll angles called for by the control sticks.  If you hold the aileron stick all the way to the left, the plane will roll left to an angle specified by LIM_ROLL_CD in Mission Planner.  If you hold the stick half way to the left, you well get a roll angle that is half the amount specified in LIM_ROLL_CD.  Pitch is similarly controlled by parameters in Mission Planner (LIM_PITCH_MAX, LIM_PITCH_MIN).

I checked my LIM_ROLL_CD parameter and found it was set to 45 degrees.  The roll angle I saw when I had moved the aileron stick all the way over was less than 10 degrees.  Something was wrong.  I decided to increase the limit from 45 degrees to 60 degrees since my Reaper could handle a 60 degree turn anyway and took it up for another flight which achieved the same results of a very shallow roll with a very wide turn.

What the Internes Says

I toiled over this for several more weeks.  Finding that others were having similar problems gave me a sinking feeling that maybe there was an issue with delta wing mixing in the APM Plane firmware.  Many people on the internet offered suggestions on possible causes, but none resolved my problem.  According to them, there are four possible causes to lethargic FBW-A.

  1. Improper Servo Connections – Double check that servo 1 is plugged into the right wing and servo 2 is plugged into the left.
  2. Improper Stick Calibration – Re-run the stick calibration in Mission Planner.  If your Pixhawk does not receive full inputs, then it won’t provide five full outputs.  Be sure to move sticks all the way into the corners and not just left/right and up/down.
  3. Unit/Scaling Issue – Roll and Pitch angle parameters in Mission Planner are stored in centi-degrees.  Each degree of angle has 100 centi-degrees.  45 degrees equals 4500 centi-degrees.  If entered improperly, you will not be able to reach your intended maximum roll and pitch angles.
  4. Improper or Inadequate PID Values – Follow the directions in the APM Plane tuning guide here and here.  This is a problem for me because the initial reason I was testing FBW-A was to get into Autotune.  Also, the plane flew well with the default PID values.

Needless to say, my servos were plugged in properly, I did not have a unit/scaling issue, and my stick calibration was completed correctly.  I do not believe that PID values were the problem.  If the P value is too small, then when the aileron stick is moved to max, the plane should slowly reach max roll angle.  Conversely, if the P value is too large, the plane will reach the max roll angle quickly and overshoot it.  It will need to correct itself and begin to oscillate.

Solution

Remember a few weeks prior I almost crashed when I switched from low to medium rates.  My medium rates needed to be tamed down a little.  I loaded my Reaper setting in Open TX Companion and ran the simulator to compare the PPM percentages between low, medium, and high rates.  What I discovered startled me.  Full aileron in low rates corresponded to only a 33% PPM value.  The light bulb flickered and then went on.

If I am flying in low rates and switch to FBW-A mode, and initiate a hard turn, the flight controller will see a PPM value of only 33% of max and respond with a bank angle of only 15 degrees.  33% of the current LIM_ROLL_CD of 45 degrees, is 15 degrees.  Now couple this shallow bank angle with a probable very conservative P value, and you may not be able to even reach 15 degrees unless you hold the stick over for an extended amount of time.

Eureka!!!

So, to the list above I add:

  1. Auto Modes Need Full Rates – When switching into any of the automatic flight modes like FBW, Autotune, or Auto, you need to send the Pixhawk maximum PPM values with full rates on your transmitter.

 

Testing

One of the valuable things I learned is how to ground test FBW-A.

  1. Remove your propeller, arm your plane just as you would to fly, and switch to FBW-A flight mode.
  2. Hold your aileron stick all the way to the left and tilt (roll) the plane to the left until its ailerons return to neutral.  If everything is working, your plane’s roll angle should be equal to LIM_ROLL_CD in Mission Planner.  Check to the right.
  3. Hold your elevator stick full up and tilt (pitch) the plane upward until its elevator returns to neutral.  If everything is working, your plane’s pitch angle should be equal to LIM_PITCH_MAX in Mission Planner.
  4. Hold your elevator stick full down and tilt (pitch) the plane downward until its elevator returns to neutral.  If everything is working, your plane’s pitch angle should be equal to LIM_PITCH_MIN in Mission Planner.

On the next flight test, FBW-A mode responded perfectly.  If you’ve read this far, I hope you’ve found my experiences helpful.

content

One Response to Pixhawk FBW-A & Autotune Lethargic – RESOLVED

Leave a reply

terms