|
Re: 4x4 software differential
Posted by James.
Coach on team #21, ComBBAT, from Brevard Community College and Boeing.
Posted on 11/8/2000 12:45 PM MST
In Reply to: 4x4 software differential posted by James on 11/4/2000 1:27 PM MST:
: I am trying to come up with a single joystick operated 4x4 base that the front wheels are steerable. I have tried tank style single joysitck and doesn't work well. So I need software 'differential.' Both motors going in the same direction, but at different speeds while turning proportional to the radius of the turn. The tighter the turn, the slower(to a point) the inside motor spins. Any thoughts?
: James Rallo
I have figured out a simple little program that does what I needed. Thanks to all. Here it is:
**note: untested in the real world, only tested on computer**
Pwm1 is the right motor
Pwm2 is the left motor
Pwm3 is the steering motor(if using a speed controler)
relay1 is the steering motor (if using a spike)
'---------4x4 differential----------------------------------------------------
If p1_y=127 then notmoving:
adjustrightspeed
If p1_x>138 then adjustright: goto dontadjustright
adjustright
pwm1=(p1_y-(p1_x/19)) min 0 max 254 :goto adjustleftspeed 'adjust the speed of the left wheel
dontadjustright
pwm1=p1_y
adjustleftspeed
If p1_xp1_x then subtract:
If sensor1
__________________
This message was archived from an earlier forum system. Some information may have been left out. Start new discussion in the current forums, and refer back to these threads when necessary.
|