Go to Post A challenge to those of you grumbling about the refereeing this year: Be a referee next year. - Alan Anderson [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rating: Thread Rating: 3 votes, 4.67 average. Display Modes
Prev Previous Post   Next Post Next
  #25   Spotlight this post!  
Unread 23-03-2011, 15:40
maleche maleche is offline
Senior Engineering Program Manager
no team
 
Join Date: Mar 2011
Rookie Year: 2004
Location: Washington State
Posts: 1
maleche is an unknown quantity at this point
Re: Single Joystick Tank Drive

This is a great subject. I am working on the same concept using Visual Basic. I have a scaled Picture box with -128,128, 128,128 set as the scaled box points. Center is 0 (zero) with adjustable deadbands in both X & Y centered.

Moving a joystick OR mouse sends the Xj, Yj or Xm, Ym directly to the motor controller, after calculations.

I am using pythagorean for vector speed (Vel) based on joystick/mouse angle and distance from center. This works great in direct Y and -Y vectors ( both treads move at same speed and direction). -X, X will rotate Left and Right tank treads in opposite directions at equal speed. When steering slightly left and forward (Xj=-20, Yj=50) the total vector is the Sin(Angle)* Vel. This does well when transitioning from full forward to left/right steering. I'm still working out some bugs. I have not considered Tan2 yet or using a Gyro to steer by. The motor controller is a Sabertooth 2x50 and using 0-127 as speed with direction tokens.
One thing to consider however, is when going from full forward to all-stop. This can tip the robot or cause problems with stability. I programmed a ramp-down speed Vel=Vel-ramp^2. this allow VERY smooth and quick stopping transitions.
Keep in touch!
Doyle
Reply With Quote
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 13:15.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi