Quark 2016 – BITS Pilani, K.K. Birla Goa Campus

Quark 2016 – BITS Pilani, K.K. Birla Goa Campus

Quark 2016 – A Cosmic Odyssey

Days of festival: 5th, 6th & 7th February 2016

I participated in Line Following, Roborace and, for the first time, Open Showcase!

RoboRace

Objective: Design & build a remote controlled all-terrain racer that can traverse any given path with obstacles like rocks, sand, slopes, uneven ground, mud, etc.

Dates of competition: 5th & 6th

Venue: Uneven grounds outside B-Dome

Home test report: Excellent traction, thanks to the custom-made wheels (each wheel was actually a pulley with a track belt bound tightly over it) Gains speed very quickly and can even climb out of a small car tyre.

Results:

5th Feb, Round 1 – The bot completed the track without stopping, and clocked a very good timing, however, the high traction wheels turned out to be a massive hindrance while making spot turns. This factor slowed it down, but it made up for that on the straight paths.

The bot qualified for Round 2, which was to be held on Day 2, but unfortunately, due to a last minute shorting onboard the wireless module, the bot was unable to participate.

Quark_2016_RoboRace_participation_certificate

Open Showcase

Objective: Present an innovative idea that solves a problem.

Dates of competition: Day 2

Venue: CC lobby

My Idea (for the EEE category): CUA (Computer Usage Alert) is a plug-n-play USB device that alerts you to get up and stretch at 20 minute intervals. It has an ATtiny85 micro controller with a program that sends a signal to a buzzer to beep every 20 minutes, thereby alerting you to get up. This process continues until it is unplugged or the computer/laptop to which it is plugged is shut down.

The judging criteria was as follows:

  • Innovation
  • Feasibility and Sustainability
  • Cost Effectiveness
  • Social Viability
  • Discipline
  • Project Report

Quark_2016_Open_Showcase_participation_certificate

Line Following

Objective: Design, build & program a line following robot (LFR) which can traverse a black track on a white background with obstacles like acute angle, obtuse angles, right angles, dashed lines, curves and reach the finish line in shortest possible time. The track width will be 2cm to 3cm. (As per the rules mentioned online)

Screen Shot 2016-02-16 at 8.28.51 pm

Dates of competition: 6th & 7th

Venue: C-306

Home test report: Running very well. I’d say that is has an 80% chance of making a new record.

Competition day: “Holy mackerel! The track width is 4cm!“. I asked the organiser about it. He measured the track width and calmly told me that extra calibration time would be given. And as if to put salt on that wound, the track had 4 places where there were curved, dashed lines with acute turns onto more curved lines!

Results:

6th Feb, Trial 1 – The LFR started out well and then went completely cuckoo. Though it has a PID algorithm in it, the LFR seems to be in its own world. (Thanks to the extra centimetre in the width)

6th Feb, Trial 2 – I managed to fix a few turns, but the PID algorithm still seems to be completely inactive.

(Fortunately, everyone had problems running on the first day, so everyone qualified for the next round on day 2. That night, I sat coding till 1:00 A.M. and finally managed to fix it.)

7th Feb, Trial 1 – The new code is working and the PID is perfect, but a few changes still need to be made in the acute turns. Overall, it’s running well.

7th Feb, Trial 2 – This run went very well, except for the fact that it went off the track 5 times (which means that 25 seconds will be added to my total time of 38 seconds, as a penalty)

I finished my turn just after lunchtime, so I had the rest of the day to go around the campus and watch the final rounds of the other competitions.

At around 4 o’clock I received a phone call from the organiser, telling me that I had won the 2nd place.

IMG_20160207_185732

 

For all you geeks out there, here’s my LFR code. Feel free to tweak and reuse:

#include <QTRSensors.h>
//Code written by Raunak Hede
//https://raunakhede.com
#define Kp 1 // experiment to determine this, start by something small that just makes your bot follow the line at a slow speed
#define Kd 15 // experiment to determine this, slowly increase the speeds and adjust this value. ( Note: Kp < Kd) 
#define rightMaxSpeed 180 // max speed of the robot
#define leftMaxSpeed 180 // max speed of the robot
#define rightBaseSpeed 50 // this is the speed at which the motors should spin when the robot is perfectly on the line
#define leftBaseSpeed 50  // this is the speed at which the motors should spin when the robot is perfectly on the line
#define NUM_SENSORS  8     // number of sensors used
#define TIMEOUT      2500  // waits for 2500 us for sensor outputs to go low
#define EMITTER_PIN  12     // emitter is controlled by digital pin 2

#define rightMotor1 4
#define rightMotor2 11
#define rightMotorPWM 5
#define leftMotor1 3
#define leftMotor2 6
#define leftMotorPWM 10

int P, D;
int leftMotorSpeed = 50;
int rightMotorSpeed = 50;
int turn = 100;

QTRSensorsRC qtrrc((unsigned char[]) {14, 15, 16, 17, 18, 19, 7, 8}, NUM_SENSORS, TIMEOUT, EMITTER_PIN);//sensor connected
unsigned int sensorValues[NUM_SENSORS];
void setup()
{
  pinMode(rightMotor1, OUTPUT);
  pinMode(rightMotor2, OUTPUT);
  pinMode(rightMotorPWM, OUTPUT);
  pinMode(leftMotor1, OUTPUT);
  pinMode(leftMotor2, OUTPUT);
  pinMode(leftMotorPWM, OUTPUT);
  
  #define rup digitalWrite(rightMotor1, HIGH);digitalWrite(rightMotor2, LOW);
  #define lup digitalWrite(leftMotor1, HIGH);digitalWrite(leftMotor2, LOW);
  #define rdown digitalWrite(rightMotor1, LOW);digitalWrite(rightMotor2, HIGH);
  #define ldown digitalWrite(leftMotor1, LOW);digitalWrite(leftMotor2, HIGH);
  
  #define f lup;analogWrite(leftMotorPWM, 80); rup;analogWrite(rightMotorPWM, 80);
  #define l ldown;analogWrite(leftMotorPWM, turn);  rup;analogWrite(rightMotorPWM, turn);
  #define r lup;analogWrite(leftMotorPWM, turn);  rdown;analogWrite(rightMotorPWM, turn+50);
  #define b ldown;analogWrite(leftMotorPWM, 80); rdown;analogWrite(rightMotorPWM, 80);
  #define s analogWrite(leftMotorPWM, 0);  analogWrite(rightMotorPWM, 0);

  pinMode(13, OUTPUT);
  digitalWrite(13, HIGH);
  pinMode(12, OUTPUT);
  digitalWrite(12, HIGH);
  for (int i = 0; i < 500; i++)  // make the calibration take about 10 seconds
  {
    qtrrc.calibrate();       // reads all sensors 10 times at 2500 us per read (i.e. ~25 ms per call)
  }
  digitalWrite(13, LOW);// turn off Arduino's LED to indicate we are through with calibration
 
  //print the calibration minimum values measured when emitters were on
  Serial.begin(9600);
  for (int i = 0; i < NUM_SENSORS; i++)
  {
    Serial.print(qtrrc.calibratedMinimumOn[i]);
    Serial.print(' ');
  }
  Serial.println();
  
  // print the calibration maximum values measured when emitters were on
  for (int i = 0; i < NUM_SENSORS; i++)
  {
    Serial.print(qtrrc.calibratedMaximumOn[i]);
    Serial.print(' ');
  }
  Serial.println();
  Serial.println();
  delay(500);
}
int lastError = 0;

void loop()
{
  unsigned int position = qtrrc.readLine(sensorValues);
  if (sensorValues[7] < 900 && sensorValues[6] < 900 && sensorValues[5] > 900 && sensorValues[4] > 900 && sensorValues[3] > 900 && sensorValues[2] > 900 && sensorValues[1] > 900 && sensorValues[0] > 900)
  {//right
      s;delay(50);  r;delay(300); s;delay(50);
  }
  else if (sensorValues[7] > 900 && sensorValues[6] > 900 && sensorValues[5] > 900 && sensorValues[4] > 900 && sensorValues[3] > 900 && sensorValues[2] > 900 && sensorValues[1] < 900 && sensorValues[0] < 900)
  {//left
      s;delay(50);  l;delay(300); s;delay(50);
  }
  
  else if (sensorValues[7] < 900 && sensorValues[6] > 900 && sensorValues[5] > 900 && sensorValues[4] > 900 && sensorValues[3] > 900 && sensorValues[2] > 900 && sensorValues[1] > 900 && sensorValues[0] > 900)
  {//right
      s;delay(50);  r;delay(280); s;delay(50);
  }
  else if (sensorValues[7] > 900 && sensorValues[6] > 900 && sensorValues[5] > 900 && sensorValues[4] > 900 && sensorValues[3] > 900 && sensorValues[2] > 900 && sensorValues[1] > 900 && sensorValues[0] < 900)
  {//left
      s;delay(50);  l;delay(280); s;delay(50);
  }
  
  else if (sensorValues[7] < 900 && sensorValues[6] < 900 && sensorValues[5] < 900 && sensorValues[4] < 900 && sensorValues[3] < 900 && sensorValues[2] < 900 && sensorValues[1] < 900 && sensorValues[0] < 900)
  {//acute right
    f;
  }
  
  else
  {//Execute the PID algorithm
    unsigned int sensors[8];
    int position = qtrrc.readLine(sensors);//get calibrated readings along with the line position
    int error = position-3500;
    
    P = Kp * error;
    D = Kd * (error - lastError);
    
    int motorSpeed = P + D;
    lastError = error;
    
    int rightMotorSpeed = rightBaseSpeed + motorSpeed;
    int leftMotorSpeed = leftBaseSpeed - motorSpeed;
  
    if (rightMotorSpeed > rightMaxSpeed ) rightMotorSpeed = rightMaxSpeed; // prevent the motor from going beyond max speed
    if (leftMotorSpeed > leftMaxSpeed ) leftMotorSpeed = leftMaxSpeed; // prevent the motor from going beyond max speed
    if (rightMotorSpeed < 0) rightMotorSpeed = 0; // keep the motor speed positive
    if (leftMotorSpeed < 0) leftMotorSpeed = 0; // keep the motor speed positive
  
    //move forward with appropriate speeds
    digitalWrite(rightMotor1, HIGH);
    digitalWrite(rightMotor2, LOW);
    analogWrite(rightMotorPWM, rightMotorSpeed);
    digitalWrite(leftMotor1, HIGH);
    digitalWrite(leftMotor2, LOW);
    analogWrite(leftMotorPWM, leftMotorSpeed);
  }
}
Quark 2015 – Birla Institute of Technology & Science (BITS) Goa, Vasco

Quark 2015 – Birla Institute of Technology & Science (BITS) Goa, Vasco

Quark 2015!

This is one of India’s largest tech fest, which took place recently at the BITS Pilani, Goa campus in Vasco.

The festival was from 6th to 8th of February and had some great minds from across the world attending it.

I was there too. Participating in Line Following, Robot Race and for the first time, Robokick!

20150114_165503  _DSC0771  IMG_0049

Line Following:

Objective: Design and build a fully autonomous robot which can traverse a black line on a white background.

Arena: Track had normal curves, right angles, sharp acute-angle turns, T-junctions, X-junctions, Y- junctions, Inverted Y- junctions and loops.

Line Follower performance: LFR v2.0 was smoooooth, thanks to the PWM control. (Pulse Width Modulation) It traversed all the angles well (90, 60 & 120 degree). Even the T- junctions were quite good apart from the fact that recovery took time. The only problem occurred at the inverted Y- junctions. Due to multiple case clashes (a common error faced by maze solving line followers), the bot took the first path that it sensed. i.e. the pathway back into the loop! Oh nooooo! And there it would continue traversing the loop until I picked it up and put it back on the correct path. (with a hefty penalty of course!)

Main Components:

  • Arduino UNO, rev 3 (ATMEGA 328)
  • L298 motor driver
  • 12v, 1A, Li-ion rechargeable battery
  • RKI-1032 digital line sensor (7 sensor array with TTL output)
  • 320 rpm BO motors

Click on the link to download the C++ code for LFR at Quark 2015.

Quark2015_BITS_Line following

Roborace:

Objective: Design and build a wired/wireless, remote controlled all terrain racer (Basically, a smaller version of an ATV, without you sitting inside it.)

Arena: Track was on a rough terrain which caused a lot of bouncing about. It was a world of obstacles. The track consisted of slopes up to 45 degrees, car tires with loosely stretched plastic to cover the hollow depression, dry grass, sand, a slow windmill, soda-can speed breakers & thermocol obstacles which had to be pushed into fixed areas. Another extremely difficult obstacle, was the double slope platform with a slit in the middle. This consisted of a 45 degree incline upwards, a flat platform with humps of about 1.5 feet and a 45 degree slope downwards. Now while you’re imagining all this, add a 3 inch slit in the middle of the 9 inch wide path. If you’re still having trouble visualising this perilous path, then please watch the video below.

Racer performance: ATR v1.0 performed exceedingly well here. Just a few glitches like hitting the windmill, rumbling off the track once or twice, and being unable to climb the 45 degree incline caused deduction of points. The racer also had weight problems while trying in vain to get out of the sunken plastic in the tire. I think it’s worth mentioning that ATR was one of the few wireless racers on the whole campus.

Main Components:

  • RKI-1014 Rx/Tx module (RF 4-way remote control)
  • DPDT switches
  • Lock n Lock tiffin
  • 12v, 1A, Li-ion rechargeable battery
  • 500 rpm Gear motors
  • Powder coated multi-purpose metal chassis

Quark2015_BITS_Roborace

Robokick:

Objective: Design and build a wired/wireless, remote controlled robot which can play one-on-one football with another robot. It should be able to be a good striker and, at the same time, be able to defend it’s own goal.

Arena: This event was held in a square arena of 3×3 meters. The arena had markings on it just like a real football field. There were two open shoeboxes used as goals. A smiley sponge ball was used in the game.

Robot performance: Frankly speaking, my registration for the Robokick event was a spot entry. Previously I had no intention of participating in Robokick, mostly because I had no clue whether my bot would meet the requirements. (They did mention a shooting mechanism on the website. Something my bot lacked completely.) During the Roborace, an announcement was made stating that participants of Roborace were also eligible for Robokick and that spot entries would be accepted. And so I entered the competition with ATR v1.0! After adding a couple of metal plates near the wheels, the very same robot which jumped off a ramp, was ready to play football!

Main Components:

  • RKI-1014 Rx/Tx module (RF 4-way remote control)
  • DPDT switches
  • Lock n Lock tiffin
  • 12v, 1A, Li-ion rechargeable battery
  • 500 rpm Gear motors
  • Powder coated multi-purpose metal chassis
  • Small metal rectangular plates from various MECHANIX sets (for striking/goalkeeping)

 

Surprisingly, I won the 3rd place at Robokick☺

IMG_20150208_220531223_HDR

Technival 2014 – National Institute of Technology, Goa

Technival 2014 – National Institute of Technology, Goa

Recently, NIT Goa had their techfest, Technival 2014. I participated in two events held there.

The first was Laburinthos (Line following) held on 8th November

Laburinthos

And the second was RUSH, a race for All Terrain Vehicles.

RUSH

LFR v1.0 came 4th for Laburinthos and ATV Bot bagged the 2nd place in RUSH.

Laburinthos was a simple line following competition where speed was of essence. The track was quite large and mostly consisted of straight lines and sudden sharp curves. The biggest challenge was speed and lighting.

LFR v1.0

Towards the end of the track a false trigger caused LFR v1.0 to turn back and hence it took longer to finish the track.

Here’s a video of LFR v1.0 at the line following event:

 

RUSH was a race for which teams had to build an All Terrain Robot which could race on rollers, steep slopes, rubble and sand. There were also potential hazards like rock pendulums. The robot also had to maneuver through narrow spaces between vertical poles, which if touched, would result in a time penalty of 5 seconds. The same penalty was given for touching the walls and the rock pendulums.

ATV Bot at RUSH

Here’s a video of ATV Bot at the event:

Some Photographs of the event.

Photo & Video Credits:  Annette Paul, Sanmitra Naik, Roheet Hede

ATV Bot

ATV Bot

ATV Bot is exactly what it’s name says: an All Terrain Vehicle.

2014.10.21_ATV BOT_3

Equipped with 4 powerful 500 rpm DC geared motors and a strong powder coated metallic chassis, this bot can even race across gravel! One of it’s best features is that it uses an RF (radio frequency) module and hence allows you to control it from a distance of more than 50 metres. A 12 volt Lithium-ion rechargeable battery ensures extended battery life and recharge after 3 days of usage.

And guess what? It’s even got a Roll Cage!

The roll cage, made from metal Mechanix parts, prevents damage that could be caused to any delicate hardware on board like the RF module, battery, etc.

Here’s a complete list of all the components used to make the ATV Bot:

ATV Bot in action: