How too drive a holonomic bot?

Well I just built a mini-holomonic bot, and it works pretty well. But I can’t figure out how to control 2 motors with one stick (to go forward and back wards), and make another stick control the other 2 to go side to side.

can anyone help me?

Try using a dual two wheel arcade drive. One on one side of the controller and one on the other side. That’s how I did it.

yea i was trying to figure out how to do that :stuck_out_tongue:

If you want custom holonomic code that will allow your robot to spin as well as traverse laterally (dual two-wheel arcade drive will NOT allow your robot to spin), then check out this post I made in another forum about a Vex holonomic robot I built. (I copied it here for browsing simplicity.) Although this code was made in EasyC 2.0, but it should work just fine in EasyC 1. :slight_smile:

This following code does exactly what you want, but it does not use a gyro. The robot control is relative to the current position of the robot. It might not be as easy to drive as an absolute position omni/mecanum drive, but it is still very intuitive and easy to control.

Here is the code I used for my Vex Holonomic Drive. The motors (when looking onto the top of the robot) were numbers exactly as they would for a mathmatical quadrants. The RF, LF, LR, and RR refer to Right Front, Left Front, Left Rear, and Right Rear wheels respectively. This code can be adaped for possible use in FRC, although you might have to tweak the input by 127. The Vex Transmitter sends 0 - 255 signal, and I think (but am not 100% sure) that some FRC joysticks send -127 - 127 signal.

Here is the variable mapping:

LF / ---- \ RF
LR \ ---- / RR

And here is the PWM port mapping:

2 / ---- \ 1
3 \ ---- / 4

And finally, here is the code:

#include "Main.h"

void main ( void )
{
      while ( 1 )
      {
            // Get Data 
            leftx = GetRxInput ( 1 , 4 ) ;
            lefty = GetRxInput ( 1 , 3 ) ;
            rightx = GetRxInput ( 1 , 1 ) ;
            leftx = leftx / 2 ;
            lefty = lefty / 2 ;
            spin = rightx / 2 ;
            // Drive Code 
            LF = RR = lefty - leftx + 127 ;
            RF = LR = 255 - lefty - leftx ;
            RR = 255 - RR ; // Reverse Direction
            LR = 255 - LR ; // Reverse Direction
            // Spin Code 
            RF = RF - spin + 63 ;
            RR = RR - spin + 63 ;
            LF = LF - spin + 63 ;
            LR = LR - spin + 63 ;
            // Check for values out of range 
            if ( LF < 0 )
            {
                  LF = 0 ;
            }
            else if ( LF > 255 )
            {
                  LF = 255 ;
            }
            if ( RF < 0 )
            {
                  RF = 0 ;
            }
            else if ( RF > 255 )
            {
                  RF = 255 ;
            }
            if ( RR < 0 )
            {
                  RR = 0 ;
            }
            else if ( RR > 255 )
            {
                  RR = 255 ;
            }
            if ( LR < 0 )
            {
                  LR = 0 ;
            }
            else if ( LR > 255 )
            {
                  LR = 255 ;
            }
            // Set Motors 
            SetMotor ( 1 , RF ) ;
            SetMotor ( 2 , LF ) ;
            SetMotor ( 3 , LR ) ;
            SetMotor ( 4 , RR ) ;
      }
}

And here is that code in action:

~15 Mb - Windows Media Video - http://www.team228.org/index/multimedia/vex-holonomic-drive.wmv

well thanks alot for that art, but I dont have the programming kit yet, and I was just looking for it to go forward and backwards and side to side :smiley: just as a little project, thanks though

just screw with the controls untill you get it…