|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
How to program mecanum wheels with two joysticks
My rookie team is going to use macanum wheels this year for our robot and we were wondering how to program it in Labview to where one joystick controls forward movement (When the joystick is forward the robot moves forward, and when the joystick is to the left the robot goes left), and one joystick for turning the robot.
Team Up Next 3528 |
|
#2
|
|||||
|
|||||
|
Re: How to program mecanum wheels with two joysticks
That's easy. Use the Cartesian variety of Holonomic Drive. Connect the X and Y axes of the "translation" joystick to the X and Y inputs of the Drive vi. Connect the X axis of the "rotation" joystick to the Rotation input of the Drive vi.
Make sure you open a 4 Motor Drive in the Begin vi, with all the right PWM channels assigned to all the right motors. Depending in how you decide to wire the motors, you will probably need to set two of the Invert inputs to True, but don't just guess. Run the robot forward and make sure all the motors go the direction you expect them to. Once that's done, double-check with rotation. Then you can try strafing. |
|
#3
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
My team is running into a snag with the Holonomic VI. We can run forwards and backwards just fine. We can even turn left and right; no problem. We are having trouble strafing. When we try to do it the robot just stands in place with all 4 wheels spinning. We put it on blocks and noticed that when we ask for a strafe, the front wheels go forward and the back wheels go backward. This does not make sense given the "X" pattern we have set for the wheels.
My programmer did a great job creating his own drive code that works as intended, but does not have the Gyro support the holonomic VI has. So a few questions: 1.Will it be easier to: a: change the NI VI to allow us to strafe correctly or b: integrate the gyro to stabilize our drive base using our own code? 2. how would we go about doing 'A'? 3. how would we go about doing 'B'? Last edited by wilsonmw04 : 25-01-2011 at 21:12. |
|
#4
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
Quote:
Quote:
If you want to use the gyro to prevent unwanted rotation, or to make the robot turn and align with a joystick direction command, that can be done, but it's a separate problem from the field-centric gyro support built in to the LabVIEW vi. Last edited by Ether : 25-01-2011 at 21:29. |
|
#5
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
I'll get the code posted tomorrow, however, I swear there doesn't seem to be as much drift while driving with the NI VI than with our homemade code. Maybe it's just me.
|
|
#6
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
Quote:
|
|
#7
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
Sorry for the vague terminology. By "drift" I mean unwanted rotation. We start driving forward but slowly rotate to the left or right while maintaining the same vector of velocity. The drive tries to change this yaw rotation, to put it in aeronautical terms, but creates a whole other set of problems (think new car driver who isn't looking far enough ahead of where they are).
|
|
#8
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
Quote:
The drive tries to change this yaw rotation : did you mean the driver tries to change this yaw rotation? If not, what did you mean? creates a whole other set of problems : what sort of problems? Could you give a couple of examples please? I re-read your earlier posts and you never stated whether you are using omni or mec wheels. Last edited by Ether : 25-01-2011 at 22:07. |
|
#9
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
a video is worth at least 2000 words...
http://www.youtube.com/watch?v=V1ifzK1Q14w We keep the same joystick position and the yaw rotation changes. It could be due to slight differences in the wheels or motor strengths. What I mean about problems is the over correction that "small" corrections can make. BTW: it's mech wheels in an "X" formation \ / \ / \ / / \ / \ / \ Last edited by wilsonmw04 : 25-01-2011 at 22:31. |
|
#10
|
||||
|
||||
|
Re: How to program mecanum wheels with two joysticks
Quote:
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|