Go to Post Students, mentors, schools, corporations, teams, and communities - they are all critical to the success of FIRST. . - dlavery [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 22-08-2004, 18:21
generalbrando's Avatar
generalbrando generalbrando is offline
Build, Break, Repeat
AKA: Brandon Mensing
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2001
Location: Boston, MA
Posts: 366
generalbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to behold
Send a message via AIM to generalbrando
A Simple Improvement to Driving

This may be common knowledge, but I couldn't find it searching, so I post away.

Our drive train (basic tank drive, two joy sticks) is very powerful but unbalanced because it's us building it. We put a large caster on the back recently to make it drive on any demonstration surface. When driving it now, you have to be a good driver to control it because there's a bit of swerving, requiring lots of correction. I'm used to this because that's how all the bots I've driven have been, but I wanted to fix this.

My thought was to program it so it would go straight easier and be more intuitive for new drivers. Here's what I thought of: (in non-tech terms so all crowds can enjoy )

Find the average of the two y values of the joy sticks. This is half way between each of them, reguardless of which one is greater. Now average each y value with the average. Those two averages will be 1/4 way from the original values toward the other joy stick. The result, if you can visualize, is that if you push both sticks forward, but you don't do it in perfect sync, the program will minimize the difference and the robot will go straight forward instead of swerving a lot.

For the techies:
pwm01=(p1_y+((p1_y+p2_y)/2)/2)
pwm02=(p2_y+((p1_y+p2_y)/2)/2)

A fun result is that if you push one joy stick, both wheels move and you get a very smooth curve. I found in testing however that if you push one stick far enough, the other wheel will stay still because there is too much torque needed to push out of the spin(?). This may just be an oddity of our drive train though.
__________________
Lead Mentor of Team #246, Boston University Academy and Boston University, Overclocked
www.burobotics.org

  #2   Spotlight this post!  
Unread 27-08-2004, 22:24
Andrew Schuetze's Avatar
Andrew Schuetze Andrew Schuetze is offline
499 Founder / Alamo FTC & FLL AP
no team
Team Role: Leadership
 
Join Date: Jan 2002
Rookie Year: 2001
Location: San Antonio, Texas
Posts: 689
Andrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond reputeAndrew Schuetze has a reputation beyond repute
Thumbs up Re: A Simple Improvement to Driving

[quote=generalbrando]This may be common knowledge, but I couldn't find it searching, so I post away.



Those two averages will be 1/4 way from the original values toward the other joy stick. The result, if you can visualize, is that if you push both sticks forward, but you don't do it in perfect sync, the program will minimize the difference and the robot will go straight forward instead of swerving a lot.

For the techies:
pwm01=(p1_y+((p1_y+p2_y)/2)/2)
pwm02=(p2_y+((p1_y+p2_y)/2)/2)

I have not seen this posted before but have not looked at drive algorithms much in the past. I appretiated your program line codes as the paragraph description then made sense.

Question: What is the result with one stick full forward and the other full reverse? Does it still do a zero degree spin albeit just slower? The spin factor in a traditional tank steer is where a lot of loss of control causes problems. The other being the swerving during a forward motion that you mentioned.

Checking my logic, both sticks in maximum deflection in the same direction results in the averages being the actual stick positions??


Thanks for posting,

APS
__________________
APS

Founder FRC 499
Parent alumni FRC 2745 & 4219
Co-Coach FTC 4549 & 6407
Alamo FTC Affiliate Partner
Alamo FLL Affiliate Partner
  #3   Spotlight this post!  
Unread 27-08-2004, 23:08
Tytus Gerrish's Avatar
Tytus Gerrish Tytus Gerrish is offline
IGAB, ADHD, and Dislexic
AKA: Ty
FRC #0179 (SwampThing)
Team Role: Tactician
 
Join Date: Feb 2003
Rookie Year: 2001
Location: West Palm Beach, Florida
Posts: 2,017
Tytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond reputeTytus Gerrish has a reputation beyond repute
Re: A Simple Improvement to Driving

why dont you just practice driving? that always seems to be the best way for new drivers to get better
  #4   Spotlight this post!  
Unread 27-08-2004, 23:47
J Flex 188's Avatar
J Flex 188 J Flex 188 is offline
"flock their sheep"
AKA: Jeffrey Li
FRC #2505 (The Electric Sheep) & FRC #0188 (Blizzard)
Team Role: Coach
 
Join Date: Feb 2003
Rookie Year: 2003
Location: Toronto
Posts: 457
J Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond reputeJ Flex 188 has a reputation beyond repute
Send a message via ICQ to J Flex 188 Send a message via AIM to J Flex 188
Re: A Simple Improvement to Driving

sometimes there just isnt time before shipping day or not enough resources to build a second practice platform =T. practice can definitely come in the practice rounds on thursday
__________________

Woburn Robotics, Class of 2005.
  #5   Spotlight this post!  
Unread 28-08-2004, 01:05
generalbrando's Avatar
generalbrando generalbrando is offline
Build, Break, Repeat
AKA: Brandon Mensing
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2001
Location: Boston, MA
Posts: 366
generalbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to behold
Send a message via AIM to generalbrando
Re: A Simple Improvement to Driving

My thinking exactly. Back in Hammond I was backup driver to the awesome Kevin (bow). Even as backup I drove many many hours and now I can still drive well enough to make it look easy.

My team this past year only got about....an hour? We didn't have time to drive it much considering it didn't move until week 4 or 5 (next year will be better!).

Another thought was that when doing demonstrations, it's great to reel people in by letting them drive a little. Usually they fly all over and get nervous and it gets worse. Compensations like this should help that.

Another simple improvement I tried out - find the absolute value of the difference between the two sticks. If it's less than a specified constant (let's say 15) then average the sticks and send that out to the motors. That way when they are very close to the same value, the robot will in face drive forward.
__________________
Lead Mentor of Team #246, Boston University Academy and Boston University, Overclocked
www.burobotics.org

  #6   Spotlight this post!  
