Skip to content

Epsilons in PIDLoop and SteeringManager#2810

Merged
Dunbaratu merged 5 commits intoKSP-KOS:developfrom
Dunbaratu:steering_null
Nov 18, 2020
Merged

Epsilons in PIDLoop and SteeringManager#2810
Dunbaratu merged 5 commits intoKSP-KOS:developfrom
Dunbaratu:steering_null

Conversation

@Dunbaratu
Copy link
Member

@Dunbaratu Dunbaratu commented Nov 18, 2020

Fixes #2806 (I Hope). I am merging this in so RO people may be able to test it. I have tested it about as well as I can without RO installed.

The change is mainly that SteeringManager now has an epsilon error amount where it "doesn't care" about the rotational rate being a bit off until later on when it gets closer to the target orientation. If you're trying to rotate at 1 degree per second toward the desired orientation and instead you're rotating at 1.05 degrees per second toward the desired orientation, you shouldn't really care yet about that small difference (and not bother correcting it with precious RCS fuel) until you're very close to the destination orientation.

This is accomplished by adding an epsilon to the PIDLoop structure, then using that epsilon in the PIDLoops the SteeringManager uses, and having the size of epsilon "Lerp" between a max and min value (max when pointed wrong where precision doesn't matter yet, and min when pointed right.)

The default values for these min and max epsilons are chosen arbitrarily and could be adjusted in future PRs if people find them problematic in testing.

While I was in there I also noticed that the existing EPSILON used in the torque pids was so small as to be utterly meaningless, and I increased it a bit, (While also splitting it into two constants because there were two different unrelated things the same EPSILON constant had been used for before, one of which should remain small and the other should not.)

There is also a lot of documentation to go with the changes. If you are trying to test this out, read through the documentation diffs on this PR to see what there is to play with.

@Dunbaratu Dunbaratu added bug Weird outcome is probably not what the mod programmer expected. enhancement Something new (not a bug fix) is being requested documentation Change the Sphinx user documents. labels Nov 18, 2020
@Dunbaratu Dunbaratu merged commit 0a05d71 into KSP-KOS:develop Nov 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Weird outcome is probably not what the mod programmer expected. documentation Change the Sphinx user documents. enhancement Something new (not a bug fix) is being requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cooked steering with Realism Overhaul

1 participant