Introduction: PS2 Controlled Omnidirectional Robot

This omnidirectional robot is made with VEX holonomic wheels and a wireless PS2 controller (and receiver) from Hydra! Enjoy!!!

Step 1: Materials

Step 2: Research

If you are new to Arduino -- like I was at the start of this project -- start off by checking out the tutorials below and refer back to the Arduino reference guide. These tutorials will help give you a strong enough understanding of Arduino to do this project!

Tutorials:

Step 3: Attach PS2 Receiver to Arduino

  1. Make sure the PS2 receiver is right-side-up!
  2. Use image above to connect jumper wires to the PS2 receiver (push hard and remember which color you use for each)
  3. Now connect the other side of the jumper wires to the appropriate pins (remember which one is which)
    • brown: data --> any digital pin (I used pin 13)
    • orange: command --> any digital pin (I used pin 11)
    • red: power --> 3.3V
    • black: ground --> GND (on same side as power)
    • yellow: attention --> any digital pin (I used pin 10)
    • blue: clock --> any digital pin (I used pin 12)
    • NOTE: You should not use the white wire (or 8th connection point) and only use the grey wire (or 3rd connection point) if you would like to add a vibration (of the PS2 controller) otherwise it is unnecessary!
  4. If you are having any difficulties, please reference this more in depth youtube tutorial

Step 4: Configure Breadboard

Learn how breadboards work here before starting this part of the project!

I've also taken a picture of the actual breadboard to serve as a schematic.

