Commit Graph

293 Commits

Author SHA1 Message Date
Peter Barker c69366ac10 Plane: stop using bit-packing for quadplane state 2024-10-08 20:08:55 +11:00
Andrew Tridgell f3b4f8fdc4 Plane: added Q_APPROACH_DIST
this sets a minimum distance to use the fixed wing approach logic. It
is an alternative to just disabling the approach with Q_OPTIONS which
some users do to avoid some short distance problems. This allows the
approach to still be used for longer distances in QRTL but have it
disabled for shorter distances
2024-09-12 20:48:48 +10:00
George Zogopoulos 6fee0eccad Plane: Removed all instances of in_back_transition
It is not currently used anywhere.
2024-08-28 18:18:55 +10:00
George Zogopoulos 3b247a346a Plane: TKOFF_THR_MIN is applied to SLT transitions
Also split in_transition() to forward and backward.
2024-08-28 18:18:55 +10:00
Iampete1 2ee5cdd792 Plane: Quadplane: move Q Assist check into new VTOL assist files. 2024-04-23 09:11:34 +10:00
Iampete1 fbcf37f6ca Plane: QuadPlane: log assistance bitmask in QTUN 2024-04-23 09:11:34 +10:00
Iampete1 3e2a3bfe43 Plane: Quadplane: rework assist to check all types at once, alt and angle get clear delay 2024-04-23 09:11:34 +10:00
Iampete1 8196c899e8 Plane: Quadplane: add assistance reset method 2024-04-23 09:11:34 +10:00
Iampete1 39c86a46e0 Plane: QuadPlane: move assistane into its own class 2024-04-23 09:11:34 +10:00
Paul Riseborough 95fb20dcd5 Plane: Prevent overloading quadplane wing during VTOL braking
Plane: Fix description for TECS_BCK_PIT_LIM

Plane: Add diagnostics logging for VTOL upper pitch limit calc

Plane: Rework "Prevent overloading quadplane wing during VTOL braking"

Implement an independent speed scaler calculation. During VTOL modes the plane surface speed scaler does not follow a 1/IAS function at low airspeed.
2024-02-23 15:26:47 +11:00
Andrew Tridgell 108a0b77bd Plane: Q_ACCEL_Z -> Q_PILOT_ACCEL_Z 2024-01-23 15:00:30 +11:00
Andrew Tridgell 57e88e2242 Plane: Q_VELZ_MAX -> Q_PILOT_SPD_UP and Q_VELZ_MAX_DN -> Q_PILOT_SPD_DN 2024-01-23 15:00:30 +11:00
Andrew Tridgell 2d0a236b49 Plane: Q_LAND_SPEED -> Q_LAND_FINAL_SPD 2024-01-23 15:00:30 +11:00
Iampete1 3e955d12fa Plane: Quadaplane: add helper `allow_forward_throttle_in_vtol_mode` 2024-01-16 11:07:53 +11:00
Iampete1 c98bdd155a Plane: Quadplane: log tailsitter speed scailing in TSIT msg 2023-12-19 11:20:42 +11:00
Iampete1 41f61da0d9 Plane: Quadplane: add `get_throttle_input` method that behaves the same as Plane::get_throttle_input did 2023-11-29 18:15:01 +11:00
Paul Riseborough da595bbf88 Plane: Add protection for failed quadplane forward thrust motor 2023-09-27 11:43:45 +10:00
Andrew Tridgell 573de2fc17 Plane: implement methods for aux switch control of vfwd code
and use a common function for the active method
2023-09-27 11:43:45 +10:00
Paul Riseborough daea00168b Plane: Use Q_FWD_THR_USE parameter to control modes that use Q_FWD_THR_GAIN 2023-09-27 11:43:45 +10:00
Paul Riseborough b3a1807349 Plane: Fix use of q_fwd_nav_pitch_lim_cd class variable 2023-09-27 11:43:45 +10:00
Paul Riseborough e866998b21 Plane: Rename q_fwd_tilt_lim to q_fwd_pitch_lim 2023-09-27 11:43:45 +10:00
Paul Riseborough 2d3431a1ac Plane: Improve use of forward flight motors and tilting rotors in Q modes 2023-09-27 11:43:45 +10:00
Andy Piper f25e67e3eb Plane: add option to scale FF in VTOL modes based on ratio of angle gains 2023-09-13 18:02:44 +10:00
Andrew Tridgell 086d0907dd Plane: fixed TECS state reset in VTOL auto
this fixes a bug where TECS maintains its slow integrator while in a
VTOL hover mode in AUTO or GUIDED.

