@TheOtherCliff, thanks for comments, really helpful!
...I don't see that you need to enable TPS (at least in 1609). It does this (create_pid_scaler() in innerloop.c) whether TPS is enabled or not. I guess you have tried it without TPS enabled?
scaler.p = scaler.i = scaler.d = speedScaleFactor;
Absolutely right, the same is in next.711. I must have been sleeping while reading this code section, scaler.x is assigned outside of "if..." section. Shame on me. This means Airspeed PID Scaling can not be switched on and off during flight by switching StabilizationBanks as I initially was planning!
I hadn't noticed negative values for CalibratedAirspeed. Still, when on the ground with no Airspeed, the scale factor should be sticked to ScaleToAirspeedLimits.Max that gives crazy servo reactions even ot small sticks inputs. When airborn, this should not be a problem, I guess. Anyway, I plan to set ScaleToAirspeedLimits.Max to 2 and ScaleToAirspeedLimits.Min to 0.25 for the first tests!
I prefer using a real Pitot tube airspeed sensor instead of software estimated airspeed. It allows using the full functionality of FWPF without the throttle jumps and airspeed warnings you mentioned.
Btw, I encountered idiotic airspeed warnings and throttle jumps even with the analog airspeed sensor in use and it took me some time to find that the issue is caused by the electrical noise from ESC and servos that messes with the ADC readings for the MPXV7002DP sensor. It could be observed watching AirspeedSensor.SensorValue in the scopes while on the ground. Servos in action (by sticks, for example) or full throttle jumps (prop installed on the motor - CAUTION!) SHOULD NOT change noticeably the AirspeedSensor readings.
I had both issues - operating servos was decreasing the AirspeedSensor readings by 15-20, while motor rushes caused jumping it up with 50-70!!
First issue - servos related, happens when servos are powered directly from Revo header pins. Thus, large currents when servos are in action pull up the ground potential at the Revo board and mess the ADC reference voltage. Workaround is simple: power and ground for the servos should be on a separate rail, with 0 and 5V directly connected to the BEC that powers them. Servo signal wires, ESC signal wire and ONLY one GROUND wire should go to the Revo pins header (to additionally avoid ground loops).
Second issue - ESC noise - I had it on the Wing Z-84 that uses 35A LittleBee multirotor ESC, even if the ActiveBraking was disabled. The issue does not persist on MiniTalon that has 45A ZTW Gecko Airplane ESC. I guess that Multirotor ESC is just noisier
The solution there is a tiny LC filter on the power line between Revo and MPXV7002DP board.
With this little engineering workarounds the airspeed sensor gives perfectly clean output!
I've noticed a limitation when using MPXV7002DP analog airspeed sensor and Revo FC. The max output of the sensor (4.75V) exceeeds the 3.3V (max 3.6V permitted) input limit of the Revo ADCs. Although it will probably not damage the STM ADC input (max output current from the MPXV7002DP is only a tiny 0.1mA), it is not possible to use the full speed range of the Airspeed sensor. During tests, the max air speed I've seen on the OSD and in telemetry records later is around 125km/h and depends on the current ZeroPoint. Nevertheless, 0-120+km/h range is quite sufficient for an usual RC plane
...oscillation may be related to servo speed being too slow since you indicate it is not just a mechanical flutter.
Possible. Servos are quite fast though: KST DS213MG digital servos (0.08sec/60°@4.8V,
[email protected]). The same oscillations happened with the little slower Emax ES3352 digitals (0.12sec/60°@4.8V,
[email protected]). No oscillations at all if I switch to manual in that very moment. I still hope that just PID scaling with the higher speed may help.
I keep telling myself that I will go through FWPF one day, including safety margins and cutoff limits and ALtitudeHoldSettings.* and write up user instructions for successful and complete configuration of GPS flight.
I also would like to try a re-write that uses elevator for altitude, and throttle for speed which seems more natural, and would for example handle sonar altitude (quick changes) a lot better. Pull up elevator and you get instant vertical velocity change with decreasing speed. The decreasing speed gets detected and throttle gets added, possibly even add throttle from angle change to delta throttle table. I also like the idea of circling in position hold, rather than randomly flying back and forth. It would appear to be able to hold a tighter position (think between the trees). Also a "tuning flight" that calculates and saves some settings.
+1.
I really miss "Autotune" like mode for the FixedWings and it would be useful to have AltitudeHold in Attitude mode (FBWB mode) one day.