How to Assemble M1 Mini Sumo Robot?

How to Assemble M1 Mini Sumo Robot?

In this article, we will assemble M1 mini sumo robot kit together. This robot model is very popular amongst beginner to moderate robot makers with versatility. Based on Arduino nano platform it is highly developable. But before development we need to assemble 🙂 In that article you will find all tips and tricks of M1 assembly and development.

What is included in mini sumo robot kit?

  • Genesis Mainboard
  • Micro Gear Motors x 2
  • M1 Chassis Plates
  • QTR1A Line Sensors
  • MR45 Opponent Sensors
  • Lipo Battery
  • Motor Wires (Red & Black)
  • Crimping Pins & Shrink Fits
  • Assembly Hardware.
  • Thin front Blade.
  • MicroStart & Remote

What wil you need?

  • Soldering tool & solder
  • Miniature Plier
  • Philips (+) screwdriver
  • Double Sided Tape
  • Silicone Gun
  • Diagonal Cutter Plier
  • Power Supply (optional)

For assembling we usually prefer assembling from bottom to top. So first we will attach motors to bottom base. I will solder motor terminals with black & red cables.

For attaching I will use 2 motor brackets and fit motors vertical.

We will use the holes in the edges of bottom plate. (Marked with white at picture)

For soldering motor cables, we just put some solder to motor terminal and cable tip seperately. And we use soldering tool’s tip to combine both. After soldering please twist the cables as in the picture. Twisting helps to minimize electrical interferences.

Now we are placing small M2 Nuts to motor bracket’s nut holes.

core motors placed to robot body

We will use M2 15mm screws. Do not overtighten and make balanced tightening at both side of brackets.

Please be careful to place brackets same as this picture, above.

After attaching motors to robot body. We will put QTR1A Line sensors to bottom side of chassis. For this we will cut female jumper pns from one side and solder to the pads. For soldering you don’t need to pass thorugh hole. Just add little solder to both pad and cable. And use tip of soldering tool to piece together.

Line sensor soldered. Your soldering also needs to be clear like that.

And for attaching sensor boards to bottom, we are using double sided tapes. As metal surface and sensor backside is flat this double sided tapes hold sensor very strong.

This places we should plan to attach line sensors, near to front and sides.

In right picture, you will see that sensors are placed under front wedge. And it makes little angle with ground. As we are reding this line sensors analog, they reflect and reponse to white & black surfaces in that angles without any problem.

Ater that, we will contiune robot assembly by attaching MR45 sensors with 20mm length M3 screws (6 Pieces) and 5 Standoffs (20mm Length Models).

One small important thing is here, we are attaching sensor screws from bottom, because standoff nuts and sensor holes are very near. For minimizing touch of both parts we reverse place sensor screws.

M3 20mm screws (5 pieces) and M3 nuts are used to connect sensor to body.

Five piece standoff (20mm length) connected with M3 nuts from bottom.

Screwing from bottom.

When sensor and standoff assembly finished, we are attaching SLT20 wheels to robot body. For this purporse we will use allen wrench. This screwing hole should face to motors shafts flat side (Motor shafts are D like section not circular).

Please do not use too much force for tightening. 

For alignment, please use some flat thing like ruler. Wheel rim shouldn’t go out of chassis.

Left to right, It shouldn’t be more than 10cm.

After attaching wheel rims and controling dimensions. You can put silicones of wheels.

Now we can go to top plate. This is little thinner body part which attached to bottom plate and also attachs the Genesis Robot Controller.

Before assembling both plates first we need to screw small standoffs to top plate. I am using 4 short standoffs (8mm). Again this standoffs will be placed reverse for making clearence to wheels from bottom.

In that stage, we are using M3 countersunk screws, as their diameter is smaller than normal panhead screws.

4 piece standoff placed firmly.

Now we will assemble both plates.

For this assembly please also add your lipo battery to middle part and close with top plate. Sensor cables can go thorugh front spaces of top plate and motor cables should pass from back middle space.

