TCPL Autonomous Robot Wrestling - Tinkercad
TCPL Autonomous Robot Wrestling - Tinkercad
By TCPL
Over the past several years the Tompkins County Public Library has offered
learning how to code through battling Arduino-powered robots. These robots
are inspired by the robotics competition in Japan known as Sumobots. TCPL's
wrestling robot program has gone through several iterations. It started with
robots remote-controlled through a Bluetooth app, see the last two images.
Next, TCPL developed a general-purpose robotics platform that could have
various attachments and introduced sensors for autonomous functions, see
image 4. Later on, the club added hobby electronics found in combat robots to
make non-destructive antweight bots, see image 3. This year TCPL has
developed an easy-to-print modular system focused on robot wrestling, see
the first two images. In this system, participants upload Scratch code through
mBlock to an Arduino Nano that sets a pattern of behavior their robot will
follow. The script is pre-written and covers concepts of receiving data from
sensors, control flow, and how to use the internal clock for movement timing.
In this Instructable, you will learn how to print, build, and code your own 3D
Printed Autonomous Wrestling Robot.
Supplies
Skills
basics/) . You may be able to find the Arduino Nano and the motor driver pre-
soldered.
Using Wire strippers.
Slicing 3D models.
3D printing.
Uploading code to an Arduino. Covered in Step 9.
Tools
Wire Stripper
Plastic Nippers
Phillips Head Screwdriver
Hot Glue Gun
Soldering Iron
USB Mini B Cable
3D Printer
Parts
At TCPL we are privileged to have access to a Prusa Mini. You can print this
model on any machine that uses PLA. Here are the settings we use on the
Prusa:
Quality 0.20mms
Infill 15%
Supports Build Plate Only
Brim: Yes
The TCPL Robotics Club has also had success printing several of these robots
in both PLA and ABS on the Ender 3 using Draft mode.
If you do not have access to a 3D printer please check your local library,
makerspace, and/or university for services. Many public libraries have free or
inexpensive 3D printing services available.
Once the parts have been printed remove the single support from the sensor
connector piece, see image 3. After cleaning off the support test fit wheels and
sensor. The sensor has a very loose fit on purpose to help it absorb impact
when it crashes into another bot. If the wheels are a bit tight you can use a file
or automotive sandpaper to remove some of the surface.
Step 2: Soldering
Motors
1. Take a red, black, orange, and brown wire. Snip off the end with the pin,
see image 2.
2. Strip the cut ends of each wire so they match the size of the motor's
terminals.
3. Apply solder to each stripped end of the wires.
4. Apply solder to the terminals on each motor, see image 3.
5. Solder a red and black wire to one motor and orange and brown to the
other, see image 4.
Power Distribution
1. Attach the motors to the chassis by aligning the two holes and threading
two 35mm M3 screws through them.
2. The terminals on both motors should be facing away from the chassis. The
bell of the motor, the black plastic end, should be facing the end of the
chassis with the three holes on top, see the first two images.
3. Screw the screws on both motors until you can just fit the bolts on, then
tighten them until they can no longer rotate, see image 3.
4. Using three 10mm M3 attach the sensor plate, see images 4 and 5. The
smooth side of the sensor plate faces away from the chassis.
5. Using plastic nippers cut off the protruding holes at the back of each
motor, see image 6.
6. Lace the black and red wires from the battery case through the slit closest
to the rear of the chassis, see image 7.
7. Using hot glue adhere the battery pack to the rear of the motors making
sure to leave enough room for wires to slide between it and the chassis,
see images 7 - 9.
8. Lace the motor wires through the center slit in the chassis, see images 10
-14.
1. Slide the HC-SR04 sensor into the wedge with its pins facing up.
2. Flip over the chassis and partially screw in two 10mm M3 screws into the
left and right holes on the sensor plate.
3. Slide the wedge with sensors onto the screws. Tighten the screws down,
see images 1-2.
IR Sensor
Arduino:
1. Using hot glue adhere to the DRV8833 motor driver to the chassis so it is
adjacent to the rear of the mini breadboard.
2. The VCC and GND pins on the motor driver should be closest to the mini
breadboard, see the last image.
Note: I apply the hot glue to the DRV8833 along the solder point of each pin.
You can remove this hot glue later by wetting it with rubbing alcohol. Please
use safety and proper equipment when handling rubbing alcohol.
Step 6: The Cricuit
Please use the images to follow along. The following steps are numbered to
the images.
1. Take the red wires coming from the 9v battery case. Take the end with the
input and attach it to the VCC pin on the DRV8833 motor driver. Take the
remaining wire with the pin and insert it into the mini breadboard
adjacent to the VIN pin on the Arduino Nano.
2. Take the black wires coming from the 9v battery case. Take the end with
the input and attach it to the GND pin on the DRV8833 motor driver. Take
the remaining wire with the pin and insert it into the mini breadboard
adjacent to the GND pin on the Arduino Nano.
3. Using a purple wire attach its input side to the D0 pin on the TCRT5000.
Insert the pin of the attached purple wire into an input on the mini
breadboard adjacent to the D12 pin on the Arduino Nano.
4. Using a brown wire attach its input side to the GND pin on the TCRT5000.
Insert the pin of the attached brown wire into an input on the mini
breadboard adjacent to the GND pin on the Arduino Nano.
5. Using an orange wire attach its input side to the VCC pin on the TCRT5000.
Insert the pin of the attached orange wire into an input on the mini
breadboard adjacent to the 5V pin on the Arduino Nano.
6. With the front of the robot facing you take the two wires coming from the
right motor, your right, not the robot's. and insert one into OUT3 and the
other into OUT4. Do not worry about which right motor wire goes where,
you will adjust this after uploading the script.
7. With the front of the robot facing you take the two wires coming from the
left motor, your left, not the robot's. and insert one into OUT1 and the
other into OUT2. Do not worry about which left motor wire goes where,
you will adjust this after uploading the script.
8. Using a blue wire attach its input to the IN1 pin on the DRV8833 motor
driver. Take the attached blue wire and insert its pin into the mini
breadboard adjacent to the D10 pin on the Arduino Nano.
9. Using a purple wire attach its input to the IN2 pin on the DRV8833 motor
driver. Take the attached purple wire and insert its pin into the mini
breadboard adjacent to the D9 pin on the Arduino Nano.
10. Using a green wire attach its input to the IN3 pin on the DRV8833 motor
driver. Take the attached green wire and insert its pin into the mini
breadboard adjacent to the D6 pin on the Arduino Nano.
11. Using a yellow wire attach its input to the IN4 pin on the DRV8833 motor
driver. Take the attached yellow wire and insert its pin into the mini
breadboard adjacent to the D5 pin on the Arduino Nano.
12. Using an orange wire attach its input to the VCC pin on the HC-SR04
sensor. Take the attached orange wire and insert its pin into the mini
breadboard adjacent to the 5V pin on the Arduino Nano.
13. Using a brown wire attach its input to the GND pin on the HC-SR04
sensor. Take the attached brown wire and insert its pin into the mini
breadboard adjacent to the GND pin on the Arduino Nano.
14. Using a purple wire attach its input to the Trig pin on the HC-SR04 sensor.
Take the attached purple wire and insert its pin into the mini breadboard
adjacent to the D7 pin on the Arduino Nano.
15. Using a white wire attach its input to the Echo pin on the HC-SR04 sensor.
Take the attached white wire and insert its pin into the mini breadboard
adjacent to the D8 pin on the Arduino Nano.
16. Your circuit is complete and your robot should have a fun hairdo of wires!
Slide a rubber band into each wheel. Apply a thin layer of hot glue under the
rubberband to prevent it from slipping off the wheel. Slide wheels on so the
protruding circle is facing the motor.
SETUP:
Once mBlock has downloaded you will need the pre-written code. You can find
the script here:
https://drive.google.com/drive/folders/1c06kuLu3ujh788gS884428PngjDkNiKr?
usp=sharing (https://drive.google.com/drive/folders/1c06kuLu3ujh788gS884428PngjDkNiKr?usp=sharing)
1. Navigate to the My Blocks tab to see all the different behaviors you can
have your robot perform.
2. Select any number of behavior blocks to program how your robot will
move around the arena. Blocks are read top to bottom and left to right in
the forever loop a.k.a the gaming loop. Once the last block is read the
robot will start with the first block again until you power it off.
3. Use the blocks that allow you to input a number. The number represents
seconds and decimals milliseconds.
4. You can also adjust the speed of each behavior block you use by placing a
SpeedUp block before the action you want to adjust. The robots use PWM
to control each motor's speed. PWM is a whole number between 0 and
255. 0 is off and 255 is max speed. A good range to choose from is 100,
crawling, to 255, attacking.
5. To adjust the range the robot sees an object using its ultrasonic input any
whole number between 1 - 400 into the variable "distance". You can find
all the variable blocks attached above the forever loop. These values
represent centimeters.
6. If you find the robot's arena edge detection movements too fast or slow
you can adjust the PWM value in the variable "Esc_Speed".
7. Once you have the movements you want upload your code and see how it
reacts in the arena.
Note: the code for changing how the robot reacts to white and black surfaces
is in the next step.
There are several ways you can make and/or purchase an arena. The most
budget-friendly is to use foam board and electric tape. You can also order a
custom one using the PNG file included in the drive folder. There are also
arenas you can purchase from robotshop.com (https://www.robotshop.com/products/basic-sumo-
robotics-challenge-mat) .
Build an Arena:
Materials:
4x 20 x 30 Foam Board
Roll of packing tape
Roll of electrical tape
Links:
usp=sharing)
1. The robot's code is set to work with a black surface and white boundaries.
To change this locate the variables "Barrier" and "surface". You can find all
the robot variables attached above the forever loop.
2. For a white surface and black boundaries set "Barrier" to 1 and "surface"
to 0.
3. For a black surface and white boundaries set "Barrier" to 0 and "surface to
1.
Step 11: Running an Event
There are many different ways these wrestling robots can be used for events
and STEM programming. Over the years TCPL has used these kinds of robots to
teach electronics, coding, and 3D printing to patrons of all ages. Here are a few
brief overviews of past library programs:
Weekly classes where tweens learned the basics of C++ through Arduino.
Each class would cover the basics of C++ syntax and how to apply it to the
robot. For example, week 1 covered variables and using functions from a
given library. Using the syntax learned, the participants programmed their
wrestling robot to execute basic movements like forward, spin, turn, etc. The
class concluded with each participant writing a script that engaged all the
components attached to the wrestling robot.
Monthly meetings where patrons of all ages learn how to edit mBlock
Scratch scripts and compete in a robot fighting tournament. At TCPL, we
offer this type of program to gain interest in the club and find new members
while giving regular participants the chance to compete.
In collaboration with the Girls Who Code at the Women In Computing at
Cornell, we turned these robots into kits and over eight weeks had
participants learn how the robot works through circuitry. We also gave
participants the chance to learn Tinkercad by designing upgrade parts for
their robots. The collaboration ended with a friendly double-elimination
tournament.
In 2024 TCPL is using the robots to offer weekly open hours for youth aged 8 -
11, teens 12 - 19, and families. With the help of an amazing volunteer crew, we
run new participants through the basics of Scratch and give regulars new
challenges and resources they can pursue to further their skills in coding. The
following is a seven-week breakdown of the TCPL Robotics Club Wrestling
Robots program.
Program Overview
Participation Level: up to 45 participants with both rooms and 20 with just the
Makerspace.
Age Range: Families with youth younger than 8, youth 8 - 11, and teens 12 - 19.
Equipment:
15 Windows laptops
20 Wrestling robots, more participants than robots form teams of 2 - 3.
20 USB cables
40 Rechargeable 9v batteries
5x Battery chargers
Spare 3D printed parts
5 hot glue stations
5 soldering stations
10 Screwdrivers + extra screws and nuts
1 Large circle arena, black surface with white boundary, fits 8 robots.
1 Large rectangle arena, white surface with black boundaries, fits 6 robots.
4 Small circle arenas, black surface with white boundaries, fit 3 robots.
1 Large display monitor with presentation laptop.
Volunteer Participation: 4 - 8
Volunteer Skills/Interest:
Youth Leadership
STEM/ STEAM Education
Engineering
Recreation Leadership
Technology
Inclusivity
Makerspaces
Community Outreach
Education
Duration: Weekly for 1.5 hours. The program ends after 7 weeks.
Organizational Goal: Provide youth within the FLL system with free hands-on
digital literacy, coding, and engineering through open-source robotics.
Organizarional Objectives:
Week 1:
Week 2:
Week 3:
Week 4:
10 min: Introductions and greetings. Icebreaker, what kind of app would you
like to make someday?
30 min: Returning participants are introduced to how the TCRT5000 sensor
works. New participants are given the first three weeks of tutorials to learn
how to adjust their robots.
10 min: Participants are encouraged to experiment with their code until their
robot performs how they want it to.
15 min: Participants break into groups around the arenas they want to
compete in. A large arena for battle royals, A large arena for battle royals on
a different surface, and small arenas for 1-on-1 battles. Battles commence
and volunteers help judge at each arena.
10 min: water break and repairs. Participants returning from last week who
did not help with repairs are encouraged to join in.
15 min: Participants return to their respective arenas and continue battling.
10 min: Battle royals, break the participants into groups of 8. Each group
battles it out in the large circle arena until one remains.
10 min: homeward bound.
Week 5:
Week 7:
Resources:
sr04/#:~:text=How%20the%20HC%2DSR04%20Ultrasonic%20Distance%20Sensor%20Works%3F,you%20can%20calculate%20th
e%20distance.)
tutorial/#:~:text=The%20DRV8833%20features%20two%20NMOS,to%201.2%20A%20per%20channel.)
ctx=59.1033.0.0.3&pos=1&cn=867706)
utm_source=mblock&utm_medium=navigation)