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
- 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
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.
The wiring diagram for the PCB can be found in the wiring
folder. The final result should look similar to this:
The Raspberry Pi Pico W is programmed in C++ using the official SDK. As the latter uses CMake, this project does as well.
The following describes the setup using Visual Studio Code but CLion, being CMake-based, should also work well.
- Set up the Pico SDK using the Getting Started Instructions on the official website.
- Set up the Bluepad32 library (steps 2 and 3 of this guide).
- Install the Eigen library.
- Open the repository folder in VS Code. Install the C/C++ Extension and the CMake extension.
- Set the
PICO_SDK_PATH
,BLUEPAD32_ROOT
andEigen3_DIR
either as global environment variable or in the settings of the CMake extension under configure environment. - 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 abuild
folder. If you run CMake manually, make sure to pass the-DPICO_BOARD=pico_w
flag. - Navigate to the
build
folder and executemake
to build all project files. Use-j4
to use 4 threads for a faster build. - Connect the Pico while pressing the bootsel button, which should mount is as mass storage device. Then copy the
*.uf2
file to this drive.
The IMU needs to be calibrated for good results:
- Flash the
playground/imu_calibration
software on the pico. - Use the
scripts/imu_calibration.py
script to retrieve the magnetometer and gyro bias, as well as accelerometer measurements. - Use Magneto or a similar tool to get the bias and correction matrix for the accelerometer.
- Adjust the values in
imu_calibration_values.h
correspondingly.