We will use 5 piece of M3 panhead 8mm screw. 

Please try to pass sensor cables front spaces. Same as picture above.

After that you can screw your Genesis Mainboard with M3 nuts too.

Now we can pass to crimping. This will require little hand skill with miniature pliers.

We are cutting excessive cables with diagonal cutter plier.

Crimping can be made with dedicated crimp tool or standart miniature plier. In our example I made with both method and both output same connection quality.

For crimping we need to reach conductive sides of cables. So I am using one cable stripper, you may use also diagonal cutter for it.

Firstly, we are stripping sensor cables 5mm length.

Inside tabs, little bend with plier.

Second, we are completely bending conductive sides to inside, 180 degree.

I put wire completely inside crimp pin. After that I am using plier and tightly bend 2 small tabs inside of crim pin and later 2 outside pins.

Outer tabs bend to hold cable well.

For crimping with special tool, we use same procedure. 2 times bending (1st inside, 2nd outside tabs)

These are made with plier.

These are made with special tool. (Engineer PA-09)

All opponent sensor cables crimped!

Here, we are using small shrink fit parts. Just place it outside of crimped pins and use hot air or small lighter fire. Shrink fits are very special tubes that their diameter decreases nearly %40 when heated.

All pins are processed with shrink fits.

Now we can connect our motors and power cables to Genesis Mainboard.

We are cutting motor cables to make more tidy fit. After that strip motor cable conductives from 7-8mm.

And we are attaching left & right motors to terminals. Now we don’t know which direction motors will turn true. But we will use trial & error method. If robot is going backwards except forward. I will reverse motor cables. (For this purpose we will upload 1st only forward movement code).

Here the table for attaching sensors to Genesis Mainboard, we are using 5 inputs of total 8 free inputs.

SensorsPin Number
Left Bottom Line Sensor (QTR1A)A0
Right Bottom Line Sensor (QT1A)A1
Left Opponent SensorA2
Middle Opponent SensorA3
Right Opponent SensorA4

After looking this table, you may think about why all of them is connected to analog pins.

Actually we are only using line sensors as analog and opponents sensors are read digital. With declaring A2, A3, A4 ad digital input we can use them as same as digital pin of Arduino. Excep A6 and A7 all analog pins can be used as digital I/O too.

Genesis I/O Terminal. All left pins are ground (0V) all middle line is 5V and all right lines are signal inputs or outputs (depending on your coding)

While placing sensor cables to male headers, spece will be very tight. Our suggestion is start attaching pins from outside to inside. So 1st connect Ground pins, later positive supply pins and later signal pin of sensor. One by one.

Use plastic tie wrap for organising cables.

For battery to Genesis mainboard power connection we are using JST connectors. They are polarized plugs, which eliminare reverse attachments.

If all assembly is ready now we can attach power to robot.

If you have power supply I suggest first attaching power from it not battery. Because if you soldered or attached something wrong. Power supply can limit the current and you can protect your circuit. If you don’t have now please check your all connections again. And be careful to polarity of battery.

When you apply power, Genesis’s Power light should light on. Well done! Board can work from 7V to 28V. In that robot we are using 2 cell LiPo battery (total 8.4 Volts).

Lastly… 🙂 We are attaching front blade. This thin mini sumo robot blade has tape at backside, remove it and place to front incline at flat surface. Please be careful as this blade is very sharp. (You may make some protective cover from thick papers)

Now you can attach your Arduino Nano to computer and program first forward code to robot, below. This code will continously drive motors forward.

In some computers, Arduino nano controller is not recognised when attached to Genesis. If this happens please remove Arduino nano from board, program it and again attach to mainboard.

//MOTOR CONTROL PINS
int RPwm = 11;
int RDir = 13;

int LPwm = 3;
int LDir = 12;

