collision avoidance

Hi, there!!!
I have the trouble in processing collision avoidance.
I wrote the code to fix up the collsiion avoidance by going before next frame.
It works well in the case of fast fps, but not in the case of slow fps.
so i don’t know what i do at this stage.
Please tell me any way to resolve this trouble.
thanks in advance !!!