VEX Forum Programming Mecanum drive
 Portal Register Gallery Wiki Members Calendar Search Today's Posts Mark Forums Read Rules

 Technical Discussion Open Technical Discussion of the VEX Robotics System.

#11
04-24-2012, 11:14 AM
 tvo Member VEX # 1069B Join Date: Jul 2011 Location: Berthoud Colorado Posts: 42
Re: Programming Mecanum drive

Quote:
 Originally Posted by richard60 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.
#12
04-24-2012, 02:25 PM
 Simmons 2.0 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

#13
04-24-2012, 03:40 PM
 magicode 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.
#14
04-24-2012, 05:43 PM
 Dracco1993 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
#15
04-24-2012, 06:17 PM
 MarkO Senior Member Join Date: Aug 2006 Location: Albany, Oregon, USA, North Western Hemisphere, Planet Tera Posts: 2,340 Images: 10
Re: Programming Mecanum drive

Quote:
 Originally Posted by magicode 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...
#16
04-24-2012, 06:28 PM
 mediumdave Senior Member VEX # 5492 Join Date: Sep 2010 Location: Cambridge, MA Posts: 388 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
#17
04-24-2012, 06:47 PM
 MarkO Senior Member Join Date: Aug 2006 Location: Albany, Oregon, USA, North Western Hemisphere, Planet Tera Posts: 2,340 Images: 10
Re: Programming Mecanum drive

Quote:
 Originally Posted by mediumdave 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... )

( 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...)
#18
04-25-2012, 11:53 AM
 magicode Senior Member VEX # 4542 Join Date: Sep 2010 Posts: 608 Images: 8
Re: Programming Mecanum drive

Quote:
 Originally Posted by MarkO 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.

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