void setup() {
pinMode(RPwm, OUTPUT);
pinMode(RDir, OUTPUT);
pinMode(LPwm, OUTPUT);
pinMode(LDir, OUTPUT);
}

void loop() {
digitalWrite(LDir, HIGH);
analogWrite(LPwm, 255);
digitalWrite(RDir, HIGH);
analogWrite(RPwm, 255);
}

After uploading this code, both motors should turn forward. If one of them or both turns backward we will simply reverse motor cables.

And here is the full mini sumo robot code below:

// GENESIS BOARD MINI SUMO ROBOT PROGRAM
//FOR 3 OPPONENT SENSOR, 2 EDGE SENSOR
// JSUMO 01/2020
///////////////////////////////////////

//MOTOR CONTROL
int RPwm = 11;
int RDir = 13;

int LPwm = 3;
int LDir = 12;

//LED & BUZZER
int Buzzer = 9;
int ArduLed = 8;

//EDGE & CONTRAST SENSORS
int Redge = A0;
int Ledge = A1;

//TRIMPOTS
int SPD = A7;
int TRN = A6;

//OPPONENT SENSORS
int LSens = A4;
int RSens = A2;
int MSens = A3;

int LFSens = A5;
int RFSens = 4;

// DIPSWITCH & BUTTON
int Button = 10; // Can be used as start pin too.
int DS1 = 5;
int DS2 = 6;
int DS3 = 7;

//VALUES
int Speed =50;
int MaxSpeed = 80; // Idle Speed while no sensor giving data.
int TurnSpeed = 65; // Left and Right Forward Turning Speed
int EdgeTurn = 150; // Turning Time variable when minisumo sees white line
int Duration; // Turning Time at minisumo starting.
int LastValue = 5; // Last Value Variable for remembering last Opponent sensor sense.

void setup()
{
pinMode(LSens, INPUT); // Left Opponent Sensor Input
pinMode(RSens, INPUT); // Right Opponent Sensor Input
pinMode(MSens, INPUT); // Middle Opponent Sensor Input

pinMode(Buzzer, OUTPUT); // Buzzer Declared as Output
pinMode(ArduLed, OUTPUT); // Buzzer Declared as Output
pinMode(Button, INPUT); // Buzzer Declared as Output

pinMode(RPwm, OUTPUT); // Four PWM Channel Declared as Output
pinMode(RDir, OUTPUT);
pinMode(LPwm, OUTPUT);
pinMode(LDir, OUTPUT);

digitalWrite(Buzzer, LOW); // Buzzer Pin Made Low for Silence 🙂
digitalWrite(ArduLed, LOW); // Arduino Mode Led Made Low
digitalWrite(DS1, HIGH); // 3 Dipswitch Pin Pullups Made
digitalWrite(DS2, HIGH);
digitalWrite(DS3, HIGH);

digitalWrite(LSens, HIGH); // Opponent Sensor Pullups Made
digitalWrite(RSens, HIGH);
digitalWrite(LFSens, HIGH);
digitalWrite(RFSens, HIGH);
digitalWrite(MSens, HIGH);
Serial.begin(9600);
}

//Motor Control Function
void Set_Motor (float Lval, float Rval, int timex){
Lval = Lval*2.5;
Rval = Rval*2.5;
if (Lval >=0) {
analogWrite(LPwm, Lval);
digitalWrite(LDir, LOW);
} else {
Lval=abs(Lval);
digitalWrite(LDir, HIGH);
analogWrite(LPwm, Lval);
}
if (Rval >=0) {
analogWrite(RPwm, Rval);
digitalWrite(RDir, HIGH);
} else {
Rval=abs(Rval);
digitalWrite(RDir, LOW);
analogWrite(RPwm, Rval);
}
//If you want to see Speed Values please uncomment bottom line.
// Serial.print(Rval); Serial.print(“-“); Serial.println(Lval);
delay(timex);
}
void loop() {
digitalWrite(RPwm, LOW);
digitalWrite(LPwm, LOW);
tone(Buzzer, 18, 100); // Pin, Frequency, Duration
//////////////////////////////////////////////
// This function below, used for stopping robot while no button is pushed or Microstart is not triggered.
while (digitalRead(Button)==0) {
Serial.println(“Button Press Waited”);
Set_Motor(0,0,1);
/// Sensor Control While Waiting The Button Press ///
if ( digitalRead(MSens)==LOW || digitalRead(RSens)==LOW || digitalRead(LSens)== LOW || digitalRead(RFSens)==LOW || digitalRead(LFSens)== LOW || analogRead(Redge)< 100 || analogRead(Ledge)< 100 ) { digitalWrite(ArduLed, HIGH);}
else { digitalWrite(ArduLed, LOW); }
}
///////////////////////////////////////////////
if (digitalRead(Button)==1) {

Duration=(analogRead(TRN)/5); // Duration variable based on TRN (A6) trimpot
Duration=205-Duration; //

Serial.println(“5 Sec Routine Started”);

for (int i = 0; i < 5; i++){ digitalWrite(Buzzer, HIGH); digitalWrite(ArduLed, HIGH); delay(100); digitalWrite(Buzzer, LOW); digitalWrite(ArduLed, LOW); delay(900); }

if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==1){
Serial.print(“LEFT TURN”);
Set_Motor(-100,100,Duration); //
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==0) {
Serial.print(“MIDDLE DIRECT”);
Set_Motor(80,80,2);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Sag”);
Set_Motor(100,-100,Duration);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==0 && digitalRead(DS3)==0){
Serial.print(“Left Circle”);
Set_Motor(100,36,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==1){
Serial.print(“Right Circle”);
Set_Motor(36,100,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Reverse 180”);
Set_Motor(-100,100,Duration*2); // One Duration time is for 90 degree, so we multiply by 2.
}
Serial.print(“OK”);
digitalWrite(Buzzer, LOW);
EdgeTurn=(analogRead(TRN)/5); // Raw value comes with 0 to 1023, we divide it for 0 t0 205 mS turning time.
EdgeTurn=205-EdgeTurn; //

}

//Main Loop
while(1) {
/// Edge Sensor Control Routine ///
digitalWrite(ArduLed, LOW);
if (analogRead(Ledge)<300 && analogRead(Redge)> 300) {
digitalWrite(Buzzer, LOW);
digitalWrite(ArduLed, HIGH);
Set_Motor(-100, -100,55); // Backward for 55 mS.
Set_Motor(-100, 100, EdgeTurn); // Left Backward, Right Forward, Turning Time Based on ETRN Trimpot
LastValue=5;
}
else if (analogRead(Ledge)> 300 && analogRead(Redge)< 300) {
digitalWrite(Buzzer, LOW);
digitalWrite(ArduLed, HIGH);
Set_Motor(-100, -100,55); // Backward for 55 mS.
Set_Motor(100, -100, EdgeTurn); // Right Backward, Left Forward, Turning Time Based on ETRN Trimpot
LastValue=5;
}
else if (analogRead(Ledge)< 300 && analogRead(Redge)< 300) {
digitalWrite(Buzzer, LOW);
digitalWrite(ArduLed, HIGH);
Set_Motor(-100, -100,55); // Backward for 55 mS.
Set_Motor(100, -100, EdgeTurn); // Right Backward, Left Forward, Turning Time Based on ETRN Trimpot
LastValue=5;

}else
/// Opponent Sensor Control Routine ///
// Please uncomment below line if yu are using microstart, When microstart gives 0V it will stop motors.
//while (digitalRead(Button)==LOW) {Set_Motor(0, 0, 20); digitalWrite(Buzzer, HIGH); LastValue=3;} digitalWrite(Buzzer, LOW);
if (digitalRead(MSens)==LOW) {Set_Motor(MaxSpeed, MaxSpeed,1); digitalWrite(Buzzer, HIGH); LastValue=5;} else
if (digitalRead(LSens)== LOW) {Set_Motor(-40, TurnSpeed,1); digitalWrite(Buzzer, HIGH); LastValue=7;} else
if (digitalRead(RSens)==LOW) {Set_Motor(TurnSpeed, -40,1); digitalWrite(Buzzer, HIGH); LastValue=3;} else
if (digitalRead(LFSens)== LOW) {Set_Motor(-40, TurnSpeed,1); digitalWrite(Buzzer, HIGH); LastValue=7;} else
if (digitalRead(RFSens)==LOW) {Set_Motor(TurnSpeed, -40,1); digitalWrite(Buzzer, HIGH); LastValue=3;} else
{
digitalWrite(Buzzer, LOW);

Speed=(analogRead(SPD)/10.3); // This raw speed value comes with 0 to 1023 so we divide to 10.3 After that it is 0 to 99 integer.
Speed=100-Speed; // This is used for reversing trimpot dial direction at board.

if (LastValue==5) { Set_Motor(Speed, Speed,1);} else // Forward, Based on SPD (A7) Trimpot
if (LastValue==7) { Set_Motor(-20, Speed,2);} else // Left Turning Based on SPD (A7) Trimpot
if (LastValue==3) { Set_Motor(Speed, -20,2);} // Right Turning Based on SPD (A7) Trimpot
}
}

}

So, What this robot code does?

The code above is mini sumo robot code for 3 opponent sensor (we attached MR45s) and 2 line sensor (QTR1As). First we declare every input, output with special names.And in setup function, we declare this names (dedlared as Arduino Pin numbers) if they are input or output.

Also in the code you will see some special function written as Set_Motor. Normally for controlling speed and direction of DC motors we are using 2 digital pin for every motor. (1 for PWM speed Control, 1 for Direction Control). With that Set_Motor function we are controlling motors more clearly.

For instance when I write Set_Motor(100,100,50); That means Left and Right Motor Speed %100 (Actually 250/255) speed forward for 50 milliseconds (0.05 Second, very short duration). If I write Set_Motor(-30,80,700) means left motor %30 backward, right motor %80 forward for nect 700 milliseconds (0.7 Second). Simple 🙂

Now if we come to main loop, first it waits until button is pressed or start module is triggered (Both option gives logic 1). So while receiving digital 0 we stop motors and also at sametime inside loop, we control sensors with if statement.

When button is pushed or start module triggered it jumps to dipswitch tactics. At Genesis mainboard we are using 3 position red dipswitch for choosing tactics. If you are not certain bout where is tactics, I am pasting below.

 if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==1){
Serial.print(“LEFT TURN”);
Set_Motor(-100,100,Duration); //
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==0) {
Serial.print(“MIDDLE DIRECT”);
Set_Motor(80,80,2);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Sag”);
Set_Motor(100,-100,Duration);
}
else if (digitalRead(DS1)==1 && digitalRead(DS2)==0 && digitalRead(DS3)==0){
Serial.print(“Left Circle”);
Set_Motor(100,36,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==0 && digitalRead(DS3)==1){
Serial.print(“Right Circle”);
Set_Motor(36,100,650);
}
else if (digitalRead(DS1)==0 && digitalRead(DS2)==1 && digitalRead(DS3)==0){
Serial.print(“Reverse 180”);
Set_Motor(-100,100,Duration*2); // One Duration time is for 90 degree, so we multiply by 2.
}

Additional Informations

How to Change Opponent Sensor Sensing Distance?

You can change the detection distance of robot sensor with this small trimpot head. Place some object to front of sensor and slowly dial, when it sees, red light will turn on. Increade object distance until red light turn off.

How to clean wheel surfaces?

We are using standart alcohol based cleaners like cologne. Clean wheels dramatically change robot’s performance to better so always use cleaners after every match.

1 Comment

  1. Reply

    It’s a great content !

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these <abbr title="HyperText Markup Language">HTML</abbr> tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>