How to calibrate the inertial sensor for the best turning

My inertial sensor can sometimes don’t turn truly, like i want to turn my drivetrain 90 degrees but for the inertial sensor movement, it turns 95 or 100 degrees

How fast are you turning (turn velocity) and how much time are you giving the robot to complete the move (timeout)?

Try starting slow and give your robot plenty of time to complete the move. Continue to speed up the turn until you lose too much accuracy - it’s a tradeoff.