A robot, three omniwheels and a ball.

Similar projects worth following
A bot, three omni wheels and a ball

Paul works with three omniwheels driving a ball underneath. He has an IMU (MPU-6050) that provides two angles in x and z direction. These two panes are considered separately. The angle is input of a PID controller that delivers a correction speed in the same pane. This speed is converted into a movement of each omniwheel by use of inverse kinematics.

So, most complex parts of Paul are two things:

1. Kinematics, i.e. having a to-be speed of the bot, how do you compute the speed of each omniwheel?

2. Balance Control, i.e. depending on the two angles against the perpendicular axis the IMU provides, how do you compute the compensation speed in x and ?

Additionally, there is three PWM breakout for the blinking LEDs (everyone likes blinking LEDs!) and an interface to the text2speed module Emic-2 (that's the one Steven Hawkins is using).

The overall components are connected together like this:


This is about computing the angular speed of a wheel out of the speed in x and y direction.

I do not list the boring maths here, if you are really interested please check the Kinematics Computation Excel. The outcome of a tough weekend is this:

On the left side are the angular speed of the omniwheels 1-3. rw is the radius of one omniwheel, rb is the radius of the ball. θ is the angle of motor's axis against the perpendicular axisp. RT is the transposed rotation matrix that is given by the two angles φx and φy coming from the IMU:

vx and vy is the speed in x and y direction, ωbz is the angular speed of the bot when Paul turns at the same position. All this together is implemented in Kinematics.cpp

Micro-wise I use two ATmega 644, one for running the balancing loop, and the other receiving moving commands from the remote via xbee and controlling the LEDs and speed. Since the AVR is a bit too weak to run a control loop with 100Hz, I use fixed point arithmentics instead of floats, which makes the code hard to read.

Control Loop

The control loop is a slightly adapted PID controller which has as parameters:

  • body position, body speed, body acceleration,
  • head position, head speed, head acceleration.
  • to lean into curves, the angular speed is used to compensate the centripedal force

All these parameters are computed out of the IMUs values, multiplied with a certain weight and added (implemented in BotController.cpp). Before that, the IMU's values are filtered with a Kalman filter to avoid sensor noise by fusing the gyro values with g-force sensor values (Implemented in IMU Component).

Before you ask: Yes, I manually tuned the PID parameters. I tried the academic way, but it did not work out very well.


Schematics (KiCad) is here . Main uC is sampling the IMU, executing the PID controller and sending the result to the motor drivers (H-Bridges):


The dimensions of the motors, omni wheels and the balls are denoted here:

I did not use a CAD programme but drew all the mechanical parts in powerpoint (really uncool, I know). I glued the printouts on plywood and used a scroll saw to get the pieces. This is the powerpoint file with construction shapes.

  • 1 × EMIC-2 text to speed module
  • 2 × ATMEGA 644 One for the balance controller, one for the main controller (xbee, LEDs speech)
  • 3 × DC Motor Driver Single Motor Driver Carrier Board VNH2SP30
  • 3 × ELV I2C LED Driver 16 Channels Regular PMW driver for LEDs
  • 3 × DC motors from Polulu with encoders

View all 8 components

View project log

Enjoy this project?



Pedro H. J. wrote 03/24/2019 at 12:49 point

Dear Jochen Alt

I'm from Brazil. I made a ballbot as well. Some videos about my ballbot:

(yaw test)

It works very well. I'm trying translation X and Y axis, but not sucess. Can you help me ?

See this video He made a amazing ballbot.


Thank you so much

  Are you sure? yes | no

tonynazmy wrote 12/21/2018 at 16:37 point

Great project . can you supply the resources of deriving the forward and inverse kinematics calculations ?

  Are you sure? yes | no

rishabbalasubramanian wrote 09/26/2018 at 07:29 point

Hey, I was wondering why you used DC motors instead of stepper motors. Also, were you able to achieve path-planning while using DC motors?


  Are you sure? yes | no

EM @KING.NET wrote 11/24/2017 at 00:08 point

Where do get the sample codes?

  Are you sure? yes | no

Spencer Skelly wrote 07/18/2017 at 21:35 point

Gotta say, this is fantastic. Well done.

  Are you sure? yes | no

shapskurts wrote 05/31/2017 at 10:13 point

Hi Paul what programmer did you use to program atmega 644p and also what software did you use  thanks in adavance

  Are you sure? yes | no

Kelly Roadkill wrote 04/21/2017 at 19:56 point

Looks amazing! Both engineering and design. How did you decide on the physical parameters of the robot - sizes of the body and the ball, its mass, omniwheel angles, height of center-of-mass, etc? Do these Pololu motors have enough torque and velocity? Are those plastic omniwheels durable enough? How about the ball coating? Sorry for too many questions, I'm just really curious about the hardware part, as I plan to build a similar robot for my thesis.

  Are you sure? yes | no

Ember Leona wrote 03/19/2017 at 01:32 point

Make an Airvent Cleaner Robot they need those in prison I am allergic to dust and they had 8 inches of dust in the air vents now I think I have lung problems or mesothelomia. The airvents never cleaned since they made the prison. 

  Are you sure? yes | no

Ember Leona wrote 03/19/2017 at 01:30 point

I wish I can watch you and learn side by side. I think this robot looks cool. It reminds me of the new star wars bot so its a good sci fi entry. I think you shoud make the shere rotate or move by itself like a weighted hemisphere in sphere that has a cnc to rotate the outer sphere. I was also thinking that could bluetooth connect and different robots can use different balls and send commands. Thats going far into sci fi land huh...!?

  Are you sure? yes | no

Blankoo wrote 03/16/2017 at 10:03 point

Can you teach me the work of hackers

  Are you sure? yes | no

burner wrote 03/14/2017 at 12:46 point

Just awesome. BTW do it fall often? If it do it need detection routine for that so that if it get too high G peak it say ouch. And if it is on wrong angle after that it start whining. example I am so alone. No one will help me. Just why I had to born without hands. Cosmos is cruel. Without my ball I am just lonely rider without horse. Pleas help me! Can someone take me out of that horizontal darkness. etc random phrases from long whining database. 

Probably smaller G spikes can cause also produce  random whining example: let me stay at my endless emptyness.  Don't poke me, I am not your facebook friend. Etc   

  Are you sure? yes | no

Jochen Alt wrote 03/14/2017 at 13:41 point

Actually, the fall happened due to a loose connection to the IMU, so the motors accelerated desperately in order to compensate the wrong angle, that's why Paul fell so fast. In normal operations Paul is quite stable. But we had the same idea, I built in some whining when the angle is above a certain threshold, if you check MoodController::loop in

you see the "mobbing mode", which is turned on when Paul is pushed, this is my list:

"You push like a girl, is that your best?"
(actually this is a surprising aggressive change in his character)
"Go away"
"That was not worse than the rest of my life"
"You moron!"
"Ouch! You hurt me!"
"You like hitting small robots, don't you?"
"Please push me harder."
(maybe not appropriate :-) )
"I have been pushed my whole life. Why should you be different."
"Oh no, you again. I anticipated this already."

  Are you sure? yes | no

