First, for my specific problem, we can assume we're working in a 1D space.
I have a point B moving at a specific velocity V. I want to smoothly move the body A so it reaches the point B and moves at the same speed, without oscillating too much. A could be behind or before B.
A is a physic body, on which is applied 2 forces, the thrust and the drag, so I don't directly control it's speed.
I've come to some kind a solution but it's not clean at all and involves a lot of thresholds, so I'm looking for something more clever.
I've already used PIDs to handle steering, and I suspect they may be useful there but for some reason my brain can't find how to properly do it, which annoys me a lot because it looks like a trivial problem.
Thanks.
I'm now trying to get the time it would take for speed to decrease from \$v_0\$ to $v_1$ using only the drag defined as $d(v) = -bv^2$ where $b$ is a constant drag factor. With that I can tell if I'll overshoot or not
This gives me $acc = \frac{dv}{dt} = \frac{-bv^2}{m}$ where $m$ is the mass of the body.
Now I think to calculate the time I need to do something like :
$dt = dv \frac {m}{bv^2} $
$t = \int_{v_1}^{v_0} \frac{m}{b v^2} dv$
Aaand here I'm stuck and not even sure it's right so far
– Toopzor Oct 04 '21 at 09:56