|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: Controlling variance in drive train
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 . This drive train will fly once it hits the field.Last edited by JesseK : 22-03-2013 at 11:45. |
|
#2
|
|||
|
|||
|
Re: Controlling variance in drive train
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. |
|
#3
|
||||
|
||||
|
Re: Controlling variance in drive train
I've been wondering how exactly this would be done with Mecanum wheels.
Quote:
|
|
#4
|
|||
|
|||
|
Re: Controlling variance in drive train
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?
|
|
#5
|
||||
|
||||
|
Re: Controlling variance in drive train
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|