I'm a software engineer myself so I don't know a lot about this, but there are a few patterns that are not far off of what you're describing. For instance:
https://en.wikipedia.org/wiki/Input_shaping https://en.wikipedia.org/wiki/Proportional%E2%80%93integral%...