burner wrote 03/15/2017 at 15:17 point

That is just so super cool robot that probably I need start build own one. Is there some specific reason to use plywood instead of 3d print? Have you try search more quiet motors? And do you have any tips to make that kind rust texture. I just read that code and it looks quite nice and clean. Anyway I did not find mode where it just randomly loiter and roam. Is it just because current version is always at remote control mode or am I blind? 

  Are you sure? yes | no

Jochen Alt wrote 03/15/2017 at 19:03 point

At the time I made this, I did not have a 3D printer, that's why I used plywood. Now I have one, and would use it of course. Quiet motors would be great, and hacker's dream is motors from faulhaber or maxxon (which you can get with encoders and gears ), but check out their prices and you go with pololu...

The rust texture is done with that:

Really easy to work with, after some experiments you get the patina you want.

There's actually no autonomous lurking-mode, Paul directions are controlled with the remote control via xbee. In the video, that's the thing with the long zylinder and a joystick on top. But it could be a nice enhancement with a lidar sensor and a lurking mode. If you want to build it, I would recommend to use an ARM (bare metal) instead of an Atmel, e.g. a Teensy 3.6. Then, you do not need to fight with low level tuning like fixed point arithmetics and inline assembler to reach a control loop above 100 Hz, which is necessary for that kind of control task. And, use of two ATmegas, one for balancing and one for all the rest could by managed by one processor alone. Additionally, this would give the opportunity to model the dynamics in a more detailled manner achieving a higher speed and better curves.

  Are you sure? yes | no

burner wrote 03/17/2017 at 01:22 point

Thanks of good tips. My biggest problem is that I have usual too many projects. These days I have solve this by working with some students who want make cool projects but they do not have money. I sponsor parts & pay little and they can learn things and do cool stuff. Maybe this is next one. I personally use esp for most of things. Probably esp32 can be useful also for that. IF I put lidar then raspi can be nice with that. Anyway probably lazy man version is just add several ir proximity sensors. Some of them as horizontal to detect obstacles and some of them at 45 degree to down to detect that it will not make suicide by running to stairs. 

  Are you sure? yes | no

