I'm new to the ArduPilot, and trying to tune gains for the first time. I've got the plane flying pretty well in stab mode, but when I switch to FBW-A it is extremely lethargic. It flies straight and is stable, but a full stick-deflection in roll only results in a few degrees of bank. The bank limit was set at 35 degrees and I bumped it up to 45 degrees, but can never reach the limit. Is there something simple I'm overlooking? Thanks.
Are there PID parameters associated with FBW?
Honestly, I don't know, or I should say, I think they are the same PID parameters that are used for stabilized flight. The manual isn't all that clear, but with other autopilots I've worked with there are typically a set of PID parameters used for stability (inner loop) and one set used for navigation (outer loop). I would have thought that FBW would just use the inner loop gains, At the beginning I started with just P-gains, as suggested in the manual. I've tried adding an I-gain for roll, as delta wing configs often need this (I'm flying the RiteWing Zephyr II. The changes I made to P-gains in the inner loop for stab mode definitely helped with FBW mode as well, it just seem s either very constrained or very stiff. I can give full aileron input on the stick, and the bank angle has to be less than 5 degrees. I found a few sample files for Zephyr online, but I'm not sure I can take them directly, as the ArduPilot doesn't seem to associate PWM values directly with control surface deflection angles, so if the other planes were set up different (different servo horn or control horn lengths) there is no way to know if the gains will be close. I had to drop both the roll and pitch P-gains by about 40% to damp out oscillations. I introduced an I-gain to roll, with smoothed out stab and FBW mode a bit, but seem to make the aircraft over-correct when I let the stick pop back to center. If the aircraft had been circling left with a stick deflection, re-centering the stick will leave the aircraft circling right slowly. I didn't see this behavior when the I-gain was zero.
I am having similar problems with my 50" wing, but in stab or FBW-A mode the wing is self levelling very well, but my control authority is next to nothing or nothing ! I have lowered the P value and increased travel adjust to no avail, any ideas ?
I fiddled with this some more, and I'm starting to think that it is impossible to support both Stabilized mode and FBW modes, as the P-gains seem to have different meanings for the two. I have some experience with some commercial autopilots for aircraft, and with all of them the P-gain for the inner loop provides a surface deflection that is proportional to the rate, however ArduPilot provides surface deflections that are proportional to actual positional angles rather than rates. This is why you have to define a "level" setting for the aircraft, as otherwise trims would get messed up every time you booted. As it is, if the "level" condition varies, trims will be different each time, so it's important to find a consistent level condition.
I was able to tune P-gains for both roll and pitch that provided pretty solid flight in "stabilized" mode. The software implements a large dead-band where the aircraft is unresponsive to stick movements, and it sort of feels like there might be something like exponential, although I already include expo from the Tx, so perhaps that's where it comes from. With full stick roll inputs I can get very aggressive flight (no problem getting upside down), but when I let go of the stick, it immediately pops back to level. My guess is that this was primarily meant for FPV folks that want an exceedingly stable aircraft, but have no interest in aerobatics. I would say this is like "hovering" mode on most quad-rotors. I didn't experiment with pitch a lot, but it seemed that if I pulled back on the stick to climb, the aircraft slowed down. I'll have to go back and look at the log to see if there was any change to throttle. Normally throttle just passes through in this mode.
In FBW-A the P-gains work a little differently - at least on the ground. If you roll or pitch the aircraft, the surfaces deflect proportionally to the displacement from level, the same as in stabilized mode. However, in stabilized mode 100% of the stick motion was passed through to the surfaces, independent of the P-gain, whereas in FBW-A the surface deflections for a given stick motion are scaled by the P-gain as well. If you set the P-gains to zero - not only is there no surface deflection do to pitch/roll motions, but the surfaces do not deflect with the stick either.
I also briefly tried FBW-B. Stick authority was also pathetically weak. The throttle oscillated pretty wildly, but the aircraft was stable. I was flying in quite high and gusty winds (10-20 knots), so it's conceivable that the motor was responding to turbulence. I gave up tuning gains in the wind, so didn't get anywhere with FBW-B other than to verify that throttle and pitch loops were in play.
As I mentioned, all of the commercial autopilots that I've dealt with proportionally map surface deflection to rates rather than absolute angles, and usually include a non-zero I-gain as well, essentially like a heading-hold gyro for a helicopter. I tried adding a roll I-gain for the inner loop, but had odd results. I was able to crank the P-gain to a higher value without going unstable, but in FBW-A mode if I turned left for a while and then released the stick, instead of returning to level flight, it would turn right instead. It seemed that maybe it was trying to unwind the turn back to the original heading, however, the turn rate in FBW-A mode was so slow that I couldn't really wait to see if this happened, as the aircraft was getting too far away.
I aggressively changed the default angles to:
max pitch 45
min pitch -45
max bank angle 50
With that my Bixler 2 can climb out at 45 degrees after take off and do nice turns in FBW (A).
A good "dry" test is to put the plane into FBW and tilt it to the side until the ailerons start to decrease deflection (as the bank angle is reached). You will notice that the ailerons start to decrease quite a bit before the max bank angle is reached. Maybe that deflection is not big enough to keep your plane banked?
With FBW-A, the stabilisation always matches the angle of the wing, ie pitch and roll, always counter acting any control. As the P value is a proportion of the servo travel, increasing the ATV's make no difference to the formula.
I had max pitch & min pitch on 40 degs, although it would correct before reaching 5 degs ??
I have now moved the APM to slower plane. so that i can study the behaviour with more time in hand.
It was quite funny with the wing as i would be pulling hard left to try to get it to come around under FBW, when i shouted, my friend would switch me back to manual, but i forgot to stop pulling left, so a couple of rolls would follow until i realised what was going on. as i say a slow model is ready for more testing.
Read the wiki section here on tuning your aircraft. It specifically talks about how to tune your PID settings starting with stabilize then FBW and progressing to RTL and Auto. The wiki really gives a pretty good guide for tuning and lists the parameters you want to tweak.
I agree that the "stabilise" mode should not be proportional to level, but to rate instead.
I used to have openaero as flight stabiliser before APM, and it did just that.
Now we have 2 modes that are very similar. FBW A and stabilize.
FBWA is just a limited version of stabilise.
I would like to see that stabilize mode is a "rate" stabilisation instead of a level stabilizer. It would make the aircraft much more steady in the wind.
However I don't have any problems with the two modes needing different tuning. I have the same control authority in stabilize as in FBWA
Kevin - you have something wrong. There should be no problem with finding a gain set that is fine for both stabilize and FBW. Keep looking at it.
Check that you don't have a unit/scaling issue with your bank angle limit. I can't remember off the top of my head, but it may be in centi-degrees. You should be able to have the airframe on the ground and give full stick deflection, then manually bank the aircraft and see the ailerons center as the bank angle approaches the max bank value.
Next thing to check would be your radio calibration.
Do you know how to use the tuning graphs in Planner? You can set them up to see the current and commanded bank angle in real time. If you have the max bank set to 45 degrees you should see the commanded bank angle go to 45 when you give full stick deflection, and you should see the actual bank angle tracking the airframe attitude.
I started with 35 degree bank limits (set in the GUI where it appears to be in degrees - appears as 3500 in the parameter table, which I think is in centi-degrees). Actually max allowable bank angle in flight was maybe 4 or 5 degrees with the stick hard over. I'll take a look at the logs and see if I can find a real value. Turn radius was probably 150 to 200m. I tried pushing up the bank limit to 45 degrees, but the actual turn looked about the same. This was using the max P-gain for servo-roll and servo-pitch that the plane could handle in Stabilize mode. I didn't try retuning P-gains in FBW mode, as I thought there use was the same as in Stabilize mode. On the ground, toggling between the two modes at any bank angle results in no change.
It seems a little odd that the stick pass-through is scaled by the P-gain in FBW mode.
I also quickly learned that I need to relax the sticks prior to switching back to manual mode. I plan to move to a slower plane as well. I have a ReadyMade Penguin that will get the ArduPilot next.
I followed the wiki page instructions directly, but still cannot get bank angles remotely close to the set limit. Is there someplace other than the "Navigation Angles" block where this is set? Digging through the forums for FBW-A problems (there are many entries) some indicated that they have set right, center and left bank angles, but I just see the one bank angle setting.
Also, is there anywhere where PWM values to the servos are related to control surface deflections in degrees? All other autopilots I have worked with do this. It is not essential, but if the gains are set with respect to the control surface deflections in degrees rather than to PWM values, it takes the mechanical gain out of the control laws. This, for example, would allow people online to share gain tables with an expectation that they would work.
Doug, as I mentioned in a reply above, I think I have set the limits right, but possibly not. I am using the same P-gains for both Stabilize and FBW-A (I don't think I have a choice on this), and both modes present stable flight with properly tuned P-gains. I set the pitch and bank angle limits in the "ArduPlane PIDs" block "Navigation Angles," but in FBW-A mode I cannot get anywhere near the angle defined with the stick hard over. I believe the GUI presents the angles in degrees, and the parameter table shows them as centi-degrees, so I see 35 in the GUI and 3500 in the table. Does this sound right? A units issue was really my first thought, as it seems to bank on the order of 1/10th the limit. Are the "Navigation Angles" the right place to set this?
I have not played with the tuning graphs in Planner. I'll take a look at that now.