Sumo robot

Lego sumo robot competition

Have you ever asked the question, what is robot sumo? So have we! Robot-sumo, or pepe-sumo, is a sport in which two robots attempt to push each other out of a circle (in a similar fashion to the sport of sumo). The robots used in this competition are called sumobots.

The engineering challenges are for the robot to find its opponent (usually accomplished with infrared or ultrasonic sensors) and to push it out of the flat arena. A robot should also avoid leaving the arena, usually by means of a sensor that detects the edge.

The most common “weapon” used in a sumobot competition is an angled blade at the front of the robot, usually tilted at about a 45-degree angle towards the back of the robot. This blade has an adjustable height for different tactics.

There are also Lego Mindstorms EV3 sumo robots, in which EV3 robots compete. The robots usually have to fit in a one-foot cube.

Classes are further divided into remote-controlled and autonomous robots. Also, there might be a tethered category (varies)

image0

In this module cycle of project [p]:ROBOT you will learn how to program your own real robot that can move around, react and interact with the world, the basic fundamentals of every robot in the world. You will learn how to use touch sensors to detect objects in the world. You will detect colors and light using the color sensor, making it possible to follow lines, and you will beam out different colors to show the world what mode your robot is in. You will measure distances between objects. By combining all of the above you will at the end of the project have the knowledge to build your own robot to do whatever pleases you, be it world domination or a new cuddly friend to your pet. To make this possible you will be using a new generation robotics kit from Lego Mindstorms called EV3, but instead of using the default limited program that ships with it, you will be using programming language Python to program it directly giving you full control over everything.

Preparing For This Tutorial:

  • The LEGO Mindstorm EV3 Core set

  • lesson: Surveyors Wanted to Explore Mars and its Moons

Setting up in 12 easy steps

  1. Obtain a suitable microSD memory card.

  2. Download the latest Linux Debian Stretch ev3dev image.

  3. Download and install Etcher, a free utility that will allow you to flash the ev3dev image to the microSD card.

  4. Use Etcher to flash the image to the card.

  5. Insert the card into the EV3, boot the EV3, do some minor configuring and establishing a connection to the computer via USB, WiFi, Bluetooth or Ethernet.

  6. Download and install Microsoft Visual Studio Code (VS Code). This is a free multi platform code editor, compatible with Windows, Mac OS and Linux.

  7. Write and run some non-EV3 Python scripts.

  8. Download and unzip the starter project.

  9. Open VS Code, open the starter project folder and install two extensions.

  10. Configure VS Code.

  11. Connect VS Code to your EV3.

  12. Write and run your first EV3 Python script!

Video tutorial link: https:youtu.be/TNXqizQTZhs

Link step by step: https://sites.google.com/site/ev3devpython/

setting-up-vs-code

The LEGO Mindstorm EV3 Robot that coincides with this tutorial comes from building specific sections found Building_instruction_sumo.html

Time constraints:

  • starting from 90 min – 2 single lesson

Exercise

GOAL

The goal of Lego Sumo is for a Lego Mindstorms robot (EV3) to push or flip an opponent robot out of the ring within the allotted time frame. We realize that there are many variations to the rules for Lego Robot Sumo; these will be the rules for this tournament and we ask that entrants read and be familiar with this particular rule set at the time of the tournament, in order to avoid surprises.

TEAM

A “team” consists of one or more students who have built a robot for this event. The robot must be an autonomous robot the team has constructed themselves prior to the tournament to the specifications below. There will be limited time for adjustments and changes to the robots and their programming during the event. (There is a FREE workshop for help building and programming the robots in the prior to the event. Only one team member may enter the outer ring to start the robot; other team members may watch from outside the outer ring. Each team/robot will be assigned a number on check-in and should have a unique name or identity to be easily recognized by spectators and officials when on the field and when scoring.

Lego sumo rules

Robot Construction

The sumo robot may only be built of official Lego parts, which cannot be held together by any means other than the standard Lego construction methods (no tape, glue, stickers, etc.). No homemade sensors, multiplexores, nor modifications to Lego elements are allowed. No modification to Lego parts by gluing, cutting nor melting is allowed. Up to FOUR motors with rotation sensors are allowed, and any other sensors manufactured by Lego may be used. No “made for Lego’’ third party sensors are permitted for this tournament. It may include attachments as tactical or strategic elements that are passive or motorized, but may not include projectiles or other parts that separate from the robot. It is encouraged that robots be decorated or themed with Lego parts. There will be limited time and space for last minute design improvements and adjustments, however, the robots should be completed at the time of registration, and once check-in takes place, the robot design or its programming may no longer be modified. Robot battery should also be sufficiently charged once the robot is checked in.

Theory

In the first part of the module, we will more learn about the Lego EV3 color sensor, at the second part we will try to programme the basics of the color sensor, then connect the theory of module about the mars (touch sensor, ultrasonic sensor, gyroscope) and finally we will construct sumo robot, programm it, and participate in sumo robot competition.

Sense of Sight

* Close your eyes for a second. Then open your eyes and look around you.

* Have you ever wondered how you are able to see things around you? How do your eyes function?

* When light rays fall on the eye they pass through the pupil of the eye

* The iris changes the size of the pupil depending on the amount of light. It shrinks in the presence of less light and enlarges in the presence of more light.

* Then, what happens at the back of the eyeball?

Vision & Human Eye Anatomy

image1

Watch the “Sense of Sight – How Human Eyes Work” video (1:39 minutes) and try the activity in the video:

Robot Sensors

To remember from earlier module activity, robot sensors:

⇒ Gather information from the surroundings and send it to the computer brick

⇒ Robot sensors can only be used if a robot’s program asks for information from them!

⇒ Similarly, a robot can only act on information from the sensors if its program tells it to do so!

⇒ How do sensors send signals to the EV3 brick?

⇒ The sensors send information through the wires (similar to the nervous system in your body) that connect them to the computer brick, which uses the information if its program requires it.

How are color sensors made?

⇒ Color sensors are made using electronics.

⇒ The electronics enable the sensor to distinguish between the different colors in the light spectrum.

image2image3

The EV3 color sensor detects colors and brightness, also called intensity.

How does the EV3 Color Sensor work?

image4

The LEGO MINDSTORMS EV3 color sensor works in 3 different modes:

  • In Reflected Light Intensity Mode, the sensor measures the intensity of light reflected back from a red light–emitting lamp. The sensor uses a scale of 0 (very dark) to 100 (very light). ‘COL REFLECT’

  • In Ambient Light Intensity Mode, the sensor measures the strength o light that enters the window from its environment, such as sunlight or the beam of a flashlight. The sensor uses a scale of 0 (very dark) to 100 (very light). ‘COL-AMBIENT’

  • In Color Mode, the sensor recognizes seven colors—black (1), blue (2), green (3), yellow (4), red (5), white (6), and brown (7)—plus No

image5

image6

image7

Name: ____________________________________________

Date: _______________________

Class: ____________________

Color Sensor Pre-Quiz

  1. How do humans sense light?

  2. Provide an example “stimulus-sensor coordinator-effector-response” framework using human eyes as the color sensor.

  3. Give some examples of color sensors in engineering systems.

Name: ____________________________________________

Date: _______________________

Class: ____________________

Color Sensor Post-Quiz

  1. How does the LEGO EV3 color sensor work?

  2. Provide an example “stimulus-sensor-coordinator effector-response” framework using the EV3 color sensor.

  3. Give some examples of color sensors in engineering systems.

Short help on programming

Commands/functions needed for the exercises:

Attach and the motors responsible for moving the robot.

#!/usr/bin/env python3

LeftMotor = LargeMotor('outD')

LeftMotor.run_forever(speed_sp = 900)

LeftMotor.stop()

Initialize the color sensor for sensing the boundary of the arena (input port 4).

#!/usr/bin/env python3

LineSensor = ColorSensor('in4')

LineSensor.mode = 'COL-REFLECT'

Initialize the ultrasonic sensor for measuring the distance between the robot and it’s opponent (input port 1).

#!/usr/bin/env python3

DistSensor = UltrasonicSensor('in1')

DistSensor.mode = 'US-DIST-CM'

DistSensor.value()

Get the button reader.

#!/usr/bin/env python3

Buttons = Button()

if the center or middle button is pressed

if Buttons.enter == True:

  do
Next Section - Surveyors Wanted to Explore Mars and its Moons