Thursday, November 21, 2013

Light Seeker 2000 Meeting Minutes 11-21


Light Seeker 2000 Meeting Minutes


November 21, 2013
I.      Call to order

Ken Amici called to order the regular meeting of the LightSeeker2000 at 8:30am on November 21, 2013 at Design Lab.
II.      Roll call

Ken Amici conducted a roll call. The following persons were present: Andre D’Entremont, Nash Khan.
III.      Approval of minutes from last meeting

Ken Amici read the minutes from the last meeting. The minutes were approved as read.
IV.      Open issues

a)      Finding a Track

b)      Wanting to add blinkers
V.      New business

a)      Our two photo sensors are not the same therefore the sensitivity is different. Trying to find a similar Photo Sensor

b)      Lost a DC Motor, need to get a second one.

c)      Need to find a way to mount the motor and connect it to one of the axels to turn the track

d)     Adding pictures to show the setup of the arduino board.

e)      Trying to play around with a code to calibrate the photo sensors so they will read the same values when initially exposed to the same light. This means when we first turn on the robot, he will have a calibrate indication light on, and we will put a flash light on each sensor (with the same brightness) and then cover both sensors to which we hope will cause the sensors that are different to then read the same values when exposed to the same light. Initial code is attached after the minutes.

f)       Test the track links to ensure they fit together appropriately and had motion that will allow our tracks to move the robot

g)      Created a SolidWorks representation for the tracks we are going to use

h)      Contemplating using the servo hack we discussed in class instead of a DC Motor due to our limited knowledge of how to setup external power sources and wiring into the arduino board

i)        Discussed materials needed for net group meeting to truly test our system at the current point:

1.      Electrical tape

2.      Servo Motor (2)

3.      More Pins for tracks

4.      More links for tracks

5.      Additional photo sensors

VI.      Adjournment

Ken Amici adjourned the meeting at 10:30am.

Minutes submitted by:  Ken Amici 

Minutes approved by:  Andre D’Entremont
 

Pictures from Today’s Meeting

Just a few links connected



Showing the mobility of the links



Setup to check to see if the calibration code was working properly



One of the first setups ideas to have two photo sensors that would be connected to longer wires and will hang off the side of the robot to allowing light readings from both sides of the robot



New idea of how to connect the Photo Sensors that cut down on the number of wires and wire lengths.

 



 

Current state of where we are on the wiring. Still need to connect the Servo Motors that will spin the track.

Modification to Calibration Code


This is a modified code that I got from online. It was initially set to calibrate just one Photo Sensor and LED, but I changed the code to now calibrate two Photo Sensors and then control two LEDs to ensure that I was able to perform the calibration correctly. Unfortunately, this does not tell me if the readings are the same. I will have to add a print function to read the values on the com port.

// These constants won't change:

const int LeftSensor = A0;   // Left Sensor

const int RightSensor = A1; // Right sensor

const int LeftLED = 9;        // pin that the LED is attached to

const int RightLED = 6;

 

// Left sensor:

int sensorValueLeft = 0;       // the sensor value

int sensorMinLeft = 1023;      // minimum sensor value

int sensorMaxLeft = 0;         // maximum sensor value

 

// Right sensor:

int sensorValueRight = 0;       // the sensor value

int sensorMinRight = 1023;      // minimum sensor value

int sensorMaxRight = 0;         // maximum sensor value

 

void setup() {

// turn on LED to signal the start of the calibration period:

 pinMode(13, OUTPUT);

 digitalWrite(13, HIGH);

 

// calibrate during the first five seconds

 while (millis() < 5000) {

 sensorValueLeft = analogRead(LeftSensor);

 sensorValueRight = analogRead(RightSensor);

 

 // record the maximum sensor value

 if (sensorValueLeft > sensorMaxLeft) {

  sensorMaxLeft = sensorValueLeft;

 }

  if (sensorValueRight > sensorMaxRight) {

  sensorMaxRight = sensorValueRight;

 }

 

// record the minimum sensor value

 if (sensorValueLeft < sensorMinLeft) {

  sensorMinLeft = sensorValueLeft;

 }

  // record the minimum sensor value

 if (sensorValueRight < sensorMinRight) {

  sensorMinRight = sensorValueRight;

 }

 }

 

// signal the end of the calibration period

 digitalWrite(13, LOW);

}

 

