Week 7

As is known by now but not at the time this would be our final week of college and thus our final week of design engineering robosumo module.

The aim of this week was to start settling on a final design for the competition. I had experience with solid works and got to work on rendering models of parts that would be used towards the final design (unfortunately this work cannot be sampled as it is on a file in college). We also confirmed that we would not be incorporating the light sensor into our design due to the fact that it didn’t fit our plan for the competition.

The first draft of the competition coding was completed as can be found below that would help to tweak and trouble shoot any problems with the motors and sensor.

// Code used for RoboSumo Tournament
// Written by Cillian O'Brien
// Last Updated 11.03.2020

  #define button 4      // Switch button
  #define echoPin 5     // Trigger Pin for Sensor
  #define trigPin 6     // Echo Pin for Sensor

  long duration, distance;      // Defines variables for duration of pulse, and distance from object

void setup() {
  Serial.begin(9600);   // Sets baud rate for info from sensor [FOR TESTING]
  
  pinMode(trigPin, OUTPUT);   // Set up the trigger pin
  pinMode(echoPin, INPUT);    // Set up the echo pin
  
  pinMode(2, OUTPUT);         // Motor 1 Forward
  pinMode(3, OUTPUT);         // Motor 1 Backward
  pinMode(8, OUTPUT);         // Motor 2 Forward
  pinMode(9, OUTPUT);         // Motor 2 Backward

  pinMode(button, INPUT);     // Switch Voltage Check
}

void loop() {
  int push = digitalRead(button);      // Setting up var for reading when button is pushed

  digitalWrite(trigPin, LOW);
  delayMicroseconds(20);
  digitalWrite(trigPin, HIGH);  // Set trigPin high
  delayMicroseconds(20);        
  digitalWrite(trigPin, LOW);   // Send pulse for 20 us
  

  duration = pulseIn(echoPin, HIGH);  //pulseIn detects the duration of pulses from trigger
  distance = (duration/2)*0.034;  // Time to reach object * Speed of Sound in cm/us
  

  Serial.print(distance);   // This is to print the distance (in cm) of the rangefinder
  Serial.println(" cm");    // is detecting [FOR TESTING]

  if (button == 1) {
    Forward();
  }

  else if (distance < 10) {
    Forward();
  }
  
  else {
    Turn();
  }
}

void Turn(){
  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(8, HIGH);
  digitalWrite(9, LOW);
}

void Forward() {
  digitalWrite(2, LOW);
  digitalWrite(3, HIGH);
  digitalWrite(8, LOW);
  digitalWrite(9, HIGH);
}

The battery pack was replaced with a 9v battery allowing us to decrease the weight of the overall robot whilst also improving the speed and ability of the motors.

I enquired about laser cutting option for the robot but due to the fact that the competition was canceled nothing was acted on and work on the final design was suspended.

Unfortunately due to covid 19 the actual robosumo competition was canceled and results would be taken from TTC only, as seen on week 5.

Leave a comment

Design a site like this with WordPress.com
Get started