Commit Graph

5032 Commits

Author SHA1 Message Date
abaghiyan
26cbdd9a4c Plane: Fixed formula for load factor
In general when there the pitch and roll exist the formula for the aerodynamic load factor should be as follows:
aerodynamic_load_factor = cosf(radians(_ahrs.pitch))/cosf(radians(demanded_roll));
which in case of turns (in the horizontal plane) becomes
aerodynamic_load_factor = 1.0f/cosf(radians(demanded_roll));
formulas can be obtained from equations of balanced spiral:
liftForce * cos(roll) = gravityForce * cos(pitch);
liftForce * sin(roll) = gravityForce * lateralAcceleration / gravityAcceleration; // as mass = gravityForce/gravityAcceleration
see issue #24320 [#24320].
To connect loadFactor to airspeed we can use formula of balancing between lift force and gravity force:
liftForce = loadFactor * gravityForce; on the other hand lift force can be expressed as
liftForce = 0.5 * lifCoefficient * airDensity * sq(airspeed) * referenceArea; minimum airseepd is at loadFactor = 1
and lift force only balances the gravit force, so gravity force (which is same as lift force at minimum airspeed) with minimum airspeed can be expressed as
gravityForce = 0.5 * lifCoefficient * airDensity * sq(airspeed_min) * referenceArea; substituting gravit force in previous formula gives us
0.5 * lifCoefficient * airDensity * sq(airspeed) * referenceArea = loadFactor * 0.5 * lifCoefficient * airDensity * sq(airspeed_min) * referenceArea;
from where we get:
loadFactor = sq(airspeed / airspeed_min);
These changes also require changes in ardupilot/libraries/AP_TECS/AP_TECS.cpp
Line 418 (according to the comments by Peter Hall): _TASmin *= _load_factor; should be changed to _TASmin *= safe_sqrt(_load_factor);

See details here: #24320
2025-02-18 10:53:06 +11:00
Randy Mackay
1f3279c1bd Plane: 4.6.0-beta4 release notes 2025-02-17 20:40:13 +09:00
Iampete1
aef376f1c7 ArduPlane: move from MAV_MODE enum to uint8_t 2025-02-17 17:20:24 +11:00
Henry Wurzburg
89c46e3515 ArduPlane:add AUTOLAND metadata to FS_LONG_ATCN 2025-02-12 11:01:23 +11:00
Peter Barker
bf17b1d9a3 Plane: correct abs function used for integer 2025-02-11 11:54:52 +11:00
Henry Wurzburg
54eb396e23 ArduPlane: remove unused verify_RTL code 2025-02-11 11:23:35 +11:00
Henry Wurzburg
3093532d78 ArduPlane: add climb before turn to AUTOLAND
Co-authored-by: IamPete1 <iampete@hotmail.co.uk>
2025-02-11 11:16:33 +11:00
rubenp02
a1a0fc4a70 Plane: Add fwd. throttle cutoff voltage parameter
Updated the forward throttle battery voltage compensation feature to
disable the throttle entirely when the sag-compensated voltage drops
below the new parameter FWD_THR_CUTOFF_V.

Key changes:
- Added new parameter FWD_THR_CUTOFF_V to control the voltage threshold
  for this feature. The default value of 0 matches the original behavior
  of never cutting the throttle due to low voltage.
- Modified forward throttle battery voltage compensation logic in the
  servos code to cut off the throttle in auto-throttle modes if the
  resting voltage estimate of the FWD_BAT_IDX battery is under
  FWD_THR_CUTOFF_V.
2025-02-11 10:53:49 +11:00
Iampete1
cc00276441 Plane: Quadplane: only log TILT on tiltrotors 2025-02-10 23:16:53 +00:00
Henry Wurzburg
1774bd9ef9 ArduPlane:add missing flight mode metadata 2025-02-09 14:21:25 +00:00
Peter Barker
cdfe93918a Plane: remove dead store of cruise_speed
../../ArduPlane/quadplane.cpp:4260:15: warning: Value stored to 'approach_speed' during its initialization is never read [deadcode.DeadStores]
        float approach_speed = cruise_speed;
              ^~~~~~~~~~~~~~   ~~~~~~~~~~~~
1 warning generated.
2025-02-04 11:34:39 +11:00
Henry Wurzburg
a2ca9be645 Plane:adjust CTUN.Pitch to remove PITCH_TRIM 2025-02-04 11:29:06 +11:00
Iampete1
e5efe490d9 Plane: takeoff: use tkoff_option_is_set helper 2025-02-03 10:14:00 +00:00
Iampete1
3e37b01e35 Plane: remove unused method set_target_altitude_current_adjusted 2025-02-03 10:14:00 +00:00
Iampete1
4ddd78e310 Plane: plane.h: remove unused definitions 2025-02-03 10:14:00 +00:00
Peter Barker
d322c33169 ArduPlane: rename SRV_Channel::Aux_servo_function_t to SRV_Channel::Function 2025-01-28 21:56:46 +11:00
Peter Barker
302040dcb0 ArduPlane: remove vestiges of LearnType::LEARN_INTERNAL
57a3bc1397 changed the code from "internal" to "in-flight

It seems the old value of "1" was no longer valid

