PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.26k stars 13.41k forks source link

Idle throttle behavior in fixed-wing auto mission mode #19804

Open tstastny opened 2 years ago

tstastny commented 2 years ago

Describe the bug

Not sure if bug.. but certainly the context of this snippet is a bit missing for me. Or possibly an artifact that's been passed along for years and has lost its original intended purpose. Let's decide what behavior is actually desired? :) https://github.com/PX4/PX4-Autopilot/blob/680191cc75fbee28dac9fdc276c9dff7e3a83677/src/modules/fw_pos_control_l1/FixedwingPositionControl.cpp#L924-L932

Current behavior

As written, this means that:

  1. if we get an idle setpoint, the throttle will be commanded to zero (not the idle value specified by param)
  2. if in any other auto mode (except takeoff and landing), and landed, we actually get the idle throttle from the param

Expected behavior

I'm open to thoughts here.. personally I'd think that if we set an idle mode.. that would intuitively tell me that an idle throttle would be set (given that parameter exists). In general if we're landed though.. i dont like the throttle spooling up.. unless we are actually in a launch or takeoff mode.

Recommendation:

  1. set idle throttle when there's an idle setpoint
  2. set zero throttle when landed (and not in a launch or takeoff mode that explicitly asks for idle throttle)

WDYT? @RomanBapst @sfuhrer @dagar @ryanjAA @Jaeyoung-Lim

ryanjAA commented 2 years ago

Ya. This makes a lot of sense. Idle should be idle. Not zero. Good find. Probably exactly that, just inherited over the years.

Thinking of ICE engines, this would be a real problem. It should be whatever you set idle to.

sfuhrer commented 2 years ago

set zero throttle when landed (and not in a launch or takeoff mode that explicitly asks for idle throttle)

That would then kill off ICEs though. I guess the idea was that after landing you leave the motor idling to be able to manually roll back on the runway or so.

Shouldn't the concept be that when ARMED, the throttle output is always constrained to > min(idle_throttle, min_throttle)?

set idle throttle when there's an idle setpoint

When do we need an idle setpoint in the first place?