View Full Version : 1 stick drive to 2 stick drive
wayne 05
05-10-2003, 11:30
it their a way i can make a switchto change between 1 stick drive to 2 stick drive
example:
if the switch is on the robot will use 1 stick drive
if the switch is off the robot will use 2 stick drive
can this be done in p basic:confused:
WakeZero
05-10-2003, 11:48
Of course.
A quick (and not too efficient way) to do it would be,
-------------------
if(switch == 1)
{
drive_onejoy();
}
else if(switch == 0)
{
drive_twojoy();
}
----------------------
switch would be the switch, drive_onejoy() would be a function for driving with one joystick, and drive_twojoy() would be a function for driving with two joysticks ;)
Hardware wise, you could use the throttle on the first joystick as the switch. So past the halfway mark in one direction is one value for switch, and the past in the other direction would be the other value. Let me know if this helps any :yikes:
The above code is in C format btw, not pbasic.
Tytus Gerrish
05-10-2003, 12:02
personaly 2 stick sfor a tank type drive is the way to go over 1 stick, if we had uses two sticks in 2k2 we would have done better
Jeff Waegelin
05-10-2003, 13:11
Originally posted by Tytus Gerrish
personaly 2 stick sfor a tank type drive is the way to go over 1 stick, if we had uses two sticks in 2k2 we would have done better
Not necessarily. I always found 1-stick easier for me to drive. I tended to get confused and disoriented with 2-stick drive, because it wasn't very intuitive to me. Yes, it can give you more control in some situations, but I found it easier to just point and go, when traversing long distances, especially.
KenWittlief
05-10-2003, 13:16
the robot cannot tell if you are using one joystick or two
you can get exactly the same input commands to the robot using either setup of joysticks (0 to 255 on both axis)
so it really comes down to what the driver is use to.
I believe there have been polls taken on this and most teams use one joystick - it requires less coordination between your two hands, it frees up one joystick for another function
its frees up on hand for the driver to use for something else (other input switches, point to the field with his finger, tap someone on the shoulder....)
also, one joystick inputs gives you a command that indicates how much you want to go forwards or reverse, and a seperate command that indicates how fast you want to turn.
This allows you to integrate sensors on your robot in a straightforward manner, like speed limit sensors, or using the yaw rate sensor to measure how fast you are turning
allowing closed loop feedback to be implemented to make the robots movements more stable and predictable. For example, the driver joystick is commanding a right turn at half the max rate, and the yaw rate sensor indicates the bot is turning slower than that, so the 'turn' command is increased to casue the bot to turn faster.
or even better yet, when the driver is commanding the robot to go straight (up the ramp for example) and the yaw rate sensor detects the robot is starting to turn, the feedback loop can keep the robot going straight all by itself.
This sort of thing is not as straightforward if you use two joysticks to steer.
KenWittlief
05-10-2003, 13:22
Yes, it can give you more control in some situations
this is a common misconception. You can get exactly the same set of input signals from either setup
Jeff Waegelin
05-10-2003, 15:14
Originally posted by KenWittlief
this is a common misconception. You can get exactly the same set of input signals from either setup
Well, there are a few differences. Yes, you can get the same signals, but some types of signals are harder to achieve with one stick. The biggest one that comes to mind is driving the left stick all the way, and the right stick none or slightly forward, for a bigger arc. You can do it with one stick, but it's harder to control the amount of arc, because most people don't understand the 1-stick code fully.
KenWittlief
05-10-2003, 19:47
when you are driving, whatever setup you are using to control the bot, you should have enough practice so you are not thinking about where the joysticks are, or what each motor is doing
you should be able to make the bot go where you want intuitively, like riding a bike, or running (you dont think "left foot, right foot, left foot...." when you run)
the biggest control advantage of using only one stick is going straight forward. Its difficult to move two joysticks forward exactly the same amount at the same time, but with one stick its easy.
Frank(Aflak)
05-10-2003, 20:49
Originally posted by KenWittlief
(you dont think "left foot, right foot, left foot...." when you run)
You mean you don't have to think about that . . . . . ?
On topic: One stick/two stick, it all depends on who is driving. I never could control a ground vehicle with one stick because I grew up on flight sims, and the muscle-memory makes it hard to translate pitch/roll into x/y. But thats just me. A kid who gre up playing racing games with a joystick will prefer the one stick style.
Heh, I had an old Landshark remote car, big old 9.6V battery pack, it could go 10mph, and had treads. Sure enough, the controller had two sticks, a left and a right. So thats just how I learned to drive a tank steering chassis, it comes natural to me now.
In the end, the old saying wins out. "Whatever boats your float."
Kevin Kolodziej
06-10-2003, 10:04
As a kid, I grew up playing with games that used only one joystick. When I first drove Hammond's 98 robot on one stick, I almost wiped out the store we were practicing in! I did learn to control it much more easily, but once we hooked things up with two joysticks, there was no turning back for me. Maybe I just never had enough time to practice with it, but I could never achieve the range of arcs with one joystick.
The new WildBeast robot this past year was set up with one joystick for driving and one joystick for activating our articulate treads. This was one difficult machine to get used to, for me at least. But our driver did really well with it. The whole season I tried to get him to use a two joystick configuration just once though. In the offseason, at the Wisconsin State Fair, I believe it was team 357 allowed him to try their robot with two joysticks. He absolutely loved the ease of control and was instantly hooked.
These are my experiences, but your preference is the only thing that matters.
EricS-Team180
06-10-2003, 12:45
One stick vs two sticks became a heated debate for us in 2002. So, we programmed the RC so we could switch between either - on the fly - and turned it loose on a group of experienced and rookie drivers for a "drive-off" Our 'bot that year was a tank treaded, 2-speed, single goal grabber. Everyone got practice time, and then we timed each driver on a course that included a figure 8 around 2 goals, grabbing a goal and moving it to the far side of our shop. As I recall, all except 1 driver turned in the best times using the single stick. Throw in whatever caveats you want to, but we felt that it settled the issue for us.
KenWittlief
06-10-2003, 13:27
EricS - good observation. Its hard to argue with a data-driven analysis.
Gabe Salas Jr.
07-10-2003, 12:08
Manning two joysticks makes you look cool, because using two joysticks is more impressive than just using one. Just messing. It reminds me of manning a mech from some anime, or MechWarrior which is exactly what you are doing at competition. Sorry for going off topic. :p
Mark Hamilton
07-10-2003, 17:10
In my opinion, two stick is the way to go. The closer your controls model the way your robot works, the better. For example, a car uses a wheel and pedal to control it. This is is because a car operates by rotating the wheels, and spinning the wheels at a variable rate. If you robot drives by turning both sides independtly in a tank style drive, why not give your driver a contro system that mimics how the robot will actually react? It might take a little more getting used to, but in the end it is less confusing. No matter what orientation the robot is facing, if the driver is thinking like the robot, he will not get confused. He can think of driving on the robots terms. With a 1 stick drive, he has to interpret the actions he needs the robot to perform into the right joystick movement. As for going straight, with some practice it should not be a problem. If it is, some simple code can fix it, just compare the joystick inputs, and if they are very similiar, interpret them as being equal, giving you a straight line. My message to the programmers on my team when I was driving was always the driver knows best(when it comes to actually controlling the robot). Write code to assist the driver, not try to replace him, or assume he really "meant" to do something else.
Ask me, and I'll say the fewer buttons, sticks and readouts your drivers have to deal with to control the 'bot, the better. Complexity kills. Give the drivers the ability to fully control the 'bot, but as simply as possible.
One stick always felt much better for me. I also noticed that two stick drivers had the tendency to really slam the sticks back and forth, because accelerating evenly was such a hassle. It's easier to just throw both sticks to the stops. One stickers had an easier time of accelerating smoothly, and I'm sure that this translates into longer lives for gearboxes.
Above all else, it is a matter of choice for the driver. It's just that one stick is the right one ;).
-Andy A.
WakeZero
07-10-2003, 20:42
For tank drive, I like having the control of two joysticks. It makes me feel in total control of the robot, and I don't have to think about it ;)
For Swerve however, it's all about one joystick and the ability to say, "I want to go that way!" :yikes:
golf_cart_john
08-10-2003, 21:06
My team likes 1 stick drive, better, but all this debate seems to say that having a switch between the two methods is a good idea. Each driver can drive how (s)he likes.
Anyway, it shouldn't be too hard to switch between the two. Each method can be expressed as two formulas that give left tread and right tread ans a function of input. So, you can have code like WakeZero's code:
if(switch == 1)
{
//one joystick formula
pwm1 = p1_y + p1_x - 128;
pwm2 = p1_y - p1_x - 128;
}
else if(switch == 0)
{
//two joystick formula
pwm1 = p1_y;
pwm2 = p2_y;
}
Those aren't the exact formulas, but it shouldn't be too hard to do if you just use your existing formulas for each type of drive.
Randy_VanW.
01-04-2004, 11:44
Its a two stick drive all the way for me. I find it to be more reactive but harder to control. It also allows for Independant control of both sides which allows for more manuverabilty. That and with a two stick drive it is easier to manipulate the turning radius.
*cough*
This thread is from last year. :)
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.