Go to Post I can't wait for the next season to start and my anticipation has already started. But in a way, if you think about it, the season's already started. - nehalita [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 24-10-2010, 15:44
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
How to code Macanum ddrive

In the past we have went with regular wheels and Arcade drive. But just last week (or 2 weeks ago) we got ourselves a set of macanum wheels.

I was wondering if someone can explain the logic behind these wheels and Where to start to actually programming this so we can use 1 joystick and go in all directions using the wheels.

1514
Whcirobotics

(Accidentally named the thread "ddrive" sorry for that its just "drive"
Reply With Quote
  #2   Spotlight this post!  
Unread 24-10-2010, 16:00
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,809
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: How to code Macanum ddrive

There are several whitepapers you can look at.

Getting the wheels on in the correct orientation is where people seem to have the most trouble.
The code is pretty simple, just be sure you connect the correct PWM to the corresponding wheel.
This code also assumes you've purchased a joystick that twists.
Attached Thumbnails
Click image for larger version

Name:	HolonomicDrive.jpg
Views:	739
Size:	26.9 KB
ID:	9369  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 24-10-2010 at 16:03.
Reply With Quote
  #3   Spotlight this post!  
Unread 24-10-2010, 16:09
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to code Macanum ddrive

The code that you have attached in the thumbnails > why does it only have 3 axis? I was told macanum drive or Holononic Drive has 4 axis? And that code is enough? I thought it was more complicated..

But more important than the code provided.. can you explain me how they function. The logic behind it. I want to program it from my understanding and see if it works. If you could explain me the logic please.

1514
whcirobotics
Reply With Quote
  #4   Spotlight this post!  
Unread 24-10-2010, 16:21
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to code Macanum ddrive

How do we get the macanum - cartesian under the holonmic Drive?
Reply With Quote
  #5   Spotlight this post!  
Unread 24-10-2010, 16:25
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to code Macanum ddrive

Quote:
Originally Posted by whcirobotics View Post
The code that you have attached in the thumbnails > why does it only have 3 axis? I was told macanum drive or Holononic Drive has 4 axis?
A 4-mecanum-wheel robot has 3 degrees of freedom: fwd/rev, strafe, and rotate. To obtain these 3 degrees of freedom, you have to issue coordinated commands to each of the 4 wheels

Quote:
And that code is enough? I thought it was more complicated...
That code is enough. It is not complicated.

Quote:
But more important than the code provided.. can you explain me how they function. The logic behind it. I want to program it from my understanding and see if it works. If you could explain me the logic please.
This explains the kinematics (the "logic"). It shows a mathematical derivation of why you must drive each of the 4 wheels at a certain speed in order to obtain a desired vehicle motion.

This tells how to write your own mecanum code for 3-axis joystick or for two 2-axis joysticks. It includes constants for adjusting the sensitivity of each of the three degrees of freedom.




Last edited by Ether : 24-10-2010 at 16:31.
Reply With Quote
  #6   Spotlight this post!  
Unread 24-10-2010, 16:32
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to code Macanum ddrive

O wow .. i thought it would be more complicated. I will try this code with mac wheels and see if it works.

Thanks for clearing up that it only needs 3 axis. I had looked at someones code and seen that they had 4 axis.. there code wasnt working. now i know why..

I will try this and get back with the results

You guys may think why i am starting many new threads everyday with different questions, the reason is because last year our robot did not have a functioning kicker code and in the competetion out of the 8 or so games, we only played in 3... because it wasnt communicating wirelessly.

I have been able to fix these problems in the past few days and i am thankful for chiefdelphi helped me greatly.

1514
Whcirobotics
Reply With Quote
  #7   Spotlight this post!  
Unread 24-10-2010, 17:04
RoboMaster's Avatar
RoboMaster RoboMaster is offline
Alum, former programmer&co-captain
FRC #2472 (The Centurions)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Minnesota, Twin Cities
Posts: 268
RoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant future
Re: How to code Macanum ddrive

Note that Mark's code is really used for a joystick that twists (the kit joysticks don't).

If you have a joystick that doesn't twist, you usually program 2 buttons to rotate the robot in different directions (you may have experienced this concept in video games, where the rear controller buttons rotate the vehicle/whatever you're in).