Unread 28-08-2004, 01:13
generalbrando's Avatar
generalbrando generalbrando is offline
Build, Break, Repeat
AKA: Brandon Mensing
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2001
Location: Boston, MA
Posts: 366
generalbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to behold
Send a message via AIM to generalbrando
Re: A Simple Improvement to Driving

[quote=Andrew Schuetze]
Quote:
Originally Posted by generalbrando
This may be common knowledge, but I couldn't find it searching, so I post away.



Those two averages will be 1/4 way from the original values toward the other joy stick. The result, if you can visualize, is that if you push both sticks forward, but you don't do it in perfect sync, the program will minimize the difference and the robot will go straight forward instead of swerving a lot.

For the techies:
pwm01=(p1_y+((p1_y+p2_y)/2)/2)
pwm02=(p2_y+((p1_y+p2_y)/2)/2)

I have not seen this posted before but have not looked at drive algorithms much in the past. I appretiated your program line codes as the paragraph description then made sense.

Question: What is the result with one stick full forward and the other full reverse? Does it still do a zero degree spin albeit just slower? The spin factor in a traditional tank steer is where a lot of loss of control causes problems. The other being the swerving during a forward motion that you mentioned.

Checking my logic, both sticks in maximum deflection in the same direction results in the averages being the actual stick positions??


Thanks for posting,

APS
Well if you work through the math, it should be 0 and 256 averaged=128. Then average between that and the originals...64 and 194. Technically 127 is center (right?) so that's a tiny bit off, but the results is a slower spin. I thought there might be a quirk where I would need to handle an exception for such a thing like this, but in testing, I found it works fine all around.