It also changed things to that the learning system saved the offsets.
2025-01-28 12:23:53 +11:00
Peter Barker
1ed2e54269 ArduPlane: adjust for AP_Arming file rename 2025-01-28 10:56:26 +11:00
Peter Barker
df0ac10535 Plane: rename AP_Arming libraries for vehicles to AP_Arming_VEHICLENAME 2025-01-28 10:56:26 +11:00
Iampete1
dce82bc97c Plane: commands: remove unneeded write of home to storage 2025-01-28 10:30:06 +11:00
Randy Mackay
8e4179cc9d Plane: 4.6.0-beta3 release notes 2025-01-27 14:25:33 +09:00
Peter Barker
1deea810e8 ArduPlane: move to a uint32_t motor mask 2025-01-27 14:03:41 +11:00
Henry Wurzburg
010e6ba0b0 ArduPlane: mode AUTOLAND enhancements
Co-authored-by: Andrew Tridgell <andrew@tridgell.net>
Co-authored-by: Pete Hall <iampete@hotmail.co.uk>
2025-01-21 11:30:23 +11:00
Yury MonZon
ada4afa88f AP_Tuning_Plane: Added PIDFF tuning sets 2025-01-21 11:19:37 +11:00
Peter Barker
1418935c87 ArduPlane: allow for more than 327m range rangefinders 2025-01-21 10:54:05 +11:00
Peter Barker
fadc293867 Plane:remove stale conversion code
these lines are all present in 4.0.0.

Past this PR we won't convert PIDS correctly if someone attempts to upgrade to 4.7+ from 3.x
2025-01-14 11:46:35 +11:00
muramura
66da902442 Plane: fix param increment description 2025-01-13 20:33:33 +09:00
Henry Wurzburg
055c6242f6 ArduPlane:bug fix 2024-12-31 09:18:49 +11:00
Andrew Tridgell
3647c67e73 Plane: added base leg WP to autoland
this gives a cleaner landing, keeping the plane in the part of the
field where the pilot is currently flying
2024-12-31 09:18:49 +11:00
Henry Wurzburg
32f5afb22a ArduPlane: add AutoLand fixed-wing mode 2024-12-31 09:18:49 +11:00
Ryan Friedman
ee5d87f995 ArduPlane: reserve offboard mode ID
Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
2024-12-27 07:15:31 +11:00
Peter Barker
edc812d7f5 ArduPlane: adjust for renaming of RC_Channel and GCS_MAVLink headers 2024-12-26 11:01:22 +11:00
Peter Barker
f00e14900d ArduPlane: make RC_Channel and GCS_MAVLink filenames consistent 2024-12-26 11:01:22 +11:00
Peter Barker
94eaa71182 ArduPlane: correct comments for ArduPlane.cpp rename 2024-12-24 12:26:42 +11:00
Peter Barker
073edac6ee Plane: rename ArduPlane.cpp to Plane.cpp 2024-12-24 12:26:42 +11:00
Peter Barker
9b96ae7811 Plane: merge Plane.cpp into ArduPlane.cpp 2024-12-24 12:26:42 +11:00
Iampete1
2ff877688a Plane: set source index when running aux functions 2024-12-24 11:34:07 +11:00
Iampete1
9f29cb0fba Plane: RC_Channel: pass trigger object onto ICE 2024-12-24 11:34:07 +11:00
Iampete1
f7c4320e86 ArduPlane: move to AuxFuncTrigger structure 2024-12-24 11:34:07 +11:00
Iampete1
cc0f3f2915 Plane: do_aux_function call ice_control.do_aux_function 2024-12-24 11:34:07 +11:00
Henry Wurzburg
223d683441 ArduPlane: update FS actions metadata with DO_RETURN_PATH_START 2024-12-17 09:34:49 +11:00
George Zogopoulos
4c335e89a0 Plane: Pass external HAGL to TECS 2024-12-15 10:42:32 +11:00
Randy Mackay
b5c108c223 Plane: 4.6.0-beta2 release notes 2024-12-12 15:15:44 +11:00
Andrew Tridgell
42ad2a7911 autotest: added non-compass takeoff test 2024-12-11 08:44:15 +11:00
Andrew Tridgell
c15fa7b943 Plane: fixed takeoff direction with no yaw source
in TAKEOFF mode with either very poor yaw source or no yaw source we
need to use ground vector and wait for sufficient ground speed
2024-12-11 08:44:15 +11:00
George Zogopoulos
9a5f81aa95 Plane: Added check for takeoff level-off timeout
When an airspeed sensor is not used, during a takeoff, the pitch angle
is asymptotically driven to 0 as the takeoff altitude is approached.
Some airplanes will then stop climbing and fail to reach altitude.

To prevent an indefinite wait for the takeoff altitude to be reached, a
dedicated level-off timeout has been introduced.
2024-12-04 18:07:30 +11:00
Iampete1
a79fcdbfcd Plane: support DO_RETURN_PATH_START misison item and command 2024-12-03 10:31:02 +11:00
George Zogopoulos
2f9ff3ef73 Plane: Call new TECS method in case of altitude change 2024-11-27 19:35:03 +11:00
Michelle Rossouw
43fdc9ce19 Plane: Added Quicktune
replaces QAUTOTUNE in default build
2024-11-27 14:07:38 +11:00
Iampete1
52efe952cd Plane: slew limit all throttles in one place 2024-11-19 11:04:37 +11:00