Commit 64c2e68
Improve APA safety: reduce I-term scaling and maximum gain
Changes to Airspeed-based PID Attenuation (APA) for fixed-wing aircraft:
1. Reduced I-term scaling aggressiveness
- I-term now scales with (apa_pow - 1) instead of apa_pow
- Example: apa_pow=120 → I uses 1.19 exponent vs 1.20 for P/D/FF
- Prevents integral windup and overshoot
- Follows industry best practice (Betaflight, ArduPilot)
- Maintains trim stability across speed range
2. Reduced maximum gain increase from 200% to 150%
- Changed upper constraint from 2.0 to 1.5
- Prevents excessive gain multiplication at low speeds
- More conservative approach reduces control sensitivity spikes
- Still provides adequate authority for slow-speed flight
3. Changed default apa_pow from 120 to 0 (disabled)
- APA now opt-in for safety
- Users must explicitly enable after validating pitot sensor
- Updated description to reflect new behavior
- Safer default for new users
Control theory rationale:
- P/D/FF scaling compensates for dynamic pressure (½ρV²)
- I-term serves different purpose (steady-state trim)
- Aggressive I scaling causes windup and oscillation
- Conservative I scaling improves control stability
Combined with pitot validation (previous commit), these changes
provide comprehensive safety improvements for APA feature.
Addresses GitHub issue #11208
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 490065a commit 64c2e68
2 files changed
+24
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1380 | 1380 | | |
1381 | 1381 | | |
1382 | 1382 | | |
1383 | | - | |
| 1383 | + | |
1384 | 1384 | | |
1385 | 1385 | | |
1386 | | - | |
| 1386 | + | |
1387 | 1387 | | |
1388 | 1388 | | |
1389 | 1389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
449 | | - | |
| 449 | + | |
450 | 450 | | |
451 | 451 | | |
452 | 452 | | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
453 | 468 | | |
454 | 469 | | |
455 | 470 | | |
| |||
535 | 550 | | |
536 | 551 | | |
537 | 552 | | |
| 553 | + | |
538 | 554 | | |
539 | 555 | | |
540 | 556 | | |
| 557 | + | |
541 | 558 | | |
542 | 559 | | |
| 560 | + | |
543 | 561 | | |
544 | 562 | | |
545 | 563 | | |
| 564 | + | |
546 | 565 | | |
547 | 566 | | |
548 | 567 | | |
| |||
560 | 579 | | |
561 | 580 | | |
562 | 581 | | |
563 | | - | |
| 582 | + | |
564 | 583 | | |
565 | | - | |
| 584 | + | |
566 | 585 | | |
567 | 586 | | |
568 | 587 | | |
| |||
0 commit comments