Go Back   VEX Forum > Community > Technical Discussion

Technical Discussion Open Technical Discussion of the VEX Robotics System.

Reply
 
Thread Tools
  #11  
Old 04-24-2012, 11:14 AM
tvo's Avatar
tvo tvo is offline
Member
VEX # 1069B
 
Join Date: Jul 2011
Location: Berthoud Colorado
Posts: 42
Re: Programming Mecanum drive

Quote:
Originally Posted by richard60 View Post
if you have two encoders then subtract one value from another the tell the code wait1msc is it does not change by that much the tell it to stop and in auto you won`t burn your motors out on the mecanums

4886a

Aperture science

good luck,

Richard P
That is a very good idea for a software breaker! I used a timeout function this year, although I think I'm going to implement this in sack attack.
Reply With Quote
  #12  
Old 04-24-2012, 02:25 PM
Simmons 2.0's Avatar
Simmons 2.0 Simmons 2.0 is offline
Senior Member
VEX # 3018
 
Join Date: Sep 2011
Location: Iowa
Posts: 173
Images: 1
Re: Programming Mecanum drive

We had a Mechanum drive on our robot this past year.
A simple three axis (stick) drive code would be:
Code:
motor[frontRight] = Y1 - X2 - X1;
motor[backRight] =  Y1 - X2 + X1;
motor[frontLeft] = Y1 + X2 + X1;
motor[backLeft] =  Y1 + X2 - X1;
(from the ROBOTC blog post: http://www.robotc.net/blog/2011/11/2...-using-robotc/)

We made sure all our wheels went straight when the drive motors were set to full power. In Autonomous, we just made the motors go full power for the duration we wanted the robot to go straight. That would be the simplest approach. If that weren't accurate enough, I'd lower the output power and use a gyro and a PID loop to correct the drive by + or - some value to make sure it goes straight. Third, I'd use encoders on two of the wheels and make sure that they were going the same Speed/Derivative/Delta.

There still would be one problem left though; how would the robot make sure it was not unintentionally strafing off to the side?
__________________
"For I am not ashamed of the gospel of Christ, for it is the power of God to salvation for everyone who believes..." Romans 1:16a
2012 Eastern Iowa Judges Award/Tournament Champions
2012 Wildstang Regional Amaze Award
2012 Geneseo Regional Excellence Award/Alliance Champion/Programming Skills Award
2011 World Championship Innovate Award
2011 US Nationals Excellence Award

Reply With Quote
  #13  
Old 04-24-2012, 03:40 PM
magicode's Avatar
magicode magicode is offline
Senior Member
VEX # 4542
 
Join Date: Sep 2010
Posts: 608
Images: 8
Re: Programming Mecanum drive

You might want to check out this video I mad back when they were released: http://www.youtube.com/watch?v=v7CujEW0wgc
__________________
It's not a bug, it's a feature.
Reply With Quote
  #14  
Old 04-24-2012, 05:43 PM
Dracco1993 Dracco1993 is offline
Junior Member
VEX # 323A
 
Join Date: Aug 2010
Location: Greenwood, IN
Posts: 4
Re: Programming Mecanum drive

Last year we used a single encoder and a gyro to do all our autonomous controls, and this worked perfectly fine. We were able to consistently score 4 of the 5 isolation game pieces, with the errors coming mostly from how the driver set the robot up on the field.

The robot is field-orientated, meaning that it does not matter how the robot is orientated, the driver will always push forward to move the robot away from him backwards for towards him, ect. The same code that was used in telly-op for the drive, was also used in our autonomous. The only thing different was that, instead of the driver setting the drive values by moving the joystick, the values were coded into the drive function calls.

To answer the question about gyro drift/accuracy, they are accurate down to 1/10 of a degree, and we were seeing only about 1/10 of a degree of drift every 10 seconds, or 1/100 of a degree a second. This puts the total drift for a match under 2 degrees, which is well below vales that might effect performance. I was also pleasantly surprised about how well they did when they got hit. I expected them to quickly get misaligned, but that rarely ever happened.

I'm willing to help out anyone that would like it, and I can also put up the code for our field-orientated drive.
__________________
Jordan Miller
2010 Dean's List Semi-Finalist
FRC 1741 --- Mentor
Vex 323a --- Mentor
Reply With Quote
  #15  
Old 04-24-2012, 06:17 PM
MarkO's Avatar
MarkO MarkO is offline
Senior Member
 
Join Date: Aug 2006
Location: Albany, Oregon, USA, North Western Hemisphere, Planet Tera
Posts: 2,342
Images: 10
Re: Programming Mecanum drive

Quote:
Originally Posted by magicode View Post
You might want to check out this video I mad back when they were released: http://www.youtube.com/watch?v=v7CujEW0wgc

Excellent Tutorial!!

Paint might be simple, but it gets the Point Across to the Viewer.

You might Post your Pseudocode, or at least a Screen Shot of it in the Video...


I have Subscribed to your YouTube Channel.. I am expecting more excellent work in the Future...
Reply With Quote
  #16  
Old 04-24-2012, 06:28 PM
mediumdave's Avatar
mediumdave mediumdave is offline
Senior Member
VEX # 5492
 
Join Date: Sep 2010
Location: Cambridge, MA
Posts: 397
Images: 4
Re: Programming Mecanum drive

Alright, this has been irking me far too long...

MarkO, why do you capitalize every few words?

It sounds like you're really excited about everything
__________________
2009 Japan Excellence/Tournament Champion
2010 Japan Judge's Award
2011 Taiwan Tournament Champions
Massachusetts Institute of Technology
MechE+robotics
Reply With Quote
  #17  
Old 04-24-2012, 06:47 PM
MarkO's Avatar
MarkO MarkO is offline
Senior Member
 
Join Date: Aug 2006
Location: Albany, Oregon, USA, North Western Hemisphere, Planet Tera
Posts: 2,342
Images: 10
Re: Programming Mecanum drive

Quote:
Originally Posted by mediumdave View Post
Alright, this has been irking me far too long...

MarkO, why do you capitalize every few words?

It sounds like you're really excited about everything

Yes, I tend to Over Capitalize.....

I do it for Emphasis. ( I do use italic and bold on the Forum too, or Better Yet, Combine Both.. )

I realize that I tend to do this Emphasizing while Speaking as well. My written words are a reflection of my speech. But the written word is much harder for me to bring the points across. ( There... bold rather than Capitols... )


Also, I really am Excited about this stuff.....

( I also use multiple periods at the ends of sentences, to imply a Longer Pause. As well as liberal whitespace between thoughts, just to slow you down...)
Reply With Quote
  #18  
Old 04-25-2012, 11:53 AM
magicode's Avatar
magicode magicode is offline
Senior Member
VEX # 4542
 
Join Date: Sep 2010
Posts: 608
Images: 8
Re: Programming Mecanum drive

Quote:
Originally Posted by MarkO View Post
Excellent Tutorial!!

Paint might be simple, but it gets the Point Across to the Viewer.

You might Post your Pseudocode, or at least a Screen Shot of it in the Video...


I have Subscribed to your YouTube Channel.. I am expecting more excellent work in the Future...
Well, thank you. I don't normally do things like that, but when I saw the mecanum wheels released, I wanted to make sure people had info on how to program them. I was going to post code as well, but then I saw that ROBOTC had posted their's, so I didn't. Hopefully I can provide more "excellent work" .
__________________
It's not a bug, it's a feature.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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

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


All times are GMT -6. The time now is 03:58 AM.


VEX and VEX Robotics are trademarks or service marks of Innovation First International, Inc.
Copyright © 2002-2013. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc.
All other product names/marks of others are the property of their respective owners.