|
Re: Crab Drive Programming!!! HELP!!!!!!!!!
Ok.
First, write up how it should work.
1. Driver pushes joystick in a direction.
2. Robot takes that direction and changes it to an encoder value.
3. Robot turns wheels to that encoder value.
Next, start iterating that write up, adding details as you go.
1. Drive pushes joystick in a direction.
A. How will we measure that angle? (in Degrees)
B. How do we make sure that when the robot turns, we keep track of how much and keep it relative to the joystick? (Gyro)
2. Robot takes that direction and changes it to an encoder value.
3. Robot turns wheels to that encoder value.
Iterate again
1. Drive pushes joystick in a direction.
A. How will we measure that angle? (in Degrees)
i. We can use the labview .vi that changes rectangular coordinates
to polar to give us the angle and magnitude of the joystick.
B. How do we make sure that when the robot turns, we keep track of
how much and keep it relative to the joystick? (Gyro)
i. We'll need to somehow know the angle the robot starts relative to
the field, add that to the gyro, then keep that relative to the
joystick position
2. Robot takes that direction and changes it to an encoder value.
A. Angle / 360 * counts in one rotation of encoder
3. Robot turns wheels to that encoder value.
A. PID loop
This is how I teach our team to program. It's kind of a verbal flowchart, but it helps you think through the program very systematically. If, at any point, you start getting confused on what you need to do, then you probably haven't broken it down far enough.
I am going to warn you though - programming a crab drive is NOT a trivial task by any means. Probably at this point your easiest bet would be to remove one of the globe motors, connect both the front wheels by the same chain so they are turned together, and use one joystick for speed of the wheels, and the other to turn them left/right.
Last edited by Tom Line : 13-02-2009 at 07:56.
|