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 look like by the end of this chapter:
In this chapter, you will break down the build and program as follows:
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.
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:
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 sight of these strategies.
For this build, we will use the 11x17 teal plate to keep things sturdy and strong. By using this plate, along with the two large frames, we will begin to design a strong base for the robot to operate on.
To get started, you will need the following pieces:
Begin with the base plate, three black connector pins, and two black 11x15 open frames:
Bring the two open frames together using three black connector pins:
Add another eight black connector pins to the open frames:
Using four more black connector pins, place one on each of the two teal 3x3 pieces and two to the teal 11x19 plate:
These elements will provide additional support for what will become our back sliders for the robot to maneuver properly:
Once you have those 3x3 elements connected to the base plate, go ahead and add the open frames to the top of the teal base plate using the eight black connector pins you added to the open frames in the previous steps:
Use four more black connector pins and the two brown 5L axles and add them to the teal plate and 3x3 Technic pieces:
Add the black 7x11 open frame to the pins you just installed on the teal plate:
Next, add four blue connector pins to the open frames:
Go ahead and flip over and further secure the bottom by pushing in all the connector pins properly. This will prevent the robot from falling apart upon contact:
Now that your robot is flipped over, add the four teal 2x4 L beams to the pins that are available:
You should now see the brown axle. Here, you will add your sliders using the following pieces:
These pieces will act as sliders to allow the robot to quickly pivot, spin, and move around the arena:
Add the wheels to the brown axles and secure them in place using the gray bush stops:
This section is complete. It is now time to add the Intelligent Hub and motors.
Now that the bottom of the base is nearly complete, let's flip it back over and start adding the motors and Intelligent Hub to bring the robot to life.
To build out the motors and Intelligent Hub, you will need the following:
To begin, you must push the black axles through the large black open frames. You will install one gray bush stop between the frame and end of the axle for spacing reasons. You must also add the black gears to each motor using the red axle pins:
Next, install both motors to the outside of the frame using black connector pins. Use four for each motor using the four pin holes on the motor:
Now, go ahead and add the Intelligent Hub by placing four black connector pins in each of the corners on the underside. Be sure to install the Intelligent Hub with the charger port pointing out to make it easier to charge and plug the Intelligent Hub into your computer:
Now is a good time to use the wire clips to organize your motor wires:
Our end goal with our motors is to create more torque. Remember that this robot's strategy is to create more power than our opponent. You are creating a robot that is gearing down and not gearing up. Torque is a measure of the force that can cause an object to rotate about an axis. In your case, you are gearing down. A small gear is spinning a larger gear, so it will take more spins of the smaller gear so get the larger gear to make one complete rotation.
The opposite is also true. If we were to place a large gear on the motor and then attach it to a smaller gear on the wheel, the robot will go much faster (see Chapter 7, Building a Dragster, for this example). The one rotation of the larger gear will cause the smaller gear to spin that much faster based on the ratio of the two gears, thus creating more speed.
For the sake of this robot, think of torque as the strength of the vehicle.
You will need the following parts to make this happen:
The following image is a visual to help us see how the parts will go together:
The parts in the preceding image are laid out in the order in which they go onto the black axles of the robot. Follow these steps:
This is a very important time to check that everything is aligned and that the gears are connected. There might be some movement if you test the motors, which you will secure better once you've finished the outside frame of the robot. For now, you can test this robot and ensure it moves around okay. Sometimes, the gears can be a bit tight if you smashed the elements too tight. Run some quick tests to ensure things move properly.
If everything moves okay, then we can finish this section by adding two black connector pins to the Intelligent Hub on the top pin hole:
Note that one blue axle pin has been added to the right motor in the previous image. Add one now as you will use a wire clip to keep the wires organized from the sensors that you will eventually add.
Most sumo arenas are black with a white line painted along the edge of the circular arena. You will need the color sensor facing down to prevent your robot from driving off the edge and losing. The frame you have makes adding a color sensor very easy to do:
You will need the following pieces to add a color sensor:
Begin by adding three connector pins to each of the 3x3 Technic pieces. Add two to the back and one on the side. These pieces will connect to the sensor and then eventually connect to the robot:
Keeping the sensor facing down to the ground so that it can detect the edge of the arena, attach this piece to the front of the frame and Intelligent Hub:
Next, you must add the distance sensor to the front of the robot, right above the color sensor. You will need to build a mini attachment to make this work.
You will need the following pieces:
Begin this attachment by adding two black connector pins to a black 11L beam. Add them to the third pin hole from each edge:
Add this beam to the back of the distance sensor:
On each gray connector pin with a bush stop, add a dark gray axle connector pin. On each of the dark gray pins, slide on a black round connector:
Add these pieces to both ends of the black beam connected to the sensor:
Attach this sensor piece to the 7x11 open frame:
Take two more gray connector pins and attach them from the back of the open frame in both of the bottom corners:
This is how the piece should look before you add the remaining components:
Locate the following pieces to build out the front of the distance sensor frame:
Begin this portion of the build by adding a black connector pin to one of the 5L sides of the open frames:
Attach both these open frames to the pins on the sensor attachment using the gray pins that are available:
Now that those have been added, let's turn to the beams. Add a blue connector pin to each of the black 7L beams:
Add a beam to either side of the open frames you just attached to the distance sensor:
Finally, you will finish the front of the robot by building out the rest of it. This will help you achieve a square and secure body frame.
You will need the following pieces:
Begin by adding black connector pins to all the white panel pieces, as shown in the following image:
Secure them all together into one piece:
Next, you must add this bumper piece to the front of the robot using the white elements. This will create a mini plow of sorts, which will protect your robot from being flipped. The robot will also be able to use it as a plow to hopefully lift your opponent as you continue to push them backward, out of the arena:
At this point, you should have these two parts of your robot built and complete:
Now, go ahead and connect it to the front of the robot. This front piece goes over the color sensor and keeps it out of view.
Take your time and work your wires toward the Intelligent Hub, ensuring they don't come into contact with the wheels and gears. Also, ensure the wires don't drag on the ground and accidentally slide under the color sensor. Use the wire clips to keep the wires up and out of the way:
Let's turn the robot around and complete the backside and bumper of the robot now that the front is complete:
Let's move to the back to build out the back bumper so that our robot is prepared for an attack from either side.
You will be creating a similar structure to what we created for the front of the robot, with the exception that there will be no sensors to serve as a plow and bumper.
You will need the following pieces:
You will start by adding four black connector pins to the 5x7 open frames. On the outside of each frame, attach the 2x4 L beams, ensuring they're facing up:
Proceed to add each of the open frames to the larger open frame of the robot itself:
Next, you need to add some structure and support for the robot. To do this, you will need the following:
Add these three pieces to the top of the open frames already on the robot. These beams serve as a support structure. Use the black connector pins to hold them all in place:
Now, you must add the plow bumper to the back. You will need the elements laid out in Figure 6.45 and assemble them as shown. The back bumper will be less of a plow and more of a protector for if you are attacked from behind by your opponent. The rounded aspect of the white pieces will also serve as a plow that could potentially lift your opponent up.
One detail to pay attention to is the teal 3x3 piece. You will see that you are only using one connector pin on each side instead of two. The spacing of the pin holes doesn't allow for two connector pins on each side, so you will be using one on each side and slightly tilting this piece so that it flows with the white elements.
You will need the following pieces:
Here's how these pieces all go together:
Here is what this bumper piece will look like when it's been built:
Once that bumper has been built, it will connect to the back of the robot and provide a nice layer of protection, keeping another robot from getting underneath your robot. The bumper should be on the ground or very close to it as the wheels move around. Take the time to test your wheels and make sure everything still moves properly. A fine line of spacing is needed to keep everything moving smoothly:
There's one last step, and that is to secure the sides and secure the robot so that it has a strong square protection frame. Let's dive into this final step of building.
To start, we will create the same side panels. The only difference will be in the color of the 1x5 Technic beams on each side. One side will be all teal, while the other will be all black. You could alternate colors if you wish.
Essentially, you are building two copies of the same build, but the L pieces will be on the opposite sides of the 7L beams.
You will need the following pieces:
Here's how these pieces all fit together. Use Figure 6.48 to see the layout of the parts if a visual helps:
Here is what your two panel pieces will look like once they've been put together. Note how they are the same builds but have opposite layouts so that you can work on either side of the robot:
Looking from a top view, here is how these panel pieces will connect to the sumobot:
The panels click and connect to the front and back using the L beams that are already on the back bumper and the 7L beams on the front:
The one critical detail is the positioning of the axle of the wheels. The axle needs to be placed in the proper hole; otherwise, the robot will have problems moving. Be sure to insert the axle into the second to top hole of the black 3x5 L beam. This provides proper clearance off the ground and also keeps the tension where it should be, keeping the gears from spinning out or not moving at all:
Here is how your sumobot should look at this point:
The last step is to finish off the square frame by adding structural support. Using beams, you will secure the sides to the front and back, as well as provide strength all around by adding two layers of beams until everything is balanced out.
You will need the following pieces:
Begin by adding the black round connector to the middle pin of the teal piece on the back of the sumobot, opposite the distance and color sensors:
Using two black connector pins per beam, attach the 11L black beams to either side of the round connector:
Using two more black connector pins for each black 3x5 L beam, add an L beam to either side of these beams:
Using the 15L black beams and two black connector pins, add these to the side walls to strengthen the panels:
Finally, add a black 7L beam to either side using two more black connector pins to finish up the first layer of support:
Here is the first round of structural support:
You need to add one more layer of support to bring structural support and to smooth everything out. You will need the following pieces:
Begin the second layer by adding six black connector pins across the back:
Then, add the beams to the pins:
The next step is to add a layer to each side. Due to part constraints, here is what you will need:
You will make the same build on either side of the robot supports. You will use the same pieces on either side. Note that the blue axle pin is for the axle hole of the 2x4 L beam. The rest are all using the black connector pins to hold all the pieces together. The following image showcases how they line up on the sides:
Here is the second layer of black Technic beams:
Now, you have one awesome sumobot ready to be coded so that you can put it to work in the arena!
Here is the back view of the sumobot:
Here is the front view of the sumobot:
Here is the side view of the sumobot:
Whew! You have done it. That's one sharp-looking and effective sumobot. Now, it is time to write some code so that you can compete in the arena.
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:
Let's double-check our ports and start writing the code to achieve these goals.
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.
Additionally, you might need to change the settings of the distance sensor to inches and the color sensor to reflect any light if you have any issues with the code later:
Now that you know everything is plugged in properly, it is time to code.
To get started, you need to open the coding platform. Here are the steps in case you need to know how to open a new block coding program:
The program has three main sections. You will build them step by step. Let's start with this first section of code. You can see it in Figure 6.68. The steps to create this code are as follows:
Here is what the code looks like once it's completed:
Double-check your code and if it looks good, then it is time to code the color sensor.
We need another little chunk of code for the main program to help with decision making. This one focuses on the color sensor. Let's get started:
Double-check your code and if it looks good, you can start programming the distance sensor.
You need to write some code for when the distance sensor senses an object within a certain range so that you can deploy an attack strategy. Let's do this now:
In the end, the entire code will look like this:
And you have done it! You should now have a working sumobot that is full of potential and has places for you to add your own flavor and design ideas. Enjoy!
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:
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, rules, and suggestions online for you to use to explore and expand your sumobot building and strategy deployment. Good luck. There are so many possibilities, so take the time to try new ideas, attachments, sensor placements, and more. In all my years of robotics, sumobots is the one challenge that people love the most. I think you will too!
In the next chapter, you will use gearing again, but for a different purpose: trying to achieve maximum speed. Let's rev our engines and get started by building and racing a dragster!
3.141.199.243