Among other things this affects PAYLOAD_PLACE and
DO_VTOL_TRANSITION. In those states the height can change while
hovering outside the control of TECS. When TECS regains control in a
fwd transition then can lead to a very large height loss or gain until
the TECS integrator can catch up
2023-07-03 07:03:14 +10:00
Henry Wurzburg 3f7f7cd3a1 Plane:remove duplication in setting servos in MANUAL 2023-06-27 11:04:53 +10:00
Iampete1 74e4466cb4 Plane: use dedicated quadplane function for stick mixing enable 2023-04-25 10:06:50 +10:00
Henry Wurzburg 1415418d6e Plane:Takeoff on rudder arm only after return to neutral 2023-04-25 09:28:45 +10:00
Mirko Denecke eb6c5aa7d3 ArduPlane: remove unused update_transition() definition 2023-04-25 09:10:11 +10:00
Andrew Tridgell 99f997161a Plane: holdoff auto takeoff till rudder neutral
when arming with rudder we need to hold off the takeoff until the user
has released the rudder stick or we can yaw badly during the takeoff
2023-02-09 07:02:32 +11:00
Andrew Tridgell 2989e2deba Plane: added support for NAV_PACKAGE_PLACE mission item
this works in conjunction with a lua script to allow for a wide
variety of package place options
2023-02-09 07:02:12 +11:00
Iampete1 bf9d49b72d Plane: Quadaplane: add param for min QRTL altitude when close to home 2023-01-25 19:34:53 +11:00
Iampete1 a99748a13d Plane: Quadaplane: use land_at_climb_rate_cm only when landing 2022-12-30 20:25:58 +09:00
Peter Hall 148c8d6eec Plane: Quadplane: tiltrotor: add Q_OPTION to keep motors tilted up when disarmed in FW modes 2022-11-29 10:51:23 +11:00
Peter Barker de4dda2d17 ArduPlane: change namespace of MultiCopter and FixedWing params
this stops the libraries knowing anything about AP_Vehicle
2022-11-09 19:04:37 +11:00
Andrew Tridgell 8a0708efe8 Plane: scale VTOL angle P gains with airspeed
During POSITION1 back-transiton we scale the MC angle P gains with
airspeed to reduce the chance of oscillations. At higher airspeeds the
fixed wing controller dominates so we should use the fixed wing angle
P gain.
2022-10-18 07:38:39 +11:00
Michael du Breuil f183b21fc5 Plane: Support vtol landing options on NAV_VTOL_LAND
This allows the same mission to contain both circular and straight
landing items, and doesn't require on the fly tweaking
2022-08-15 17:05:00 -07:00
Iampete1 ee778dbd3a Plane: Quadplane: add option_is_set helper for Q_OPTIONS 2022-08-09 13:21:00 +10:00
Iampete1 821053e580 Plane: Quadplane: allow servo auto trim for motors only tailsitter assist 2022-08-09 10:56:41 +10:00
Andrew Tridgell a1e7072cb1 Plane: cope with overshoot in POSITION1 VTOL land state
when we overshoot run a simple position controller that tries to point
the nose at the landing point and aims for the position2 speed
threshold
2022-08-02 07:49:34 +10:00
Iampete1 2b8958f931 Plane: Fence moved to vehicle 2022-07-27 19:04:56 +10:00
Iampete1 712611c50e Plane: Quadplane: add yaw command model 2022-07-13 18:26:36 +10:00
Andrew Tridgell ae6b877fd3 Plane: added Q_NAVALT_MIN
this is equivalent to copters WP_NAVALT_MIN parameter for takeoff. Not
implemented for land yet

this is useful for vehicles with significant GPS velocity noise on
takeoff, preventing dragging the landing gear
2022-06-03 18:19:53 +10:00
Andrew Tridgell 86c2404654 Plane: increased safety of guided -> auto quadplane takeoff
when we arm in guided mode then enter a special guided_wait_takeoff
state. We keep motors suppressed until one of the following happens

  1) disarm
  2) guided takeoff command
  3) change to AUTO with a takeoff waypoint as first nav waypoint
  4) change to another mode

while in this state we don't go to throttle unlimited, and will refuse
a change to AUTO mode if the first waypoint is not a takeoff. If we
try to switch to RTL then we will instead use QLAND

This state is needed to cope with the takeoff sequence used by QGC on
common controllers such as the MX16, which do this on a "takeoff"
swipe:

  - changes mode to GUIDED
  - arms
  - changes mode to AUTO
2022-05-18 06:43:16 +10:00
Henry Wurzburg 0d01ac389c Plane: add Q_OPTION for RTL always on RC failsafe for ship landing 2022-04-19 19:58:46 +10:00
Peter Barker fd4a00a654 ArduPlane: stop libraries including AP_Logger.h in .h files
AP_Logger.h is a nexus of includes; while this is being improved over
time, there's no reason for the library headers to include AP_Logger.h
as the logger itself is access by singleton and the structures are in
LogStructure.h

This necessitated moving The PID_Info structure out of AP_Logger's
namespace.  This cleans up a pretty nasty bit - that structure is
definitely not simply used for logging, but also used to pass pid
information around to controllers!

There are a lot of patches in here because AP_Logger.h, acting as a
nexus, was providing transitive header file inclusion in many (some
unlikely!) places.
2022-04-08 19:18:38 +10:00
Andrew Tridgell cc6fc2b130 Plane: improvements to POSITION1 controller
this improves 4 things in the POSITION1 controller based on logs from
4.2.0beta2. The changes are designed to increase the tolerance to
an incorrect value for Q_TRANS_DECEL, reducing landing overshoot

1) we fix the initialisation of the acceleration. The
   init_xy_controller() function assumes zero accel, so we need to
   call set_accel_desired_xy_cmss() just after that init to get the
   correct accel. Thanks to Leonard for this fix

2) if we decel more than expected due to too low Q_TRANS_DECEL we
   need to reduce the target speed, rather than putting the nose down

3) lower the default Q_P_JERK_XY to a value more appropriate for most
   quadplanes (Leonard suggested a value of 2)

4) fixed the pitch envelope from Q_BACKTRANS_MS to start after the
   airbrake phase is complete
2022-03-18 13:36:16 +11:00
Andrew Tridgell 5e14b9efe6 Plane: use pos control for most of LAND_FINAL
this gives more accurate landing with some velocity drift
2022-03-10 07:34:20 +11:00
Andrew Tridgell cc9b9813cb Plane: review fixes
thanks Pete!
2022-03-10 07:34:20 +11:00
Andrew Tridgell f9ecf15973 Plane: setup target accel in POSITION1 state 2022-03-10 07:34:20 +11:00
Andrew Tridgell 3fe9a55269 Plane: added APIs for lua ship landing 2022-03-10 07:34:20 +11:00