![]() |
Re: Unique ways of controlling your robot (driving)
Quote:
Stiffer springs in the joystick would have helped, but we moved onto a different control system that has helped our omni-drive bots win regionals in back-to-back years. Left stick: Y axis is forward/backward X axis is turning (e.g. single stick drive with a skid-steer bot) Right stick: Y axis does nothing X axis strafes It seems unintuitive on paper, but if you have experience driving skid-steer bots with a single stick, it lets you transfer that knowledge while allowing you to strafe when needed. |
Re: Unique ways of controlling your robot (driving)
Quote:
|
Re: Unique ways of controlling your robot (driving)
Quote:
We don't translate at angles very often anyhow - the nature of our drive geometry is designed to strongly favor the cardinal directions. |
Re: Unique ways of controlling your robot (driving)
Part of training drivers is giving them multiple options to steer the bot. We programmed our controller so if you hit a button, it switches between different drive modes. This made it so anyone could practice any mode they wanted to just by hitting a button, not by reprogramming the robot.
One reason why I made this thread was also show off their actual programming for controlling their bots. I'm very interested in what other programmers decided to do. I've always liked unique ways of doing things, not for the sake of being different, but being inovative. Inovation means something new and because I'm new to programming new is all I know. If anyone is willing to explain or share their code so I can study it and learn from what other people do, that would be great. The drive mode my team uses in the competition was developped from an algorithm. When I was thinking of better ways of controlling the bot, I thought a single joystick mode would be definately better than the 2 joystick tank control. I like algoritms better than plotting points on the joystick. It's more clean in my opinion and easier to reprogram. I thought of how the robot should moving according to the position the joystick is in. If I push it forward, it goes farward. The more I push farward the faster it should go. What if I push the joystick diagnal so it's in the top left corner? I think the robot should turn gradually left in a wide arc. So, I looked at motor speeds and plotted them onto a graph. forwards (255, 255) backwards (0,0) arc left (127, 255) arc right (255, 127) 255 the motors will be spinning full clockwise. 127 the motors will not be spinning. 0 the motors will be spinning full counterclockwise. And so on... I eventually discovered a cool way of doing this based on this... On the joystick y-axis would run from bottom to top where bottom is 0 and top is 255. On the joystick x-axis would run from left to right where left is 0 and right is 255. leftMotors = -127 + (y-axis + x-axis) rightMotors = -127 + (y-axis + oposite of the x-axis (x-axis mirrored)) oposite of the x-axis means that if on the x axis it were really 255, it would count as 0 in the code. |
Re: Unique ways of controlling your robot (driving)
Quote:
Please keep in mind that I am not intending to bash any single joystick control system or any other very innovative control systems. I am only stating how we have done our robots in the past and the reasons behind our choices. |
Re: Unique ways of controlling your robot (driving)
Quote:
I preferred the airplane mode. Everyone else liked tank mode best. Quote:
|
Re: Unique ways of controlling your robot (driving)
Is it really? I understood what it did, just not the logic behind it. How did they get those numbers? And by cool, I meant neat 8} not cool like "that's not what coool people do". Actually, I think we did try that code, but for some reason the controls were a bit different.
|
Re: Unique ways of controlling your robot (driving)
My favorite control setup is where you have a wheel and a throttle stick. The wheel controls turn radius not difference in power or something like that. The throttle stick is used to give the bot forward velocity. To deal with the fact that you can't do an in place turn that way, we have a button that you press to turn in place.
We currently implement this with motor power only, but I would like to implement it in using a PID controller. I just haven't been able to put good enough sensors on our bot to achieve that. Not enough resolution on the quadrature encoders. |
Re: Unique ways of controlling your robot (driving)
Quote:
Code:
pwm13 = pwm14 = Limit_Mix(2000 + p1_y + p1_x - 127);The first line adds the x and y values, correcting the offset so that when both inputs are neutral (127) the sum is also neutral. The second line does the same thing as the first, but it "mirrors" the x value by subtracting it from 254 first. Then it obscures that step by combining the new +254 and the -127 from the first line into a single +127. |
Re: Unique ways of controlling your robot (driving)
Weird, it's mine exact. Wonder why it didn't seem the same when I was controlling it.... I guess I feel a bit stupid recreating the code that was right infront of me. What I don't understand is where is the code that says if(x-axis + y-axis < 0) motors = 0 or there the other way around if it's more than 255?
|
Re: Unique ways of controlling your robot (driving)
Quote:
|
Re: Unique ways of controlling your robot (driving)
I don't have the code infront of me, and I don't remember its full content, but yes I understand what it does.
|
Re: Unique ways of controlling your robot (driving)
Quote:
It has worked pretty well for us, barring some mechanical problems. Here is some example code because Our forum is going through overhaul and I REALLY don't like the code blocks there. too hard to read. Code:
/*!You can check it out more here: http://team1675.org/forum/viewtopic....start=15#p1352 (Out website is in overhaul so it may be a little funky.) Feel free to ask me any questions! |
Re: Unique ways of controlling your robot (driving)
I started driving 395's 'bot at the end of the Florida regional. We used to run a single joystick for our tank drive (Y did forward and backwards, X did pivots). I wasn't too fond of the very limited maneuverability the system provided though, so now we've gone dual joystick (using only Y axis to control the forward and backwards of each tread.) It's much more effective in my opinion. Although I always wanted to try a game controller, since I'm an avid Xbox player, and I think it would make the transition from racing game to robot racing easier.
|
Re: Unique ways of controlling your robot (driving)
We have switched between 1 and 2 several times:
2002 - 1 2003 - 2 2004 - 1 2005 - 1 2006 - 2 2007 - 2 2008 - 2 and Steering Wheel We really liked the way it worked this year, we tried 1 with steering wheel, but you have more control we feel with 2 joysticks, so one driver had the steering wheel and other had the 2 joysticks. They really had to communicate well, which they did. The steering wheel was used mainly to help get out tight places and to turn left sharper, in both cases it proved to be the best solution for our particular bot as we consistently would get 5-7+ laps after the auto period. |
| All times are GMT -5. The time now is 04:38. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi