Single Joystick Tank Steering

Posted by Josh at 1/12/2001 7:20 PM EST

Student on team #158, Cobras, from Live Oaks and SDRC.

I have created a way to control a tank-style steering robot with only one joystick and I want to share this with other teams. If you are interested in the PBASIC code for this, please email me with the subject “SJTS” or “Single Joystick Tank Steering” and give me an email address to send it to. Otherwise it will be sent as a reply to the address you used. Please try this. If you like my code, you may use it. Please distribute it to other teams.

Posted by mike oleary at 03/09/2001 4:30 PM EST

Student on team #419, rambots, from bc high and sponsors are overrated…go pocket-change robots!!!.

In Reply to: no, i did not influence him…i have nothing to do with it.
Posted by Anton Abaya on 03/09/2001 11:16 AM EST:

anton-do you think theres any hope for him left? is he done? should we start mourning our lost ninny?
/goes to download the funeral march/

: perhaps my ninniness in some indirect way boggled his brains. i dunno…

: has robotics come to a new low?

: on the other hand, hey hymson, can we raise moolah by doing it? cuz if we can, i’m all for supporting this “i wanna shoot you” boy band :).

: good luck…

: -anton

: ps. Ninnies singing??!?!!?! OMG

Posted by Rick Gibbs at 1/13/2001 7:20 AM EST

Engineer on team #145, T-Rx, from Norwich High School, Sherburne-Earlville High School and Procter & Gamble Pharmaceuticals.

In Reply to: Re: Single Joystick Tank Steering
Posted by Ken Leung on 1/12/2001 11:05 PM EST:

OR use the x-axis to control the angular velocity and use the gyro in a feedback loop to control the output difference between the motors.

Posted by Josh at 1/13/2001 6:14 PM EST

Student on team #158, Cobras, from Live Oaks and SDRC.

In Reply to: Single Joystick Tank Steering
Posted by Josh on 1/12/2001 7:20 PM EST:

The version I currently have of the program comes from
I was creating my own version of this until I found out about this one. I stopped working on my own version because it was a lot longer. Right now, I can send you the one from Innovation First, but not mine because I did not get good test result from using it. The difference between the versions is this: Innovation First’s is less code, but it calculates in a way that goes beyond PWM limits. This was fixed using Min and Max commands. My version would be more accurate and true to the position the joystick is in. It would basically have smoother transitions from full forward to forward and right. The calculations would not need Min and Max commands because they would not exceed the boundaries.

Here is the code from Innovation First.

  1. Start with a FIRST default program from this year. Previous versions of the program may also work.

  2. Declare these variables in the DECLARE VARIABLES section.

PWM1 VAR byte 'define variable for left wheel PWM
PWM2 VAR byte 'define variable for right wheel PWM

  1. Add this to the CUSTOM CODE section

PWM1 = (((2000 + p1_y - p1_x + 127) Min 2000 Max 2254) - 2000)
PWM2 = (((2000 + p1_y + p1_x - 127) Min 2000 Max 2254) - 2000)

  1. If necessary, change the SEROUT command so that PWM1 and PWM2 are in the correct places.

That’s it, you’re done.

If you would like my code, email me in about a week and I should be done with it. When I did my testing, the controls were very touchy going forward, but normal going backward. This was the same for both versions of the SJTS system. This is an indication of a bad potentiometer in the joystick. More testing to come.

Posted by Matt Leese at 1/13/2001 6:34 PM EST

Other on team #73, Tigerbolt, from Edison Technical HS and Alstom & Rochester Institute of Technology.

In Reply to: Re: Single Joystick Tank Steering
Posted by Josh on 1/13/2001 6:14 PM EST:

There are several caveats with the InnovationFIRST supplied program (or at least the one they supplied last year). The way that the robot drives in reverse is non-intuititve. You’d expect that pulling the joystick back and to the left would take the robot in reverse to the left but instead it takes it back and to the right. The same thing happens but in reverse for back and to the right. The solution is to swap the values of the two PWM outputs when the joystick is in reverse (I’ll leave the actual implementation as an excercise to the reader). The other thing is that there’s a real need for a dead zone in the middle of the joystick because otherwise the motors will switch directions quickly and jerkly (a Bad Thing). Those are the two biggest problems with the supplied code. At some point I really should get around to posting a better set of one-joystick drive code.

Matt who’s done robot controls for what he finds to be too many years…

Posted by Josh at 1/16/2001 3:10 PM EST

Engineer on team #419, Rambots, from Wentworth Institute of Technology.

In Reply to: Re: Single Joystick Tank Steering
Posted by Josh on 1/13/2001 6:14 PM EST:

I think sir, that we have a problem in our name…
You see, you seem to have mine…

“Imagination is more important than knowledge” - Einstien