Reader small image

You're reading from  Smart Robotics with LEGO MINDSTORMS Robot Inventor

Product typeBook
Published inMay 2021
PublisherPackt
ISBN-139781800568402
Edition1st Edition
Concepts
Right arrow
Author (1)
Aaron Maurer
Aaron Maurer
author image
Aaron Maurer

Aaron Maurer, also known as “Coffeechug” is the STEM lead for 21 school districts in Iowa helping to expand STEM, Computer Science, Makerspace, and Purposeful Play into classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer

Right arrow

Chapter 6: Building a Solid Sumobot

Sumobots and battlebots are both terms that you may have heard of before. In case you don't know what sumobots are, they are basically robots that are designed to battle one another. Basically, it is a sport where two robots battle in a head-to-head competition to outlast the other robot. Battle robots are a classic build challenge for any robot enthusiast. From the popular YouTube show that led to shows that are now on TV, Twitch, and other platforms, you can find robots battling on all types of arenas, designed from about every conceivable idea you can imagine. These robots come in all shapes and sizes, depending on the rules of the competition. These robot challenges are quite popular in schools, after-school programs, and summer camps when it comes to sumobots. The robot you will build in this chapter will provide you with a solid foundation for being dominant in your next arena battle.

Here is a picture of what your base sumobot will...

Technical requirements

To build the robot, all you will need is the Robot Inventor Kit. For programming, you will need the LEGO MINDSTORMS app/software.

You can find the code for this chapter at https://github.com/PacktPublishing/Smart-Robotics-with-LEGO-MINDSTORMS-Robot-Inventor/blob/main/Chapter%206%20Sumobot%20Code.lms.

If you would like a more detailed photo-by-photo build process of the robot, please head here to view the relevant images: https://bit.ly/30JaXvB.

Building the robot

Before we get into building this robot, let's explore the strategy we'll be using. There are a lot of strategies in the world of sumobot competitions, but for the sake of this chapter, you will stick with probably the most tried and tested methods to guarantee sumobot success. The design of this particular sumobot is based on the following strategies:

  • The robot should be low to the ground with as little clearance space as possible from the ground to prevent it from being flipped over.
  • The robot should be low in terms of height to keep its weight distribution and center of gravity low to the ground.
  • Gears should be used to create more torque and power for the robot to push and keep it from being pushed around.

Keeping these three features in mind will help you understand why the robot is designed the way it is. Additionally, the robot has been designed in a way that it allows plenty of customization to be made to it, without us losing...

Writing the code

The code for this project needs to solve a few key issues when it comes to sumobot battles and the strategy we are focusing on. Here are the three main goals of the code that you will be writing:

  • The robot needs to stop when it sees white to keep it from driving out of the arena.
  • The robot needs to detect when another robot is close so that it can push them forward and drive them out of the arena.
  • The robot needs to be steady and consistent to avoid any unnecessary movements that may cause our robot fall out of the arena.

Let's double-check our ports and start writing the code to achieve these goals.

The ports

Before you write your code, it is good to make sure all the motors and sensors are plugged in properly. Using Port View, you can double-check the proper ports. The wheel motors will need be plugged into ports E and F. The distance sensor needs to be plugged into port A. The color sensor will need to be plugged into port C.

...

Make it your own

Now, it is time to hand the robot over to you. This is where you can take what you have built so far and customize the robot to your liking. Plenty of pieces have been left in the bin for you to design aesthetic features and apply new approaches to make your robot more intuitive, and there are plenty of coding options you can utilize to take the robot to the next level.

Here are a few ideas to consider:

  • The kit itself is limited in terms of the sensors that can be plugged into the Intelligent Hub. If you have another sensor from another kit or SPIKE Prime, then you could add a distance sensor, force sensor, or even a color sensor to the pack to create another decision point in the code so that when the robot senses danger from behind, it can counter. Currently, the robot is dependent on being strong enough to handle an attack from the back to counter and win.
  • If you wanted to take a different approach, what if you designed a device that, when the robot...

Summary

In this chapter, you explored the concepts of gears, sensors, making various decisions based on feedback, and how to use simple engineering principles to build an effective robot. This chapter was focused on providing you with building and coding concepts related to how you can use the different components that are available in the Robot Inventor Kit, as this will help you build a strong sumobot model with high torque and stability via gearing mechanisms. Additionally, you used sensors to trigger the different actions of your sumobot. This ensures that you will have success in battles. You did this by identifying the border of the arena and stopping the sumobot from falling off the edge, as well as using the distance sensor to activate attack mode when your competition is within striking distance.

Now, it is time to engage in a battle. Find a friend, foe, or local competition and see how you do. Feel free to battle other types of robots as well. There are so many ideas,...

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Smart Robotics with LEGO MINDSTORMS Robot Inventor
Published in: May 2021Publisher: PacktISBN-13: 9781800568402
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Aaron Maurer

Aaron Maurer, also known as “Coffeechug” is the STEM lead for 21 school districts in Iowa helping to expand STEM, Computer Science, Makerspace, and Purposeful Play into classrooms K-12. Aaron is also a former FIRST LEGO League coach for 8 years with much success working with phenomenal kids. He has a Master Educator License with endorsements in 5-12 Psychology – 163; 5-12 World History – 166; 5-12 American History – 158; 5-12 Computer Science – 278; PK-12 Talented and Gifted – 107; 5-8 Middle School Generalist – 182; and K-8 Computer Science – 277. Currently, Aaron is a member of ISTE Making It Happen Award; Lego Education Ambassador and Master Educator; PBS Digital Innovator and All-Star; PITSCO Tag Committee; Microsoft Innovator Educator Expert; Microsoft Innovative Educator Fellow; Global Learning Mentor (formerly Skype Master Teacher); Minecraft Global Mentor; and Makey Makey Ambassador. Finally, Aaron was a finalist for the Iowa Teacher of the Year in 2014.
Read more about Aaron Maurer