Building a LEGO Robot Inventor 51515 Mecanum wheel omnidirectional car

Anton

Updated on:

lego mindstorms robot inventor mecanum wheel robot

I connected four Mecanum wheels to the four motors of the LEGO MINDSTORMS Robot Inventor 51515 kit. The result is an amazing car that can drive in every direction. It can even rotate on the spot. Here’s how to build and program the Mecanum wheel robot inventor car.

Mecanum wheel robots versus rotocaster robots

Mecanum wheels are a lot like omni-wheels. The omniwheels are also known as rotocasters or holonomic wheels. An Omniwheel has no lateral grip and would go everywhere. But Mecanum wheels are different. Unlike rotocasters, the Mecanum wheels have diagonally oriented rolls. If you push a wheel like that sideways, it starts to rotate! Some people call this type of wheel the Swedish wheel or Ilon wheel after its inventor, Bengt Erland Ilon. Ilon came up with the concept while working with the Swedish company Mecanum AB.

The diagonal rollers on the Mecanum wheels allow for a whole new range of movement. Now you can strafe sideways, turn, and accelerate. The only thing you need to do is change motor directions.

The straight rollers on the omniwheels also allow for multidirectional movement, but you need a different robot setup. Here’s an example of an EV3 robot with holonomic wheels.

Building the LEGO MINDSTORMS Remote Controlled Mecanum wheel car

The wheels combine well with Robot Inventor because there are four motors in the set, and four is the minimum amount of motors you need to work with these wheels. The build is not very hard. Slap four motors on your Robot Inventor hub and you’re rolling!

If you want building instructions, you can get them on my Patreon site. This is a Patreon supporter exclusive!

Mecanum car building instructions on Patreon.com

You can also build pure LEGO Mecanum wheels if you’re a LEGO purist. I’m particularly fond of this design by Yoshito Isogawa. The wheels perform less than dedicated wheels, but they work fine. Building instructions for those wheels are also on Patreon!

Programming the MINDSTORMS mecanum wheel car with word Blocks/Scratch 3.0

Now that we’ve assembled the car, it’s time to add a remote control program. I first attempted this with Word Blocks and the virtual remote. The result was a fairly simple program. You can use it with the virtual remote on your computer or smartphone. You can download the program below.

What I didn’t like about the program was the horrible lag between moving a stick and the response from the robot. It’s really not much fun to drive the rover like this. That’s why I moved to python.

Programming the car with Python and Remote control with an Android app

To avoid the lag, I have developed a complete Bluetooth library in Python. That library can connect two Robot Inventor hubs, and it can even connect to my app in the play store. You can even use LEGO SPIKE Prime as a remote control device for the Robot Inventor Mecanum car. Here are free building instructions for a SPIKE Prime remote control wheel.

The code for all of this is in my FREE public GitHub repository: mpy-robot-tools. Be sure to run to mpy-robot-tools installer first. Then you copy the code to a new MINDSTORMS project and run it once. You can delete the program.

After installation, you can copy the car receiver code to a new MINDSTORMS project. When you run it, make sure that Bluetooth Autoconnect is TURNED OFF! I mostly use USB to program my robot.

Once the code is running, you can connect with the MINDSTORMS RC Ble Android App from the Google Play store. But you can also connect with any hub running the transmitter code. No need to change the code on the car.

The hardware you need to build this Mecanum Wheel omnibot

I received these wheels courtesy of DF Robot. I modeled, and 3D printed wheel hubs to make them fit LEGO. My friend Stefan helped me kindly fine-tune these hubs’ clutch power, so they grip LEGO axles tightly. I shared the STL file as a download on my website. With it, you can 3D print your own adapters.

  • 4x Adaptor hub. You can order them printed on hubs.com. Choose FDM. Or you can print them yourself. Here’s the mecanum wheel hub STL file you need.

Help me build more models like the robot inventor mecanum wheel car

I hope you enjoyed all these free code files and explanations. I’d love it if you would show your appreciation and join my other Patrons on Patreon.com. Be sure to share this article!

Like this article? Help us make more!

Your support matters

We appreciate your support on Patreon and YouTube! Small things count.

Become a Patron

Don't miss a thing

Subscribe below to get an email when we publish a new article.

Share this with someone who needs to know

Leave a Reply

Item added to cart.
0 items - 0.00