Skip to content

robinwersich/ball-e

Repository files navigation

Ball-E

This robot was created during the Robot Engineering Project of the University of Tartu and aimed to build a robot that can move and balance on a basketball. The final result can be seen in action here. The main concepts in the project explored are:

  • use of omniwheels
  • bluetooth remote control
  • balancing control logic
  • 3D printing
  • hardware selection and wiring

Hardware BOM

  • 3 motors with encoders
  • 3 motor connector cables: 6-pin (0.2mm spacing) to 6-pin (0.254mm spacing), ~8cm length
  • 1 Raspberry Pi Pico W
  • 2 Dual DC motor drivers
  • 1 IMU
  • 1 12V battery pack
  • parts for 3 omniwheels
    • 3 * 16 small rubber coated wheels similar to these (+ axis)
    • 3 * 3 M2x8 bolts (socket head cap or other non-countersunk) + nuts
  • control board
    • ProtoBoard
    • 6 10-33nF capacitors
    • 2 screw terminals (2 pins each)
    • MF headers: 2x 20-pin, 2x 14-pin, 1x 5-pin, 3x 6-pin
    • MM headers: 2x 3-pin
    • 2 M2 threaded heat inserts
    • 2 M2x3 bolts (socket head cap or other non-countersunk) for securing the IMU
    • 0.28mm² insulated wire (20cm black, 25cm red, 50cm green, 40cm white)
    • 0.75mm² insulated wire (5cm black, 5cm red)
  • battery connector: 9x5x5 barrel jack to 2x2 pin headers, 15cm length, 0.75mm²
  • USB-A to Micro-USB cable (ca. 15cm length)
  • 6 M3x25 (countersunk or low-profile non-countersunk) and 3 M2.5x15 bolts (socket head cap or other non-countersunk) + nuts for mounting the motors
  • 4 M30 FF PCB spacer
  • 4 M3 threaded heat inserts
  • 10 M3x6 bolts and 1 M3x10 (socket head cap or other non-countersunk) headless bolt for mounting case, pcb and spacers
  • 2cm Velcro for attaching battery
  • metal case (150x150x90)
  • bluetooth gamepad
  • size 7 basketball

3D printed parts

The following parts are 3D-printed:

  • 3x omniwheels (partly)
  • robot framework
  • IMU mount

A 3D model with all printed and non-printed parts can be found here. In addition, exported STEP files are available in the CAD folder.

PCB Wiring

The wiring diagram for the PCB can be found in the wiring folder. The final result should look similar to this:

Project Code

The Raspberry Pi Pico W is programmed in C++ using the official SDK. As the latter uses CMake, this project does as well.

Setup

The following describes the setup using Visual Studio Code but CLion, being CMake-based, should also work well.

  1. Set up the Pico SDK using the Getting Started Instructions on the official website.
  2. Set up the Bluepad32 library (steps 2 and 3 of this guide).
  3. Install the Eigen library.
  4. Open the repository folder in VS Code. Install the C/C++ Extension and the CMake extension.
  5. Set the PICO_SDK_PATH, BLUEPAD32_ROOT and Eigen3_DIR either as global environment variable or in the settings of the CMake extension under configure environment.
  6. Configure CMake by pressing Ctrl+Shift+P and search for CMake: configure. Choose the GCC arm-non-eabi which was installed in Step 1 as compiler. CMake should then automatically be run and create a build folder. If you run CMake manually, make sure to pass the -DPICO_BOARD=pico_w flag.
  7. Navigate to the build folder and execute make to build all project files. Use -j4 to use 4 threads for a faster build.
  8. Connect the Pico while pressing the bootsel button, which should mount is as mass storage device. Then copy the *.uf2 file to this drive.

IMU Calibration

The IMU needs to be calibrated for good results:

  1. Flash the playground/imu_calibration software on the pico.
  2. Use the scripts/imu_calibration.py script to retrieve the magnetometer and gyro bias, as well as accelerometer measurements.
  3. Use Magneto or a similar tool to get the bias and correction matrix for the accelerometer.
  4. Adjust the values in imu_calibration_values.h correspondingly.

About

A ball-balancing robot

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published