Can you make a 100% consistent auton with just encoders? We have been having trouble with our code not being consistent so we are thinking of using encoders but have had lots of trouble with it so if anyone is willing to help it would be great thanks.
100% consistent doesn’t exist but you can get pretty darn close. Also, encoders are very good. You should be using them.
Oh my bad we are already using encoders I meant gyros
Are you entirely meaning gyros instead of encoders as:
“Can you make a 100% consistent auton with just encoders [gyros]? We have been having trouble with our code not being consistent so we are thinking of using encoders [gyros] but have had lots of trouble with it so if anyone is willing to help it would be great thanks.”
If that is what you meant, no, it is not possible. It’s theoretically possible with a combination of accelerometers and gyros, but not with gyros alone. Gyros can keep you going straight and turning an appropriate amount. The problem is that they won’t give you distance, and using a timer doesn’t work nearly so consistently.
But gyros along with encoders work very well. You can also use other sensors, like ultrasonics to measure distances to walls. If you can code all sorts of information in and use it properly, then you have more to work with and make things more consistent.
However, there are ways around this, like driving into a wall for a little while to make sure you’re actually oriented properly. Things like that will allow you to set orientation without sensors.
We are already using encoders but I was asking if you can have a 100% auton with only encoders and I was asking for help on how to code the gyro
Well, as @NightsRosario said, there is no 100%. But you can get pretty close with just encoders. One of the biggest things to keep in mind is that if a wheel loses contact with the surface it’s theoretically rolling across, then the distance its edge moves tangentially is unlikely to match the distance its center travels. Using un-driven wheels on suspensions that keep them touching the floor helps a lot with this. Another thing to keep in mind with rotations is that different parts of the robot moving or picking things up can change the center of mass, which can change how much the robot turns. Consider these and use walls to guarantee certain alignments, and you should be able to get a very consistent autonomous with only encoders.
This can give you a start with gyros:
@dchoi77 Your awesome