void loop(){

// read the sensor:

 sensorValueLeft = analogRead(LeftSensor);

 sensorValueRight = analogRead(RightSensor);

 

// apply the calibration to the sensor reading

 sensorValueLeft = map(sensorValueLeft, sensorMinLeft, sensorMaxLeft, 0, 255);

 sensorValueRight = map(sensorValueRight, sensorMinRight, sensorMaxRight, 0, 255);

 

// in case the sensor value is outside the range seen during calibration

//(Not sure how I feel about this. This portion came from the original code

 sensorValueLeft = constrain(sensorValueLeft, 0, 255);

 sensorValueRight = constrain(sensorValueRight, 0, 255);

 

// fade the LED using the calibrated value:

 analogWrite(LeftLED, sensorValueLeft);

 analogWrite(RightLED, sensorValueRight);

//Read values in COM

}


 

Most Current Light Seeker Code


//LED to indicate power

const int power = 13;

 

//Motors

const int RightMotor = 3;

const int LeftMotor = 5;

 

//Photo Sensors

const int RightSensor = A0;

const int LeftSensor = A1;

 

//Needed for Calibration of Photo Sensors

  // Left sensor:

  int sensorValueLeft = 0;       // the sensor value

  int sensorMinLeft = 1023;      // minimum sensor value

  int sensorMaxLeft = 0;         // maximum sensor value

 

  // Right sensor:

  int sensorValueRight = 0;       // the sensor value

  int sensorMinRight = 1023;      // minimum sensor value

  int sensorMaxRight = 0;         // maximum sensor value

 

 

// Variables for void loop

int SensorLeft;

int SensorRight;

int SensorDifference;

 

void setup()

{

 //Calibration of Photo Sensors

     // turn on LED to signal the start of the calibration period:

     pinMode(9, OUTPUT);

     digitalWrite(9, HIGH);

    

     // calibrate during the first five seconds

     while (millis() < 5000) {

     sensorValueLeft = analogRead(LeftSensor);

     sensorValueRight = analogRead(RightSensor);

   

    

     // record the maximum sensor value

     if (sensorValueLeft > sensorMaxLeft) {

      sensorMaxLeft = sensorValueLeft;

     }

    

      if (sensorValueRight > sensorMaxRight) {

      sensorMaxRight = sensorValueRight;

     }

    

     // record the minimum sensor value

     if (sensorValueLeft < sensorMinLeft) {

      sensorMinLeft = sensorValueLeft;

     }

      // record the minimum sensor value

     if (sensorValueRight < sensorMinRight) {

      sensorMinRight = sensorValueRight;

     }

     }

    

 

  // signal the end of the calibration period

   digitalWrite(9, LOW);

 

  //Set Motors as output

  pinMode(RightMotor,OUTPUT);

  pinMode(LeftMotor,OUTPUT);

 

  //Serial Connection

  Serial.begin(9600);

 

  //First Readings

  Serial.println("\nReading Light Sensors.");

 

  //Power LED

  digitalWrite(power, HIGH);

}

 

void loop()

{

 

// read the sensor:

 sensorValueLeft = analogRead(LeftSensor);

 sensorValueRight = analogRead(RightSensor);

 

//  Difference of Sensors

  SensorDifference = abs(sensorValueLeft-sensorValueRight);

 

  //Sensor Readings for debugging

      //Left Photo Sensor

      Serial.print("Left Sensor = ");   //Title

      Serial.print(sensorValueLeft);    //Value

      Serial.print("\t");               //This is for a tab space

 

      //Right Photo Sensor

      Serial.print("Right Sensor = ");   //Title

      Serial.print(sensorValueRight);    //Value

      Serial.print("\t");                //This is for a tab space

 

      //Difference

     

  //Motion of LightSeeker2000

  if (sensorValueLeft > sensorValueRight && SensorDifference > 120)

  {

    digitalWrite(RightMotor, HIGH);

    digitalWrite(LeftMotor, LOW);

    Serial.println("Left");

  }

  if (sensorValueRight > sensorValueLeft && SensorDifference > 120)

  {

    digitalWrite(RightMotor, LOW);

    digitalWrite(LeftMotor, HIGH);

    Serial.println("Right");

  }

  else if (SensorDifference < 120)

  {

    digitalWrite(RightMotor, HIGH);

    digitalWrite(LeftMotor, HIGH);

    Serial.println("Forward");

  }

  Serial.print("\n");

}

 










No comments:

Post a Comment