If you want to do this, you basically test both buttons and send different values to that Rotation terminal based on which button is pressed, if any. Doing that might get complicated, so if you can't figure it out, feel free to post back or check out this recent thread that is very similar. They talk about controlling a motor with two buttons.
__________________
My engineering blog: noeticbrainwaves.blogspot.com

I'm not slacking, my code's compiling
...and I'm using LabVIEW
Reply With Quote
  #8   Spotlight this post!  
Unread 24-10-2010, 17:24
buildmaster5000 buildmaster5000 is offline
Trying to program the swerve drive
AKA: Alex
FRC #2421 (Rolling Thunder Robotics)
Team Role: Alumni
 
Join Date: May 2009
Rookie Year: 2009
Location: Northern Virginia
Posts: 207
buildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud ofbuildmaster5000 has much to be proud of
Re: How to code Macanum ddrive

Quote:
Originally Posted by RoboMaster View Post
Note that Mark's code is really used for a joystick that twists (the kit joysticks don't).
You can also use a second joystick. The first joystick will control what I call "move" (forward/ backward relative to the robot's center) and "translate" (left/right relative to the robot's center). Assign the Y axis to move and the X axis to rotate the robot. The second joystick can have its X axis assigned to rotate the robot about its center.

Hope this helps!
__________________
-Alex



2010 Washington DC Regional: Engineering Excellence Award
Reply With Quote
  #9   Spotlight this post!  
Unread 24-10-2010, 17:45
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to code Macanum ddrive

Quote:
Originally Posted by buildmaster5000 View Post
You can also use a second joystick. The first joystick will control what I call "move" (forward/ backward relative to the robot's center) and "translate" (left/right relative to the robot's center). Assign the Y axis to move and the X axis to rotate the robot. The second joystick can have its X axis assigned to rotate the robot about its center.
I think there's a typo. You have "rotate" assigned twice. One of them should be strafe, right ?


If you have drivers who are already proficient with a tank drive interface, and you want to take advantage of that, you can use two 2-axis joysticks in standard "tank drive" mode to control the mecanum vehicle.

The left and right joystick Y-axes act just like tank drive to control fwd/rev and turning.

The X-axis on one of the joysticks controls strafing. To avoid inadvertent strafing, you can activate the X-axis command only when a trigger held down.





Last edited by Ether : 24-10-2010 at 17:52.
Reply With Quote
  #10   Spotlight this post!  
Unread 24-10-2010, 19:09
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to code Macanum ddrive

@ Buildmaster5000 and @ Ether

I have attached a picture of what you guys suggested. Is it correct?

And plus, how do i get "Macanum - Cartesian" under the Holonmic Drive. Like what Mark has in his picture.

@ RoboMaster

so the Joystick, Attack 3 we got in the kit is not sufficient? What joystick is to be used then? And if any what extra bit coding is involved?

1514
Whcirobotics
Attached Files
File Type: doc Macanum Snippet Chinmay.doc (82.0 KB, 81 views)

Last edited by whcirobotics : 24-10-2010 at 19:41.
Reply With Quote
  #11   Spotlight this post!  
Unread 24-10-2010, 19:20
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,569
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: How to code Macanum ddrive

Quote:
Originally Posted by whcirobotics View Post
And plus, how do i get "Macanum - Cartesian" under the Holonmic Drive. Like what Mark has in his picture.
Have you installed the LabVIEW update released 2/15/2010?
Reply With Quote
  #12   Spotlight this post!  
Unread 24-10-2010, 19:22
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to code Macanum ddrive

Quote:
Originally Posted by Joe Ross View Post
Have you installed the LabVIEW update released 2/15/2010?
O there is an update :S i will do that right away
Reply With Quote
  #13   Spotlight this post!  
Unread 24-10-2010, 19:51
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,086
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: How to code Macanum ddrive

Quote:
Originally Posted by whcirobotics View Post
Is it correct?

That depends on what driver interface you are trying to implement. Can you explain what you think this will do, from the driver's point of view?





Reply With Quote
  #14   Spotlight this post!  
Unread 24-10-2010, 20:25
RoboMaster's Avatar
RoboMaster RoboMaster is offline
Alum, former programmer&co-captain
FRC #2472 (The Centurions)
Team Role: Mentor
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Minnesota, Twin Cities
Posts: 268
RoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant futureRoboMaster has a brilliant future
Re: How to code Macanum ddrive

The Attack 3 joystick is not sufficient for extremely simple, basic wire-up programming and control of holonomic drive. If you want to use it, you'll have to do a little more programming to work with what you've got. But that's where you have options based on how advanced you want to be or what you think is easiest to drive or program.



I think Ether and buildmaster5000 were actually talking about two different drive techniques. But they're both good basic ideas. Let's see if I can describe them:

"Strafing-based holo drive" (what I was describing with buttons and buildmaster5000 with a joystick): one joystick controls strafing (wire up X and Y from joystick to X and Y on holo drive VI), while buttons or another joystick axis control direction/rotation (wire something else up to the Rotation terminal). This means that to turn around a corner you drive straight with the first joystick, but at the same time you need to rotate with your buttons/other joystick so that your direction changes too.

"Tank-based holo drive" (what Ether was describing): robot is driven normally like a tank: two joysticks control the left and right wheels of the robot. But, when the driver presses a button, the robot switches to strafing only, where one joystick controls strafing. This might be a little trickier and would require a combination of the holo drive VI and the tank drive VI (switching between the two based on if the button was pressed). However, this is nice and easy to drive because you normally just drive with the tank drive technique, which is intuitive. The strafing is like an added bonus.
(Note: you could use arcade drive instead of tank drive, which would require only one joystick. The point is that you're switching between that and holo drive to enable strafing).

Sorry if that was super abstract and hard to describe. But there are many ways to actually drive and control the robot with holonomic drive, just like how you can control a basic drive with arcade or tank drive, take your pick. So yes, the holo drive programming itself is easy since we have a nice holo drive VI, but there's still a bit more you have to do to apply it.

I might post visuals of the programming I described if you want. Right now I have to do something else, though. Hope that helps!
__________________
My engineering blog: noeticbrainwaves.blogspot.com

I'm not slacking, my code's compiling
...and I'm using LabVIEW
Reply With Quote
  #15   Spotlight this post!  
Unread 24-10-2010, 20:29
whcirobotics's Avatar
whcirobotics whcirobotics is offline
Registered User
FRC #1514 (Vikings)
 
Join Date: Nov 2008
Rookie Year: 2009
Location: WHCI
Posts: 174
whcirobotics is an unknown quantity at this point
Re: How to code Macanum ddrive

I think the code will enable the Joystick 1 ( also called move joystick) to control the Up and down and Strafing part of the driving. And the Joystick 2 ( also called the Translate Joystick) to control the left to right part of driving.

Last edited by whcirobotics : 24-10-2010 at 20:37.
Reply With Quote
Reply


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
Macanum ability to climb ramps BIGWILLI2081 Rules/Strategy 47 17-01-2010 00:20
How do i Upload code? seanl Programming 2 20-01-2009 10:46
Inventor > G-Code - HOW!!?? =Martin=Taylor= Inventor 4 17-07-2007 03:18
How to type my code jewbilee Programming 7 07-03-2007 21:51
how to convert Easy C code into real code? TheHolyLancer Programming 1 29-01-2006 09:09


All times are GMT -5. The time now is 20:46.

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