Close

Why All the Fuss About Real-Time?

A project log for Bobble-Bot

Demonstration robot for learning principles of real-time control using Raspberry Pi, RT Linux, and ROS.

Mike MooreMike Moore 04/17/2019 at 04:203 Comments

In order to get the best possible performance out of the balance controller, great care must be taken to ensure that the control loop operates at as close to a fixed 200 Hz loop rate as possible. From a write-up Jackie Kay (Open Source Robotics Foundation) contributed on real-time computing in ROS2:

A real-time computer system needs both an operating system that operates in real-time and user code that delivers deterministic execution. Neither deterministic user code on a non-real-time operating system or nondeterministic code on a real-time operating system will result in real-time performance.

The whole write-up is great and can be found here. All that to say, when your system needs real-time performance, it needs it. Bobble-Bot provides a safe way to learn more about this classification of systems at low cost. This is not an easy feat because typical real-time controller implementations are heavily proprietary. The whole subject is both fascinating and practical. We are passionate about sharing our experience here with the larger open-source community, and Bobble-Bot is a great platform for doing that.

Enough background, let's look at some examples.

Here's What Non Real-Time Control Looks Like

The performance is not good. If you look around on the internet you will find many examples of self-balancing hobby robots with performance that's along these lines. Keep in mind, this is the best we were able to get the non real-time Bobble-Bot to perform after many hours of tuning. The bottom line: non deterministic loop jitter (delay) kills performance in a system like this one. When you need real-time execution, you need it.

Here's What Real-Time Control Looks Like

In the video below, you are viewing one afternoon's worth of balance control tuning by James and Mike. The difference in performance between non real-time and real-time control is night and day. Watch to the end... it gets better and better.

Since the day these videos were recorded, we have continued to make performance improvements that enable the Bobble-Bot to do ramps and different surfaces like a pro! This would not be possible without the switch to real-time.

If you want real-time, why not just use a micro-controller? 

Having a full Linux OS running ROS makes working with the robot so much easier and more accessible. Being able to wirelessly ssh into the system and poke around is what makes the learning enjoyable. Additionally, ROS has a huge ecosystem of packages that makes it very easy to extend Bobble-Bot's capabilities without having to reinvent the wheel.

Discussions

Mateusz Sadowski wrote 05/08/2019 at 17:34 point

Thanks for the write up! I'm really interested about the Real Time aspect of the product. Do you run ROS2 already or is the project still targeting ROS1? How did you manage to run Linux in Real Time? Was it through Real-Time Kernel Patch?

Thanks for all the write ups! I found your project fascinating and will feature it in Weekly Robotics!

  Are you sure? yes | no

Mike Moore wrote 05/09/2019 at 03:21 point

Thanks for the interest and questions. Bobble-Bot currently runs ROS. Real-time can be achieved on Linux for free using the real time kernel patch along with a thought out software architecture. It took us several iterations to get it working alright.

James has done some great work on automating the RT kernel and Bobble-Bot software build. We're able to install Bobble-Bot's software on to the Pi by downloading a pre-built image from our build server onto an SD card and then firing up the robot. It's ready to go from there.

We are starting to develop and target ROS2. I'm currently working on a branch of our code base that is starting that migration process. We are hoping to have this completed by end of summer.

I'm planning on doing some project updates from the software side soon, so stay tuned. Any particular topics you'd like to see covered in more detail?

  Are you sure? yes | no

Mateusz Sadowski wrote 05/09/2019 at 05:45 point

I think if you write some article / articles or link to some resources on the RT kernel setup that you used that would be highly informative and useful for lots of people.

Another thing that's always interesting and from my experience it's hard to get right the first time around is hw_interface setup.

Thanks for your answers! Looking forward to see the project evolve!

  Are you sure? yes | no