|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Questions about mecanum wheels
My team decided to use mecanum wheels this year, which are currently being assembled, but are not yet on our test robot. Using the advice that has already been posted, our programming team made some code that we think is correct. It wasn't quite as simple as converting xy to polar, we had to make our brains hurt with radian-degree conversions,and angles being shifted 90deg, but the code we have seems to work correctly. Since the wheels aren't actually on the robot yet, we can't see how it moves, but from what I've read about mecanum wheels, the motors are spinning in the correct directions based on the input from the joystick. My only concern is that often times the motors are not going at full speed:
Rotation(which we have on a separate joystick) works fine, pushing it all the way one direction sets -1 or 1 to each side based on which direction we're tuning. However, for all other situations, the motors are rarely at full power. I have a feeling this is the way the sin and cos functions in holomicdrive.vi inherently are going to work to make sure your speed is consistent in any direction, but I am still worried. When we push the main joystick full forward, and give the holonomicdrive.vi the equivalent of 1 magnitude, 0 heading, and 0 rotation, the motors all go in the same direction but at about ~70% power. A similar thing happens when we strafe straight sideways, the motors are all going in the correct direction to cancel force vectors for sideways motion, but it is not at 100%. The only other time any motor ever gets to 100% besides purely rotating, is when we push the joystick into one of its corners. In that case, two motors go to 100%. We want to get as much power out of our drive system as possible, even if it means the robot will move slower in certain directions. Even just for full forward or backward, I would like to be able to set all the motors to 100% forward without any extra functions. Is there anything we can do about this? Is this how mecanum wheels are supposed to work? I could always make a button that sets full power to all the wheels, but having it built into the regular control system would be better. Thanks. |
|
#2
|
||||
|
||||
|
Re: Questions about mecanum wheels
What is your wheel config?
Here is the code I've done for off season projects, you may want to add dead zones. This also does not have the power problems - Code:
if (ws.ButtonState.Two == true)
{
leftmotorcontrol.motors[0].Velocity = -100 * (ws.AccelState.Values.X - ws.AccelState.Values.Y + turn); // front left
leftmotorcontrol.motors[1].Velocity = -100 * (ws.AccelState.Values.X + ws.AccelState.Values.Y + turn); // rear left
rightmotorcontrol.motors[0].Velocity = 100 *(ws.AccelState.Values.X + ws.AccelState.Values.Y - turn); // front right
rightmotorcontrol.motors[1].Velocity = 100 * (ws.AccelState.Values.X - ws.AccelState.Values.Y - turn); // rear right
}
else
{
leftmotorcontrol.motors[0].Velocity = 0.00;
leftmotorcontrol.motors[1].Velocity = 0.00;
rightmotorcontrol.motors[0].Velocity = 0.00;
rightmotorcontrol.motors[1].Velocity = 0.00;
}
I was using a wiimote so the "joystick values" (Really i used the accelerometers) gave an output of -1 to 1, you get a 0 - 255?. Its really simple just add up the x,y,z(rotation) and give each wheel the values they need.Diagrams help alot. Are you using two or one joystick? Take a look at this thread - http://www.chiefdelphi.com/forums/sh...hlight=wiimote PM me if you need more help |
|
#3
|
|||||
|
|||||
|
Re: Questions about mecanum wheels
A piece of advice that I'd give is to also use a PID controller. This way you can tweak values to however you'd like them. Also makes for smoother control.
Jacob |
|
#4
|
|||
|
|||
|
Re: Questions about mecanum wheels
You could always write your own "HolonomicDrive.vi" to make the calculations the way you expect them to be made.
|
|
#5
|
||||
|
||||
|
Re: Questions about mecanum wheels
the WPILib Joystick class has a GetDirectionDegrees and GetDirectionRadians, I'm sure Labview has something similar
|
|
#6
|
|||||
|
|||||
|
Re: Questions about mecanum wheels
Quote:
Quote:
If you want to change it so that your motors are running at full power I'd advise making a copy of the holonomic vi and reworking the math inside of it to your liking. |
|
#7
|
|||
|
|||
|
Re: Questions about mecanum wheels
I don't know how you are doing your direction and magnitude calculations but in LabVIEW, we used the ATAN2 function for direction which takes the joystick x and y as inputs. While you still have to do Radian-Degree conversions, I believe this will handle the Quadrant issues for you. Then, for the magnitude, we simply did sqrt(x^2+y^2).
|
|
#8
|
||||||
|
||||||
|
Re: Questions about mecanum wheels
In LabVIEW, you can also use "Re/Im To Polar Function".
|
|
#9
|
||||
|
||||
|
Re: Questions about mecanum wheels
Quote:
Edit: Doh, Joe beat me to it. That's what I get for leaving the window open while I go out to a machine breakdown ![]() |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| need help about Mecanum Wheels | mahmosh | Technical Discussion | 4 | 18-01-2008 11:50 |
| A few Questions about Omni Wheels.... | kSniper | Technical Discussion | 4 | 08-01-2008 00:15 |
| Friction coefficients for Omni wheels and Mecanum wheels from AndyMark | Andy Baker | Technical Discussion | 11 | 16-12-2006 19:40 |
| Mecanum Wheels | chaolin2007 | Control System | 1 | 25-02-2006 19:16 |
| Mecanum Wheels | TheFerret | Technical Discussion | 8 | 16-01-2006 09:23 |