Am I making sense? (it's 1am and my brain took the weekend off several hours ago).
__________________
Lead Mentor of Team #246, Boston University Academy and Boston University, Overclocked
www.burobotics.org

  #7   Spotlight this post!  
Unread 02-12-2004, 09:49
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
Lightbulb Re: A Simple Improvement to Driving

would it be better to do this.

Code:
pwm01=((p1_y+((p1_y+p2_y)/2))/2)
pwm02=((p2_y+((p1_y+p2_y)/2))/2)
this way the value is a little closer to the appropriate y-value for the port,
but it still compensates for the difference between the 2 pwms.
  #8   Spotlight this post!  
Unread 02-12-2004, 20:09
Jaine Perotti Jaine Perotti is offline
...misses her old team.
AKA: BurningQuestion
FRC #0716 (The Who'sCTEKS)
Team Role: Alumni
 
Join Date: May 2004
Rookie Year: 2003
Location: Melbourne, FL
Posts: 979
Jaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond reputeJaine Perotti has a reputation beyond repute
Send a message via AIM to Jaine Perotti Send a message via MSN to Jaine Perotti Send a message via Yahoo to Jaine Perotti
Re: A Simple Improvement to Driving

Quote:
Originally Posted by generalbrando
Well if you work through the math, it should be 0 and 256 averaged=128. Then average between that and the originals...64 and 194. Technically 127 is center (right?) so that's a tiny bit off, but the results is a slower spin. I thought there might be a quirk where I would need to handle an exception for such a thing like this, but in testing, I found it works fine all around.

Am I making sense? (it's 1am and my brain took the weekend off several hours ago).
generalbrando,

I like your ideas.

However, the one thing that came to my mind was this slow turn that you mentioned above. Are you planning on incorperating this feature solely into robots used for demonstrations?

The reason I'm asking is if you were to use this on your competition robot, I am not sure if this slow turn would be the best thing in the heat of a match when you need to move fast around the field. A slow turn with the joysticks in full forward and back position might not be responsive enough when you are trying to pivot and maneuver quickly when needed.

I think this is an excellent idea, don't get me wrong, but will it hinder your ability to change direction fast enough on the playing field?
__________________
Florida Institute of Technology
Ocean Engineering, '12
  #9   Spotlight this post!  
Unread 03-12-2004, 10:59
Squirrelrock's Avatar
Squirrelrock Squirrelrock is offline
I may be teh programmer?
AKA: Keegan
FRC #0414
Team Role: Programmer
 
Join Date: Nov 2004
Rookie Year: 2003
Location: Richmond VA
Posts: 333
Squirrelrock will become famous soon enoughSquirrelrock will become famous soon enough
Send a message via AIM to Squirrelrock
Re: A Simple Improvement to Driving

Quote:
Originally Posted by BurningQuestion
I am not sure if this slow turn would be the best thing in the heat of a match when you need to move fast around the field. A slow turn with the joysticks in full forward and back position might not be responsive enough when you are trying to pivot and maneuver quickly when needed.
I just discussed this with our other driver (Scitobor 617) and we agree that the robot will tun too slowly in the heat of a match for any good use outside of demonstrations. Even if you put one joystick forward, then both wheels move forward, and you turn on an arc.

However, if you really wanted to, you could put that code in your code ( ) and add a switch on the controll board that would effectivly "comment out" the extra code, allowing you to turn more quickly.

Just a thought from the middle of US and Virginia History.
__________________
Look what I did to Dave:
Aaacckkk! Guurrkkk! Sssnorrrrkkkkk! Brain ... explode ... will. AAAArrrrggghhh!! Must ... not ... think ... about ... 2007 ... yet. Uuurrgghh!!! Still ... have .... to ... resolve ... how ... to ... pack ... parachutes ... for ... 2006 ... Ooorrrkkggnn!!
Sweet!

The scientists of today think deeply instead of clearly. One must be sane to think clearly, but one can think deeply and be quite insane.
- Nikola Tesla

Genius might be described as a supreme capacity for getting its possessors into trouble of all kinds.
- Samuel Butler
  #10   Spotlight this post!  
Unread 04-12-2004, 00:35
generalbrando's Avatar
generalbrando generalbrando is offline
Build, Break, Repeat
AKA: Brandon Mensing
FRC #0246 (Overclocked)
Team Role: College Student
 
Join Date: Nov 2002
Rookie Year: 2001
Location: Boston, MA
Posts: 366
generalbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to beholdgeneralbrando is a splendid one to behold
Send a message via AIM to generalbrando
Re: A Simple Improvement to Driving

It's true that you're going to have half the turning speed and that you'd end up arching when pushing one stick.

That code mentioned above is correct I believe - my version is a bit more cluttered but hopefully either gets the idea across.

Anyway, in defense of the argument that it'll turn too slow, you're going to have to agree that we can't generalize. Slower turning on 246's 2004 bot is better because of the balance of the weight to the non-drive side means that it has a heavy tail - it's tough to control at times. And yet, it still allows for quick enough maneuvering in this case. Different robots will benefit from different programming.

This isn't something for every 'bot, but if a team wanted this effect but didn't want to lose their turning speed, you could include another piece of code downstream of this. It would check to see (for example) if the sticks were each pushed in opposite directions past the 3/4 (or half...you'd have to tweak it probably) point. For those familiar with code, you'd check if one stick was under 64 while the other was above 192 or vise versa. If it is, then you'd tell it to send the values of the ports directly to the pwm outs (as usual).

But yes, it's valid to say that it would be a bad idea for some skilled drivers who are used to that absolute non-interpretive control, not to mention the turning being potentially a problem.
__________________
Lead Mentor of Team #246, Boston University Academy and Boston University, Overclocked
www.burobotics.org


Last edited by generalbrando : 04-12-2004 at 00:39.
  #11   Spotlight this post!  
Unread 04-12-2004, 11:53
Matt Attallah's Avatar
Matt Attallah Matt Attallah is offline
Now at sub 14's in a 5000lb vehicle
AKA: Maher Attallah
FRC #0005 (Robocards)
Team Role: Alumni
 
Join Date: Sep 2001
Rookie Year: 2000
Location: Detroit area, Michigan
Posts: 1,660
Matt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond reputeMatt Attallah has a reputation beyond repute
Send a message via AIM to Matt Attallah Send a message via MSN to Matt Attallah Send a message via Yahoo to Matt Attallah
Re: A Simple Improvement to Driving

Team 5 use to used tank drive for the 1998, 99, 00, and 01 years. Rember - when you take the motors and flip them opposite of eachother (So when moving foward - one motor thinks it's running in reverse) these motors seem to have a (?)Reverse bias? It's in the way the brushes think.

We just took care of that in programming. Just take away from the more powerful side that kept pushing the robot to be crooked...
__________________
That rug really tied the room together...
  #12   Spotlight this post!  
Unread 30-12-2004, 19:41
krhs_programmer's Avatar
krhs_programmer krhs_programmer is offline
Programmer, Engineer, exDriver
#1247 (R.O.K.S.)
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2003
Location: Sutton, NH
Posts: 23
krhs_programmer is an unknown quantity at this point
Re: A Simple Improvement to Driving

My teams first robot used tank drive but with two drive wheels and two spining casters which made it very unstable at times and like you guys have said, it doesn't like to go in straight lines. Although this could be do inpart to the fact that one of the motors was slightly weaker that the other, but still that idea should work for us. After read the thread and seeing the drawbacks to it i came up with this idea:
If you were to designate one of the buttons on your joystick as a toggle switch and used it to toggle that function on and off depending on whether you want to be accurate or quick when driving.

first set up code so when you push the button it switches a variable between 2 values. (you'll have to do this on your own because i don't know how. sorry )
Then just use if statements:

if ( toggle == 1 ) /* toggle = var. controlled by button */
{
pwm01=(p1_y+((p1_y+p2_y)/2)/2);
pwm02=(p2_y+((p1_y+p2_y)/2)/2);
}

else
if ( toggle == 0 )
{
pwm01 = /* what ever your normal code is */ ;
pwm02 = /* what ever your normal code is */ ;
}

in theory that should work if you wanted to do that. thats what we did for our compressor last year to override the pressure sensor to build enough pressure to do the pull up on the bar.
  #13   Spotlight this post!  
Unread 30-12-2004, 23:42
Jeff K.'s Avatar
Jeff K. Jeff K. is offline
Hmm..now what?
FRC #1138 (Eagle Engineering)
Team Role: Alumni
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Chatsworth, California
Posts: 706
Jeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond repute
Send a message via AIM to Jeff K. Send a message via MSN to Jeff K.
Re: A Simple Improvement to Driving

Quote:
Originally Posted by Matt Attallah
Team 5 use to used tank drive for the 1998, 99, 00, and 01 years. Rember - when you take the motors and flip them opposite of eachother (So when moving foward - one motor thinks it's running in reverse) these motors seem to have a (?)Reverse bias? It's in the way the brushes think.

That's because they're drill motors. The drill motor gear box turns one way faster than the other. One way you can fix that is by not having one drive train mirror the other, but actually build it, so that it looks exactly like the other side. Example- Our drivetrain is in an L shape, what we have to do is make it into an upside down 'L' Shape, so that the motor is in a different position, not right next to the other one. It should sorta look lik a demented 'H' right next to each other. That should fix your problem, that is if you're using drill motors. If you're using another kind of motor, then I don't know.

Last edited by Jeff K. : 30-12-2004 at 23:45.
  #14   Spotlight this post!  
Unread 31-12-2004, 00:37
greencactus3 greencactus3 is offline
occra 23.
AKA: ryo
None #1481
Team Role: Alumni
 
Join Date: Feb 2004
Rookie Year: 2006
Location: North Farmington, MI
Posts: 1,523
greencactus3 is a name known to allgreencactus3 is a name known to allgreencactus3 is a name known to allgreencactus3 is a name known to allgreencactus3 is a name known to allgreencactus3 is a name known to all
Send a message via AIM to greencactus3 Send a message via MSN to greencactus3
Re: A Simple Improvement to Driving

Quote:
Originally Posted by Stonefan5271138
That's because they're drill motors. The drill motor gear box turns one way faster than the other. One way you can fix that is by not having one drive train mirror the other, but actually build it, so that it looks exactly like the other side. Example- Our drivetrain is in an L shape, what we have to do is make it into an upside down 'L' Shape, so that the motor is in a different position, not right next to the other one. It should sorta look lik a demented 'H' right next to each other. That should fix your problem, that is if you're using drill motors. If you're using another kind of motor, then I don't know.
one thing. maybe you just phrased it confusingly, but the gearboxes do not turn anything faster in one direction than the other, it is as Matt Attallah says. the brushes are timed advanced in one direction. which means the brushes are not centered from the permanent magnets
  #15   Spotlight this post!  
Unread 31-12-2004, 03:17
Jeff K.'s Avatar
Jeff K. Jeff K. is offline
Hmm..now what?
FRC #1138 (Eagle Engineering)
Team Role: Alumni
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Chatsworth, California
Posts: 706
Jeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond reputeJeff K. has a reputation beyond repute
Send a message via AIM to Jeff K. Send a message via MSN to Jeff K.
Re: A Simple Improvement to Driving

Oh, my bad, sorry, I thought it was in the gearboxes.
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
A Simple note about life dddriveman Chit-Chat 14 13-05-2004 20:33
Simple things you can do to make your bot/team perform better KenWittlief General Forum 21 01-04-2004 15:11
Simple Autonomous Mode Example deltacoder1020 Programming 5 08-03-2004 20:22
In reference to the driving of Team 25 Goober65 General Forum 24 14-04-2003 23:09
Who's robots are driving already? Anton Abaya General Forum 67 16-02-2002 00:07


All times are GMT -5. The time now is 18:06.

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