Gyros in Turning Point

What are your thoughts on ways to apply the gyro in this year’s competition, and if it is viable to use one.

My team is using the gyro to rotate the bot so it has a perfect aim at the flags.

It’s certainly viable. Just watch out for going over the parking platforms as well as hitting other robots. But there are a lot of things you can square up against if you need to (those same platforms in addition to the walls).

After experimenting with the gyro, drift makes it difficult to recommend for aiming at flags.

Gyro’s don’t offer a “world coordinate” view of rotation. They drift, just from driving, 1 degree just rolling along in a straight line for about 8 feet. Mounting makes a huge difference on how much drift happens. I’ve had drift cut to 1/3rd with shock absorbers and a very central, low mount.

At a distance of 4 feet, horizontal alignment to within 3 inches or so of the target center requires about 6 degrees of accuracy. This hints it is within the gyro’s limits, but you have test.

The larger the distance, the smaller the angle required for accuracy. At 6 feet, the angle must be within about 3 degrees.

I assume you’re thinking of the autonomous phase for aiming - or are you considering features of the driver phase?

In any event, on a good, standard “tank drive” robot, the gyro proved, in our experiments, to be barely any more accurate than a well tuned function that tracked the distance of wheel travel during a spin. If you’re limiting this to the autonomous phase, that may be worth comparing with your gyro. There is less to interfere with measuring a spin’s rotation by wheel travel than there is with the gyro.

Also of note:

All code I’ve ever seen on the 'net dealing with the gyro’s wrap around has been wrong (this was last year). If you need any help with gyro “interpretation” due to the wrap over zero, let me know.

Gyro’s are best used for relative rotations, completely and utterly ignoring any thought of the gyro holding a “world coordinate” view over time. That is, to use the gyro, the best practice is to note the gyro’s position just before you’re going to turn, use THAT as a zero point, then rotate the bot (or whatever move you’re doing using the gyro) relative to that zero point. This means drift becomes irrelevant. You’re only using the gyro for a turn, basically “zeroing it out” every time you use it.

The problem with Gyros is that the inbuilt integrator for them is not very good, so I would recommend using a only the rate of change of the gyro over a small sampling time, and building your own integrator to track angle yourself. An example of how this can be implemented is in QCC2’s gyro library.

I plan on using my Gyro for some nice SLAM and Odometry. I’m currently in the process of getting a library made

As a team that used gyro sensors for half of the previous season, I do not recommend you to try them. Though the gyro does claim to eliminate drift,it comes with way too many limitations. For example you need to find the perfect space to mount it especially if you want it to be accurate. My team found out that if you mount it near the motors it has this problem where the gyro sensor values in the debugger window fluctuates alot even when the robot is not moving. Also you need to have a 1-2s delay in your program at the start to callibrate the sensor. I suggest using the Optical Shaft Encoders. To eliminate the drift you can slow down the turn before completely stopping. Personally I found that to be better than using purely the Gyro.

Although a gyroscope does have drift, if you make the moves simplistic and minimal, or your robot has times where it does tip or jump while turning, you will tend to have a better time with a gyroscope for turning than shaft encoders.
EDIT//: My robot was 1815D for that season. (Also I have just realized that the announcers almost always swap the last two numbers of my team number. The same thing happened this season during ITZ with 1814D…)

Here is a match of our robot in StarStruck that uses a gyroscope and time, nothing else. This autonomous, when ran, is the most undefeated autonomous at VEX Worlds 2017 in the division. It only had to turn twice, which considering the minimal amount of turns as well as simplistic turns, the gyroscope out-performed a quadature encoder for turning especially with the fact that the robot tips slightly while lifting such a heavy load.
Here’s my thoughts for this season, and after last season when using time and a gyroscope as well:
With more movement that is involved, there’s more room for error. My robot for ITZ could have been more consistent if it didn’t use time because the IME’s didn’t work consistently on my drivetrain. Other than the time factor, I have had a very positive review with the gyroscope and its consistency at turning at the correct angle, as long are you reset the gyroscope before making a turn. Although I will say I have a positive review on the gyroscope and its consistency on my robot, if you’re using more complex movements and turns, that is where I would draw the line and try my best to make the program consider using a gyroscope with shaft encoders for improved consistency, or otherwise not use gyroscopes and go full-on shaft encoders.
Note: After using IME’s for the first time, it had days where it was consistent and days where it wasn’t, so I would HIGHLY suggest not using IME’s if you’re sticking with V4 for this season, and simply use shaft encoders.

“most undefeated autonomous at VEX Worlds 2017 in the division”

After double checking the Engineering division at VEX Worlds 2017, this statement is true. Also there has never been a match that my robot lost an autonomous when that specific autonomous from the video posted above was ran.

I’d say two encoders on their own wheels on opposite sides of the robot are almost always going to perform better than a gyro, no need to worry about drift or any sort of filtering.

My students have had great luck with gyros used in autonomous. To avoid drift my students “put on the brakes” aka run the motors in the opposite direction for a very short time. One of our biggest successes with the gryo was this season… In autonomous another robot crashed into our robot; our wheels kept spinning but the robot was pinned for a few seconds. The program knew that the gryo value wasn’t achieved yet so as soon as it was freed the robot perfectly finished it’s autonomous. If my students had used encoders for that portion of the program then the autonomous would have been completely thrown off due to the wheels spinning.

Will using both Gyro and Optical Shaft Encoders be more precise? Is there a need for a Gyro if we have Encoders?

You’ll need both. Ideally, you’ll use your gyro for rotation, and optical shaft encoders for distance. Sometimes it can be beneficial to combine both as well, especially for turns