Does anyone know how to make a perfect 90 turn using an inertial sensor? (in Autonomous)
depends what you mean by “perfect”
what kind of precision are you looking for?
for most purposes, ± around 5 degrees is perfectly fine. for this you could use some sort of control loop. a p loop is easiest, but doesn’t account for varying resistance to your turn (friction, weight, ect). a pid loop would be best, and would likely get you all the precision you need.
this is a great pid tutorial, and while it doesn’t use an inertial sensor for turning, it does a great job of explaining the loops themselves. You should be able to implement a pid loop using inertial sensor values pretty easily from this tutorial: