What methods do other teams use to control the difference in speed between the two sides of your drive train in both autonomous and in teleop?
This year we used encoders to find ratios for each side of the drive train in each direction and scaled the output for each side depending it if the robot was running forwards or backwards. It was decently successful, but I’m wondering if there are better options out there.
We have a ‘drive straight’ method that takes in an encoder distance and runs a PID on it. Part of the processing loop is also a PID on the gyro, which affects turn calculations based upon offsets from the gyro.
In teleop we have the option for a ‘drive straight’ if the driver wants to use arcade mode (toggled via a button) – but that’s driver dependent. Last year it was hugely successful for driving up a bridge; this year it may be useful for driving at something. Otherwise it’s up to the driver to worry about keeping the robot straight via 2-joystick tank drive. That way we always get 100% power forward/reverse when we need it.
The ‘drive straight’ code used to call a ‘turn to angle’ method, but I think the programmers stopped that after week 1. We kept the ‘turn to angle’ method for vision to use. We also may add in buttons on the driver’s joystick so he can turn in 2 or 5 degree increments. This method resets the gyro at the start of every ‘turnTo’ command, so the robot has to be stable for valid data. It takes less than a second and is part of our ‘ready-aim’ sequence.
With direct drive WCD this year there’s much less noticeable lurching of one side instead of the other during drive train takeoff. I attribute that to less backlash in the gears and the much better efficiency overall.
Waiting until week 5 for the first event is making me antsy :ahh:. This drive train will fly once it hits the field.
We researched this. One solution is to make one side the master, and the other the slave.
You drive the master as you would normally, it’s encoder output is the the PID target value for the slave.
Then if the slave is running slower than the master, the PID ensures it speeds up, and vice versa.
I’ve been wondering how exactly this would be done with Mecanum wheels.
make one side the master, and the other the slave
We did something like this for our drive, except for us the master was the motor which spun slowest at full speed and the slave was the fastest motor, so they would occasionally switch while driving.
We are a rookie team and we are trying to use java to program our robot. We are noticing that in both auton and teleop, the robot is drifting. Several of you have mentioned using PID’s and either encoders or gyros. Could someone post sample code of how to do any of the aforementioned solutions for a 6-wheel drive?