Go to Post Free food attracts us like flies. It's the one sure way to get us to meetings. - Mark McLeod [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 01-02-2008, 23:35
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Bizarre Mecanum Programming Bug

Hey Guys,

I have tried both my own code and stuff based on what team 357 put on this site and I have encountered the same problem in both cases. The robot will move straight forward and backward just fine. It will even spin in circles in both directions just fine.

Whats bizarre is that when we attempt to just strafe to the side, the robot will travel in an arc and spin slowly one way or the other (depending on which way we try to strafe). The problem seems to be caused by two wheels (diagonal from each other) spinning much faster than the other diagonal pair. Here's the real interesting part, though: the pwms indicate that the 4 wheels should be rotating in their respective directions at the same rates. When we try to strafe in the opposite direction, though, the pair of diagonal wheels that spin faster is the other one and again the pwms (seen via printf) indicate that there should be no problem.

Would someone please explain what is going on and maybe how we can fix this?
  #2   Spotlight this post!  
Unread 01-02-2008, 23:50
Steve_Alaniz Steve_Alaniz is offline
Registered User
FRC #2848 (All Sparks)
Team Role: Mentor
 
Join Date: Mar 2007
Rookie Year: 1997
Location: Dallas
Posts: 211
Steve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond reputeSteve_Alaniz has a reputation beyond repute
Re: Bizarre Mecanum Programming Bug

If you've calibrated the Victors and if you're using the Chicklet, calibrated the joystick, then numerically, everything is equal.
One thing that could be happening is that the motors are biased to run in one direction. They run faster (in general) forward than backwards. That could cause the arc you're seeing and in both directiions. By the way, I'm seeing the same arc you mentioned in my mechanum platform so it's not unusual.
I tweaked my numbers and got it to run straighter and I'm incorporating some feedback that is also helping with the strafe motion.

Steve

Last edited by Steve_Alaniz : 01-02-2008 at 23:56.
  #3   Spotlight this post!  
Unread 01-02-2008, 23:51
baop858 baop858 is offline
Registered User
FRC #0069 (Hyper)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2002
Location: Quincy, MA
Posts: 25
baop858 will become famous soon enough
Send a message via AIM to baop858
Re: Bizarre Mecanum Programming Bug

I think it might be a problem with the victors, I noticed this year they might be uneven as they might give more power in one direction.
  #4   Spotlight this post!  
Unread 02-02-2008, 00:08
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Bizarre Mecanum Programming Bug

Is there any chance that your wheels are on backwards?
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
  #5   Spotlight this post!  
Unread 02-02-2008, 00:13
ZZII 527's Avatar
ZZII 527 ZZII 527 is offline
"Scale Electric Vehicle"
AKA: Shane Colton
FRC #0097
Team Role: College Student
 
Join Date: Feb 2004
Rookie Year: 2003
Location: Cambridge, MA
Posts: 366
ZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond reputeZZII 527 has a reputation beyond repute
Send a message via AIM to ZZII 527
Re: Bizarre Mecanum Programming Bug

We saw this too, a bit. Weight distribution and frame straightness/rigidity is also very important, I'm told.

This can be fixed by feeding back the gyro into the rotation command. Something like:

...
read joysticks and adc for gyro, scale to same units
...
rotation = (joystick_rotation - gyro_rotation) * gain;
...
do mecanum algorithm
...

So if you try to purely translate and get some rotation, the gyro picks it up and the controller sends a rotation command the other way, even if the joystick is in the zero rotation position. Your results may vary, but when we stuck this in we got this:

http://techtv.mit.edu/file/544

This is with both joystick and gyro scaled to a value of -127 to 127 and then the difference fed into a mecanum routine with a gain of 1. You can see it auto-correcting rotation if you look closely.
__________________
MIT Mechanical Engineering
>> College Mentor, Team 97: Cambridge Rindge and Latin School with The Edgerton Center, MIT Mechanical Engineering, Bluefin Robotics, and Draper Laboratory
>> Alumnus, Team 527: Plainedge HS

Last edited by ZZII 527 : 02-02-2008 at 00:19.
  #6   Spotlight this post!  
Unread 02-02-2008, 01:07
EricH's Avatar
EricH EricH is offline
New year, new team
FRC #1197 (Torbots)
Team Role: Engineer
 
Join Date: Jan 2005
Rookie Year: 2003
Location: SoCal
Posts: 19,798
EricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond reputeEricH has a reputation beyond repute
Re: Bizarre Mecanum Programming Bug

Check your weight distribution. A large weight on one end of a mecanum robot will cause it to arc while strafing.

Wheels being on backwards would result in NO strafing ability.
__________________
Past teams:
2003-2007: FRC0330 BeachBots
2008: FRC1135 Shmoebotics
2012: FRC4046 Schroedinger's Dragons

"Rockets are tricky..."--Elon Musk

  #7   Spotlight this post!  
Unread 02-02-2008, 01:20
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Re: Bizarre Mecanum Programming Bug

Quote:
Originally Posted by jgannon View Post
Is there any chance that your wheels are on backwards?
No. The wheels are mounted correctly.
  #8   Spotlight this post!  
Unread 02-02-2008, 01:22
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Re: Bizarre Mecanum Programming Bug

Overall, what I gather is that I need to implement a Gyro to correct the arcing and redistribute the weight so that it is spread more evenly. I am pretty sure that the direction biases on the CIMs are negligible.

Thanks for all the feedback guys!
  #9   Spotlight this post!  
Unread 05-02-2008, 22:28
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Re: Bizarre Mecanum Programming Bug

We tried using the gyro from the KOP only to encounter frustration in that the gyro would sense angular velocity just fine in one direction while giving random positive and negative numbers in the other direction. I am talking about an output of 15,15,15,15,15 for one direction and 1,-5,16,-15,-4,10 for the other direction. we have decided its simply pointless to mess with the gyro. The arcing I am describing is to the point that the bot strafes in a medium sized circle.

The problem persists in that strafing in one direction (lets say right) makes a diagonal pair of wheels rotate faster than the other pair. Strafing in the other direction yields the same problem but with the other diagonal pair going faster. Does anyone else see this? How do you suggest I proceed?
  #10   Spotlight this post!  
Unread 05-02-2008, 23:19
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Bizarre Mecanum Programming Bug

Quote:
Originally Posted by manderson5192 View Post
he problem persists in that strafing in one direction (lets say right) makes a diagonal pair of wheels rotate faster than the other pair. Strafing in the other direction yields the same problem but with the other diagonal pair going faster. Does anyone else see this? How do you suggest I proceed?
Our new mecanum drive does exactly what you describe when the weight is not perfectly balanced. The heavy end slides sideways slower than the light end.

If you've given up trying to make the gyro work for you, I can think of three other options. First, you can use some sort of wheel speed sensors to try to maintain equal speeds on all wheels. Second, you can attempt to blindly compensate for the imbalance by driving the slow-turning wheels with more power. Finally, you can give your driver the next couple of weeks to learn how to stabilize the robot's strafing manually.
  #11   Spotlight this post!  
Unread 08-02-2008, 22:11
manderson5192 manderson5192 is offline
Registered User
AKA: Matt Anderson
FRC #0948 (Newport Robotics Group: NRG (pronounced eNeRGy))
Team Role: Programmer
 
Join Date: Jan 2008
Rookie Year: 2007
Location: Bellevue, WA
Posts: 62
manderson5192 is on a distinguished road
Thumbs up Re: Bizarre Mecanum Programming Bug

We have successfully resolved our strafing issues without implementing either the gyro or encoders in a PID-type loop. We simply wrote code to cycle through all the possible PWM values and counted how many encoder counts the PWM value would produce per 10 loops. By graphing the Rotations vs. PWM data, we were able to see that the problem lay not so much in the speeds of different wheels but in where the real "deadzone" for the drivetrain was. All we had to do was shift the PWM deadzone center from 127 to 133 and we had our problem fixed. Just to note, our battery is mounted in the geometric center of the drive base, so uneven weight distribution is a negligible problem for us. I just thought should let everyone know this so that others can diagnose how to solve any arcing problems while strafing with mecanum wheels. Graphing the RPM vs PWM data really showed us exactly what we needed to do.

Thanks for the advice guys!

-Matt
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
Mecanum drivetrain programming problems Mr. Freeman Programming 4 21-03-2007 17:11
Bizarre Driving Issue kitscuzz Programming 23 11-02-2007 17:02
mecanum programming mrmummert Programming 27 28-01-2007 13:45
bug? Duke 13370 CD Forum Support 4 30-12-2003 21:44
Bug Matt Leese CD Forum Support 7 14-06-2001 12:18


All times are GMT -5. The time now is 10:49.

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