Configuring your breadboard is very simple!

  1. Gather your materials: breadboard, 5 jumper wires (M/M), mini wires (you can cut jumper cables (or not) or use mini wires as shown in the image, and motor controllers
  2. Plug motor controllers into the bread board; space each motor controller about 5 boxes apart (horizontally)
  3. Use mini wires to connect to power (red wire) and ground (black wire) to the power and ground strips on the side of the breadboard
  4. Then use jumper cables to connect the white signal wires to PWM pins with this ~ symbol on the Arduino
  5. Take two more jumper cables (preferably red and black colored). Connect one side of the red wire to the Vin pin on the Arduino and the other side to the (red) power rail on the bread board. Connect one side of the black wire to a GND pin on the Arduino and connect the other side to the (blue) power rail on the breadboard.

You can place this part of your project on the side now!

Step 5: Design and Cut Base

For this step you will need to use power tools, so remember to be safe!

  1. Gather materials: Wood, jigsaw, ruler, and pencil
  2. Decide how long you want the sides of your hexagon to be (for 4'' wheels, 4'' sides were appropriate)
  3. Use this hexagon calculator to find dimensions
  4. To draw hexagon on wood
    1. Measure out the side length on one edge of the wood
    2. Use the short diagonal value to draw another side parallel to the one you drew
    3. Draw a center point
    4. Draw line from center point that is parallel to the sides you drew before. The line should be twice the size of the sides and the center point should be its midpoint
    5. Connect the sides by drawing 4 lines between the endpoints of all the lines you have drawn
  5. Follow the outline of the hexagon to cut it out from the wood piece

Step 6: Measure and Plan for Motor Mounting

If you look closely you can see the lines that I drew in order to map out the motor placement.

  1. Draw 3 lines from the center point that are exactly 120 degrees apart (these lines will show you where to put the motors later on). If you don't have a protractor, you can achieve this 120 degree spacing by drawing a line from the middle of one side to the center point then skip a side. If you repeat this twice you should have the second and third lines drawn in the same fashion.
  2. Connect wheel and driveshaft to the motor
  3. Measure your motors to find the spacing (if you are using VEX servo motors there should be two protruding places to screw on a motor mount)

Step 7: Create L-Brackets/Motor Mount

Homemade l-brackets are what I used to mount the motor to the base. The purpose of this step is to mount the motor to the base so you can use whatever mounting solution your want!

  1. Grab your 1x25 Bars from VEX robotics, bench vice, hammer, and sharpie
  2. Draw a line on the bar that is slightly less than 1.5 squares from the end of the bar. Flip it over and do the same on the other end of the bar (if you use 3 bars you should be able to make 6 l-brackets).
  3. Put the bar (securely) into the vice up to the line and hammer the bar until it forms a 90 degree angle on either side. Do this for all the l-brackets.
  4. Use the Dremel (with a metal blade) to separate the l-brackets on either side. Depending on the size of your base and of your motors, the l-bracket length might change. For the purpose of this exact project I cut the bar to 6 squares long (plus the half square on the 90 degree angle).

Step 8: Mount Motors

Time to drill!

  1. Place the l-brackets flat against the base (with the shorter side perpendicular to the base) in the spaces that you measured out in step .
  2. Use the screws to drill the l-brackets to the base
  3. Use the short screws that come with the VEX servo motor to hand screw the motors to the l-brackets (if the motor doesn't fit snugly, you can super glue the motor to the underside/l-bracket/base).
  4. Drill hole through center of base to connect motor controller to the motor wire OR leave room for the motor controller elsewhere

Step 9: Attach Wheels (and Wheel Supports)

  1. To fashion wheel supports, take sharpie and mark the end of the 13th square of 3 bars, this will be the length of the support for a 4" wheel. (there are of course many ways to stabilize the wheels but I found this way to be the best for me)
  2. Mark the bars in between the 3rd and 4th squares and in between the 8th and 9th squares
  3. Extend the line you made in the step (the ones that were 120 degrees apart) to the top of the base (by taking the line to the very edge and continuing it up the side and then onto the top)
  4. Using this line, center the bars and drill them to the top of the base about 3 or 4 bars from the edge of the side
  5. Super glue the screws to the top for extra security
  6. Bend the bars so that they look like the image above. The line between the 8th and 9th bars should be where the gradual curve begins and the line between the 3rd and 4th bars should be where the bar curve changes direction
  7. Connect wheels to drive shafts placing one shaft collar on either side of the wheels.
    • Make sure there is enough space to add another shaft collar.
    • Also make sure the placement shaft collars ensure that the wheel will not touch the side of the base
  8. Put drive shaft on wheel support and secure with another shaft collar

Step 10: Final Assembly

Now you can take the components that you put to the side earlier and superglue them to the base

  1. CAREFULLY take the breadboard and glue it to the base with hot glue (make sure to put the side with the active power rails in to the center.
  2. Glue the Arduino to the base (make sure to leave space for the USB to reach be able to connect to the)
  3. Glue power source to the base (leave room to recharge!!!)
  4. Put the motor controller end of the through the hole in the bottom and connect them to the appropriate motor
    • Make sure to label both the motor controller and the base (with a letter or number)
    • Glue wires to bottom of the base to avoid pulls and tangling
  5. Glue receiver to base or power source.

Now all the mechanical aspects of this project are done!!!

Step 11: Arduino Code

This code is complicated and probably would work better with regular DC stepper motors and a shield! So if you want to make your life easier, here is a tutorial to an easier coding ordeal with those items.

  1. To test out motors use the sweep code (already installed with the Arduino application).
  2. Start by using the PS2 library example code for the general outline for your code and for inspiration
    • make sure to read the example code
    • change the configuration to match the pins that you used for each of the PS2 receiver ports
  3. For omnidirectional movement there are three ways that I found to do this project
    1. using vectors you can that represent speed and angle
    2. (the easiest way) To control each motor individually using buttons and learn how to maneuver it that way. (you can try to use pressure of the button press to control speed for better control)
    3. (the most complicated way) Use trigonometry!!!
  4. To debug your code, print ALL applicable variables to the serial monitor. (I had issues with my servo motors twitching that I solved this way!)

This is my code (on GitHub) along with the library and example code I used!

Step 12: Going Further

There are so many ways to modify this project so just have fun and go wild!! This website has some ideas to get you inspired.

Step 13: My Robot in Action!!!

I made a video of my robot after adding some bling (EL wires w/ inverter and metallic tape!!), so check it out if you want to see how the finished product moves!

Comments

author
Swansong (author)2017-08-02

That's neat, I'd love to see a video of it working :)

author
lakemawu2 (author)Swansong2017-08-03

Thank you!!! You can see it working on my website for now, but I will make sure to post a video of that. The demo on my website is around the mid section of my first milestone video! Here is the link: http://bluestampengineering.com/student-projects/lake-s/