View Single Post
  #6   Spotlight this post!  
Unread 07-12-2007, 15:58
UrsaMNet's Avatar
UrsaMNet UrsaMNet is offline
Eats Robots for Breakfast
AKA: Joe DeBlasio
FRC #1540 (The Flaming Chickens)
Team Role: College Student
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Portland, Oregon
Posts: 13
UrsaMNet is on a distinguished road
Send a message via AIM to UrsaMNet
Re: Controlling a Mecanum drive with two joysticks?

Team 1540 did this for the 2007 season. We too, spent a LOT of time trying to figure out how to get it to work best. Once we figured it out, we were astounded at how simple it can be.

Our robot had two joysticks. One controlled planar motion (pushing the joystick forward, moved the robot forward. Moving it sideways meant that the robot moved straight sideways). The other joystick controlled rotation (we only used the x-axis). Our team members picked this up pretty quickly, and it's a blast to drive.

Control wise, you can break the problem into two parts. We figured out how to control planar motion using one joystick, and wrote a function for it. Then we figured out how to do rotation, and wrote another function for that. Both of these easier problems can be easily figured out with a pen and paper to diagram out what inputs you have, and what outputs you'd want in that situation.

Then all we had to do was combine them! We started out simply averaging the values (weighted averages, actually). There are better ways to do this, but this gets you going quickly and easily. Once you've gotten that up and working, you can try to figure out optimizations which can dramatically increase the maximum speed/performance.

Mecanum drive is a lot of fun, I'm glad to see another team taking it on.

As a side note, you can setup the wheels on your base in two ways. In one arrangement, the rollers on the wheels will form an 'x' on the bottom of the robot. In the other arrangement, they'll form an 'o'. You can program both to work, but it's worth taking the time to think through what the advantages/disadvantages to each are, as the two aren't interchangeable.

I hope that's helpful. I'll admit I haven't looked at the whitepaper. Good luck!
__________________
FORMER programmer, webmaster, team captain, driver extraordinare (now I'm just a volunteer)

Team 1540
- The Flaming Chickens - (Our Website)

2008 Oregon Regional Winner
2008 Oregon Regional Engineering Inspiration Award
2008 Oregion Regional Best Website Award
2007 San Diego Regional Second Seed
2007 San Diego Regional Motorola Quality Award
2007 Pacific Northwest Regional Chairman's Award Winner
2007 Pacific Northwest Regional Finalist
2005 Best Website Award - Championship Event
2005 7th Seed Alliance Captains - Pacific Northwest Regional
2005 Best Website Award - Pacific Northwest Regional
2005 Rookie Inspiration Award - Pacific Northwest Regional