Skip to content

steering manager overshoots when vessel can rotate faster than maxstoppingtime. #2880

@Dunbaratu

Description

@Dunbaratu

A lot of time was spent on tuning the steering manager to handle the case where there isn't much torque capability so the vessel can't rotate fast. But there's a degenerate case on the opposite end of things - when the vessel CAN rotate fast. I've been noticing that if the vessel has the ability to turn so fast that it doesn't need to use all of Max Stopping Time, so to speak, it still does, causing an overshoot.

i.e. say the vessel is capable of flipping all the way around, fully 180, in about 3 seconds. If maxstoppingtime is still set to the default of 2 seconds, it still tries to build up 2 seconds worth of rotational velocity before trying to slow down, meaning it's still trying to speed up the spin even after passing the halfway mark to the target facing. Thus it overshoots the target because it spent more than half the traversal arc accelerating the rotation rate, building up more rotation than it can stop in the remaining arc.

There should be some logic along the lines of this: calculate how much arc it would take to come to a stop (akin to the "stopping distance" calculation for linear motion with constant decelleration, but for angular motion with constant angular decelleration). If less than that much arc is left, don't keep accelerating the rotation, even if we're not at MAXSTOPPINGTIME rotation speed yet.

(i.e. the rotation rate should be capped by either MAXSTOPPINGTIME or by "stopping arc" being too big for how much arc is left, whichever is more limiting.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugWeird outcome is probably not what the mod programmer expected.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions