Right now the way it works is after the boostback burn, the impact position is around 5000m behind the landing pad, the reentry burn simply tries to move this position to only 500m behind the panding pad (booster is aimed retrograde with some lateral control). It shuts down if either, it is less than 500m away from the landing pad or it has less than 400m/s DeltaV of fuel. The remaining distance is covered by aerodynamics.
This works right now because with RTLS landings, the speed at reentry is quite low so the only thing that really matters, once reentry burn is complete, is making sure the booster will impact close to the target.
When landing on a drone ship in the ocean, there will be another thing to worry about. The reentry heating and forces which can tear the rocket apart if it's going too fast.
I think the best way to solve this problem will be to calculate based on the velocity, how much delta-v can be spent on reentry (leaving enough for landing) and creating a maneuver node with that much delta-v. The maneuver node would have the rocket point in a direction that would make the impact position close to the target. If the current impact position is far from target the rocket would need to mostly cancel out its horizontal velocity but if the the impact is close to the target, it would mostly need to cancel out vertical velocity. So in both cases, it would use the same amount of delta-v but it would still impact close to target.
Re-entry burns really need some work.
Right now the way it works is after the boostback burn, the impact position is around 5000m behind the landing pad, the reentry burn simply tries to move this position to only 500m behind the panding pad (booster is aimed retrograde with some lateral control). It shuts down if either, it is less than 500m away from the landing pad or it has less than 400m/s DeltaV of fuel. The remaining distance is covered by aerodynamics.
This works right now because with RTLS landings, the speed at reentry is quite low so the only thing that really matters, once reentry burn is complete, is making sure the booster will impact close to the target.
When landing on a drone ship in the ocean, there will be another thing to worry about. The reentry heating and forces which can tear the rocket apart if it's going too fast.
I think the best way to solve this problem will be to calculate based on the velocity, how much delta-v can be spent on reentry (leaving enough for landing) and creating a maneuver node with that much delta-v. The maneuver node would have the rocket point in a direction that would make the impact position close to the target. If the current impact position is far from target the rocket would need to mostly cancel out its horizontal velocity but if the the impact is close to the target, it would mostly need to cancel out vertical velocity. So in both cases, it would use the same amount of delta-v but it would still impact close to target.