Vlad Barbulescu wrote 03/08/2017 at 21:26 point

Great job! I am trying to build a ballbot for my honors project, could you share links/datasheets for the motors you used? Thanks!

  Are you sure? yes | no

Jochen Alt wrote 03/14/2017 at 13:42 point

This is the motor with encoder: and this is the motor driver The Driver is overdimensioned, you can definitely use a much smaller one.

  Are you sure? yes | no

Vlad Barbulescu wrote 03/15/2017 at 10:22 point


  Are you sure? yes | no

Antonín Dach wrote 04/18/2017 at 10:10 point

May I ask how you decided the gear ratio? I am really struggling to choose or to calculate the motor torque of the entire system. I have designed and constructed skeleton already but I chose 1cm thick plexiglass and it's really heavy.. I fear for it to drive it I would have to pick a stronger torque but from simulink simulation it seems speed is more important :( or maybe to pick lighter material.

  Are you sure? yes | no

Jochen Alt wrote 04/18/2017 at 15:05 point

Hi Antonin, from my practical experiments, a high mass of the body is a good thing, as long as the ball and the wheels are light, such that the ball can move underneath the centre of gravity.  This gets even easier, when the centre of gravity is as high as possible. The required torque was not very high in my situation, and I agree, a quick response to the PID controller with a high acceleration seems to be more important than torque.  Even when you have a heavy body, I would stick to the 1:19 gear ratio. 

  Are you sure? yes | no

Aaron Miller wrote 03/04/2017 at 23:03 point

Has to be the best ball bot to date. Hey anyone know what happened to aido?

  Are you sure? yes | no

Jochen Alt wrote 03/04/2017 at 23:15 point

Thanks! Imo Rezero is currently the best one, they invested a lot in hardware,  made their own alloy-ball with optimized moment of inertia, cnc'ed the omni-wheels, and gave him 20kg. All that (especially the weight I guess) makes it very stable. aido seems to be dead after a fund raising campaign with an impressive outcome of half a million, although I was never a fan of robots who try to chat. Kind of desperate.

  Are you sure? yes | no

Aaron Miller wrote 03/04/2017 at 23:18 point

Ah okay, i've seen that bot totally forgot. poor backers with aido, a friend of mine dropped 1k. people are furious.  

  Are you sure? yes | no

Aaron Miller wrote 03/04/2017 at 23:18 point

you on twitter?!

  Are you sure? yes | no

Jochen Alt wrote 03/04/2017 at 23:27 point

1K? That's a lot. I gave up all this kickstarter stuff. All the things I found cool never flew, appearently I have a poor judgement.

  Are you sure? yes | no

Nathaniel wrote 03/03/2017 at 08:09 point

OMFG, dude I love it, well done. A magnificent achievement.

  Are you sure? yes | no

Douglas Miller wrote 02/28/2017 at 13:23 point

Oh, crap. Like I didn't have enough projects going right now. Now I want to build one of these. Lol.

Nice work! 

  Are you sure? yes | no

Kenny.Industries wrote 02/27/2017 at 14:32 point

Great work and awesome vision and love that retro-look!

Once upon a midnight dreary, while I pondered, weak and weary,
How the poetry possibly work? Is it a tweak or was it breed?

  Are you sure? yes | no

Jochen Alt wrote 02/27/2017 at 14:53 point

Thx :-) In the unlikely case you did not recognize it: It is marvins lullaby from Hitch Hikers Guide

  Are you sure? yes | no

Kenny.Industries wrote 02/27/2017 at 14:57 point

Ahh...therefore it was so astonishing.
I read it in german so I think it was translated not very well...
Or the Infinite Improbability Drive was turned on...

  Are you sure? yes | no

Yaroslav Bolyukin wrote 02/27/2017 at 10:47 point

I love it! Can you share code for balancing?)

  Are you sure? yes | no

Jochen Alt wrote 02/27/2017 at 11:56 point

Code for balancing is there:

It is pure low level coding, since from todays perspective the AVR is underpowered to do that

  Are you sure? yes | no

deʃhipu wrote 02/26/2017 at 23:05 point

Great work! I hope nothing broke from the fall.

Is the rugged post-apo makeup based on something in particular, or is it original?

  Are you sure? yes | no

Jochen Alt wrote 02/27/2017 at 08:01 point

Its no movie character, just a forgotten robot that is out of service...

  Are you sure? yes | no

jimrd wrote 02/26/2017 at 10:53 point

Nice work! Funny.

  Are you sure? yes | no

RoGeorge wrote 02/26/2017 at 07:18 point

  Are you sure? yes | no

Jochen Alt wrote 02/26/2017 at 09:45 point

thanks :-)

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates