Controlling a Holonomic Platform
The easiest way to control a Holonomic Platform type Omniwheeled Robot is with an an Analogue Joystick, such as the Sony PlayStation PS2 Controller. Mindsensors produce the PSPNxv3: Sony PlayStation2 Controller Interface for use with the Lego Mindstorms NXT. You can used any PS2 compatible Remote Control/Joystick Controller with the PSPNxv3.
I prefer the PlayStation2 Controller over other controllers, including the Lego PowerFunction Controllers, because of the flexibility you have with all the extra buttons and the two Analogue Joysticks. I picked up a suitable PlayStation2 Controller off eBay for around $15.00 which works just fine. It probably wouldn’t stand the punishment that the Sony version does, but it suffices very well for Robotics applications.
Now for Some Maths:
In a rigid body translation without rotation means that every point on the body has the same velocity as the center of mass of the whole body. Thus, for each motor we have two equations relating the velocity (e.g. V1) and the perpendicular velocity (e.g. V1′) with the projections of Omni velocity in the X and Y directions have – V sin(θ) and V cos(θ), respectively. In the following we denote these two velocity components simply as Vx and Vy.
For the first motor (the one in the forward direction) we have:

Vx = V1

Vy = –V1
For the second wheel:

Vx = –V2 cos(60°) – V2′ cos(30°)

Vy = –V2 sin(60°) + V2′ sin(30°)
And finally for the third wheel:

Vx = –V3 sin(30°) + V3′ cos(30°)

Vy = V3 cos(30°) + V3′ sin(30°)
These set of 6 unknowns (V1, V2, V3 and the three primed velocities) and 6 equations has exactly one solution:

V1 = Vx

V2 =–Vx / 2 – Sqrt(3) / 2 * Vy

V3 = –Vx / 2 + Sqrt(3) / 2 * Vy {Where Sqrt(3) is just the squared root of 3.}
Using Not eXactly C (NXC) we can use the following:
NXC Source Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 
while (true ) { // Get PS2 Controller Data PSP_ReadButtonState(SensorPort, ADDR, currState); // PS2 Controller LeftJoystick 'X' Value Input Vx = currState.l_j_x; // PS2 Controller LeftJoystick 'Y' Value Input Vy = currState.l_j_y; V1 = Vx; V2 = Vx / 2  sqrt(3)/2 * Vy; V3 = Vx / 2 + sqrt(3)/2 * Vy; // Convert 'float' Value to 'integer' Value for Motors SpeedA = V1; SpeedB = V2; SpeedC = V3; OnFwd(OUT_A, SpeedA); // Move NXT Motor A OnFwd(OUT_B, SpeedB); // Move NXT Motor B OnFwd(OUT_C, SpeedC); // Move NXT Motor C } 
For a detailed explanation on the Physics and Vector Mathematics for controlling a Holonomic type Platform, I suggest you visit TechnicBRICKs. Koldo has by far the best theoretical resource on the subject I’ve came across. He saved my from dusting off my old Physics text Books and nutting most of it out. Thanks Koldo for your article: Going to all places, in all directions: the Holonomic platform!
Listed below is an example program to control a Holonomic Platform with the Mindsensors PSPNxv3 and Sony PlayStation2 Controller written in Not eXactly C (NXC).
NXC Source Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 
/* The Omni velocity in the X and Y directions is equivalent to V sin(θ) and V cos(θ), respectively. The Velocity Equations for Each of the Three Motor Are as follows: V1=Vx V2=–Vx / 2 – Sqrt(3)/2 Vy V3=–Vx / 2 + Sqrt(3)/2 Vy OUT_A V1 V3 V2 OUT_B OUT_C */ float V1, V2, V3, Vx, Vy; int SpeedA, SpeedB, SpeedC; #include "PSPNxlib.nxc" /* Controller button layout:  L1 R1 L2 R2 d triang a c square circle b cross l_j_b r_j_b l_j_x r_j_x l_j_y r_j_y  */ /* bits as follows: b1: a b c d x r_j_b l_j_b x b2: square cross circle triang R1 L1 R2 L2 */ const byte SensorPort = IN_1; #define ADDR 0x02 task main() { ClearScreen(); psp currState; SetSensorLowspeed(SensorPort); Wait (10); while (true ) { PSP_ReadButtonState(SensorPort, ADDR, currState); Vx = currState.l_j_x; Vy = currState.l_j_y; V1 = Vx; V2 = Vx / 2  sqrt(3)/2 * Vy; V3 = Vx / 2 + sqrt(3)/2 * Vy; SpeedA = V1; SpeedB = V2; SpeedC = V3; TextOut(0, LCD_LINE1, "V1 = "); NumOut(30, LCD_LINE1, SpeedA); TextOut(0, LCD_LINE2, "V2 = "); NumOut(30, LCD_LINE2, SpeedB); TextOut(0, LCD_LINE3, "V3 = "); NumOut(30, LCD_LINE3, SpeedC); OnFwd(OUT_A, SpeedA); OnFwd(OUT_B, SpeedB); OnFwd(OUT_C, SpeedC); } } 
Rotacaster Fitted Lego Mindstorms NXT Holonomic Platform in Action!
Monster Chess  The Team Hassenplug Way!
If you are not absolutely amazed while watching these two videos, there is something wrong. Read more on on The NXTStep and at Team Hassenplug. Quick Facts Over 100,000 LEGO® ... Read more
Rotacaster Omniwheels Arrive
Christmas arrived early this year for me when the Postman knocked today with a package from Peter McKinnon containing a set of 4x 48mm Rotacasters with the Lego Axel adapters. ... Read more
Leave a Reply