|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Swerve vs. Mecanum Programming
I have seen many people talk about the advantages and disadvantages of Swerve vs. Mecanum. I have seen one argument that a swerve is harder to program than a mecanum but I think it is the other way around. I have built at least 2 VIs (I use LabView) for a swerve drive and my dad has built at least 5. I still have yet to figure out how to program a mecanum drive.
So my two questions 1. What is you opinion on Swerve vs. Mecanum Programing difficulty. 2 Am I missing an equation or formula that can be used in programing a mecanum drive that makes it easier? |
|
#2
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
2 JOYSTICK TANK DRIVE MECANUM SEPARATION OF VARIABLES http://www.chiefdelphi.com/forums/sh...94&postcount=1 3-AXIS JOYSTICK MECANUM ALGORITHM http://www.chiefdelphi.com/forums/sh...383#post916383 The above algorithms are not optimum, but they work. ~ |
|
#3
|
|||
|
|||
|
Re: Swerve vs. Mecanum Programming
Without getting into detailed equations, the mathematical principles of fully holonomic omni/mecanum drives are relatively simple and can be approached this way:
Each wheel has a direction vector along which it can transmit force in either direction. For a mecanum this is at 45 degrees to the plane of the wheel, parallel to the axle of the roller contacting the ground. For an omni it's along the flat plane of the wheel. No force is or can be transmitted except along this vector. To get the wheel speeds necessary for any desired motion, you need to compute the projection of the motion vector onto each wheel's direction vector. For mecanums there's an additional constant to correct for the 45 degree angle. This can be done with dot products and no trigonometry. For simple directional motion, regardless of direction, that's all there is to it. To handle rotation, the motion vectors are tangent to a circle about the center of rotation, projected on the same wheel vectors, and scaled by relative radius. For rotation about the center of a normally configured robot, these end up the same for each wheel. Rotation about other points or for odd wheel configurations is a bit more complex but conceptually the same. You can rotate and move simultaneously by solving the wheel speeds for each separately, then adding the motion and rotation components for each wheel to get its final drive speed. This approach lends itself well to a two stick motion/rotation or single stick/twist control setup, and the vector math shouldn't take more than a couple of dozen lines of Java or C. It handles any motion physically possible with the robot. The motor drive functions needed for swerve drives, especially for complex motions, are considerably more complicated. It should be noted that there are simpler but still useful ways to employ mecanum/omni wheels short of full holonomic, and other ways to program swerves short of the "almost holonomic" of which they're capable. |
|
#4
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
|
|
#5
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
|
|
#6
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
Quote:
x' = xcos(theta) - ysin(theta) y' = xsin(theta) + ycos(theta) ... but Buchanan's approach is technically more correct and will yield more optimal control (more accurate directional control, smoother operation, and less scrubbing of the wheels) ~ Last edited by Ether : 17-04-2010 at 15:53. |
|
#7
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
![]() |
|
#8
|
|||
|
|||
|
Re: Swerve vs. Mecanum Programming
AM has a great powerpoint about omnidirectional drive, which has several diagrams that may make seeing the vectors talked about above easier to see.
http://www.andymark.biz/presentations.html Also, if you use a gamepad or similar control device, using the left joystick to control the movement of the actual robot and using the right joystick x axis to rotate the robot, it makes it very easy for someone who has played Halo to figure out how to drive your robot. |
|
#9
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
![]() |
|
#10
|
|||
|
|||
|
Re: Swerve vs. Mecanum Programming
Then use whatever works for you. We need to get a gamepad to work with Java before we start to tackle programming a swerve...
|
|
#11
|
|||
|
|||
|
Re: Swerve vs. Mecanum Programming
Hey we are team 647 and we are trying to develop our own swerve drive and I was wondering if you can post some examples of your program we are having some troble with our program and we are using Lab View.
Thank You ![]() |
|
#12
|
||||
|
||||
|
Re: Swerve vs. Mecanum Programming
Quote:
Baisically what my code does is it compares two numbers and if the pos_in(position the feedback tells you you are in) is greater than pos_to(Position to go to) then it sets the speed to -1 and 1 if it is the other way around. I also have a lot of safeties built in such as: If the feedback isn't counting, if it is turning the wrong way, etc. You may have a few questions because I really haven't commented any of it and it even confused my dad at first, so I will be willing to answer any other questions you have. |
|
#13
|
|||||
|
|||||
|
Re: Swerve vs. Mecanum Programming
Quote:
it's called proportional control. p from pid. Basically, you say; Code:
error = setpoint - process_variable output = error * Kp Edit: Forgot to talk about I and D: Integral (I): Basically you integrate the error and add it to the output: Code:
integral += error output += integral * kI Derivative (D): You calculate the derivative of the previous action to determine how momentum will affect the stopping ability. Basically, it works against P and I to slow it down when it nears the end, allowing a higher P gain. You will almost certainly not need this with crab steering, as the friction of turning the pods will probably slow their rotation very quickly (D would be useful for, say, a 6' arm that has a lot of mass at the end). Last edited by apalrd : 23-05-2010 at 00:10. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Mecanum or Swerve? | buildmaster5000 | Technical Discussion | 73 | 18-04-2010 11:19 |
| Programming Mecanum | Zrob | Java | 22 | 04-04-2010 23:00 |
| Mecanum Programming Help | Mars | Programming | 8 | 27-02-2008 15:41 |
| mecanum programming | mrmummert | Programming | 27 | 28-01-2007 13:45 |
| Need help programming our swerve with feedback? | activemx | Programming | 25 | 13-04-2004 07:29 |