-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_TECS: scale velRateMin correctly with airspeed #25411
Conversation
0f5e800
to
35d9de4
Compare
What is the repo's guidance for backporting improvements like this? My team is currently running |
@coleschon You explain the testing that was done, but not issue that this fixes. What are the symptoms and how does the fix improve those? RE backporting, we would get it into master first. I don't think this is a critical fix it would not be back-ported but it would be included in the next stable release, 4.5. If you need it on 4.3 you would have to maintain your own branch. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
squash and proper commit message needed
@priseborough can you check this? |
482d5e8
to
3a9bf05
Compare
@IamPete1 I agree that this should use the built-in @Hwurzburg squashed commits and corrected message. |
018e865
to
8ff1746
Compare
f65f838
to
ae6d8d2
Compare
8945ece
to
935284e
Compare
7a046c1
to
1be5e35
Compare
7699bdb
to
bac37b1
Compare
@priseborough Can you take a look at this please, Thanks. |
bac37b1
to
9bb9d82
Compare
032059d
to
f0bfda7
Compare
f0bfda7
to
5d7e49f
Compare
5d7e49f
to
d422abc
Compare
@coleschon Sorry we were so slow getting this in, Thanks for sticking with us. |
This PR improves TECS deceleration rates by allowing to decrease speed more rapidly, the faster a plane is going.
Description
The current calculation for
velRateMin
scales incorrectly with airspeed, where currently, the max allowable velocity rate decreases as velocity increases. i.e. the faster an aircraft is going, the less-quickly it's able to slow down. This is particularly problematic on aircraft which operate over a wide range of speeds or which have a large difference betweenTECS_SINK_MIN
andTECS_SINK_MAX
, since they are empirically determined.This change introduces discrete calculations for:
_STEdot_neg_max
— Specific total energy rate at max speed (usingTECS_SINK_MAX
)velRateNegCruise
— Velocity rate at cruise speed (existing velocity rate calc atTRIM_ARSPD_CM
)velRateNegMax
— Velocity rate at max speed (existing velocity rate calc atARSPD_FBW_MAX
)The change then replaces the
velRateMin
calculation with a linear interpolation between the velocity rates at cruise and max speed, which is capped at those values outside the bounds of cruise and max speed. The deceleration margin is also decreased from 50% to 10% to improve deceleration rate performance.Testing
This change was tested in ArduPilot SITL (Plane-4.3.3) with the following sequence:
MAV_CMD_DO_CHANGE_SPEED
commands to increase and decrease speed setpointMAV_CMD_DO_CHANGE_ALTITUDE
commands to increase and decrease altitude setpointBefore
Notice the blue at line at the top of graph (behind the green) representing
TECS.sp
, this is the plane's airspeed. Before this change, it required just over 6 minutes for the plane to decelerate from 75 m/s to 40 m/s. Extremely slow, and not by limitation of the aircraft — throttle is being modulated to maintain a gradual deceleration.After
Notice again the blue line representing
TECS.sp
. After this change, the plane requires only 40 seconds to decelerate from 75 m/s to 40 m/s.Note: all TECS parameters are identical between runs.
Summary
Here we can see the rates produced from our capped linear interpolation between velocity rate at cruise and max speeds compared against what currently exists.
X 40 m/s =
TRIM_ARSPD_CM
(cruise airspeed)X 80 m/s =
ARSPD_FBW_MAX
(max airspeed)