View Single Post
  #8   Spotlight this post!  
Unread 28-01-2010, 00:15
daltore's Avatar
daltore daltore is offline
Electronics/programming/design
AKA: Aaron Osmer
FRC #3529 (ausTIN CANs)
Team Role: Mentor
 
Join Date: Dec 2007
Rookie Year: 2007
Location: San Antonio, TX
Posts: 272
daltore has a spectacular aura aboutdaltore has a spectacular aura aboutdaltore has a spectacular aura about
Send a message via AIM to daltore Send a message via MSN to daltore Send a message via Yahoo to daltore
Re: Mecanum Wheels Programming

Magnitude has to be between 0 and 1. The most general way to do it is to have the Y and X axes of one joystick just act as point-and-shoot and use Pythagorean theorem (Magnitude = sqrt(X^2 + Y^2)). However, this results in a scale of 0 to 1.141, which means that with the limiting blocks they have inside Holonomic.vi, when driving while using multiple joystick axes with high values, come of the motor values will get capped, so you won't quite end up with the right vectors (because the over-1 magnitude will cause the motors to try to go faster than they can).

One way to get around this is to multiply the magnitude by .7, which will bring the max value back down to 1. However, this means that you can't go as fast forward or sideways, and you're only getting full speed diagonally. The way I prefer is to measure all of the motor values, and if any of them are out of range, scale all of the motors down to the most out-of-range motor (if the fastest motor is getting a value of 1.141, divide all of the motors by 1.141). This allows you to have full power in all directions, while maintaining correct vectors.
Reply With Quote