Mecanum wheel labview help
This is our second year of frc so we aren’t to much experience about labview.
We are making a small robot with mecanum wheels and I need help to make that program. We are folowing this pdf www.chiefdelphi.com/media/papers/download/2934
but im stuck with the gobal robot code.vi mention in it. Can you please help or give us an other way to do thie mecanum code on labview, a screenshot or a sample code would be very kind of you.
This doesn’t have to be as complicated as the presentation is making it. While there are some great ideas in there, they aren’t absolutely necessary. We use mecanum more often than not, and we do it like this:
In begin.vi, open a 4-motor drivetrain. In teleop (and autonomous if you’re planning on moving then), rather than using the Arcade or Tank robotdrive VIs, use Holonomic in Cartesian mode. X axis is strafe left/right, Y is forward/backward, Z is rotation clockwise/counterclockwise - attach to your joystick axes as desired. That’s all you have to do to get basic movement.
Testing on blocks:
If these tests fail for one or more wheels, check wiring and invert settings in begin.vi. If they are exactly backwards, consider your sign convention for what constitutes forward/right/clockwise on the robot vs your control inputs and adjust accordingly.
-
Give the robot Y axis forward only. Confirm all wheels move forward.
-
Give the robot Y axis reverse only. Confirm all wheels move backward.
-
Give the robot X axis “left” only. Check wheel movement - front wheels should be going back, rear wheels should be going forward.
-
Give the robot X axis “right” only. Check wheel movement - front wheels forward, rear wheels backward.
-
Give the robot Z axis “clockwise/right turn” only. Check wheel movement - left wheels forward, right wheels back. This is will make the robot spin in place. In real driving, if you want to arc the turn, you would also provide some Y axis forward.
-
Give the robot Z axis “counterclockwise/left turn” only. Check wheel movement - right wheels forward, left wheels back.
-
Once all behavior is as expected, put the robot on the floor and start driving.
I don’t think the above is correct.
It should be:
X axis “left” only: front_right and rear_left wheels forward, front_left and rear_right wheels backward
X axis “right” only: front_left and rear_right wheels forward, front_right and rear_left wheels backward
Can you please show what youre saying in a code screenshot or explaine in more detaille like what to add in each vi and how to connect de axis and do we need a gyroscope do make it work better
How do we input this in the labview code
So it should. My original description results in a robot that bounces in place in a particularly unhelpful manner.
that doesn’t go in the code.
The states described above are the observed behavior for moving left and right, assuming that your wheels are all mounted the right way up (yes, mecanum wheels do have a right way and a wrong way to be installed, looking at the bottom, the rollers should make an X).
The VI that you want is on the robot drive palette, and is labeled holonomic drive VI, as has already been stated, just wire it up and it works.
No, looking at the bottom the rollers should make an O.
bottom view:
/
/
top view:
/
/\
Sometimes it helps to make a mnemonic …
“O from below make Mecanum go”
To think it through, if the rollers are set up to be an X from below, by hand, you will be able to spin the robot about the center of the X with almost no resistance. The problem with that is, the robot now has no resistive force to propel itself about that axis. Reversed wheels will still allow it to move forward, backward, left, and right, but not to spin. It may also help to draw, or imagine, the friction force vectors aligned with the roller axis where it touches the ground.
Greg McKaskle
I stand educated.
Can someone please help me figure out what is happening. When I use the joystick it goes allover the place. Forward is right, back is left, right and left do nothing, z-axis left goes forward, and z-axis right goes backward. I’ll attach my code to this comment. Thank you in advance!
I’d suggest a different approach, e.g.,
except use axis 3 for the rotate as you have above.
Thank you we’ll try that now.
The issue you were likely having is that you are using the Polar mecanum joystick mapping, which takes a magnitude and direction (polar joystick coordinates). You were giving it x and y (cartesian) coordinates which caused the erratic behavior. You should generally be using the Cartesian mecanum functions.
Definitely sounds like you did’t have the left side motors set to inverted.
If you look closely you can see that I am using Cartesian
I don’t know about you but that looks like polar…
Definitely use Mark’s code, though. That’s a much easier way of controlling a drivetrain.