Registered Users          New User?
Picture of Erik Gutierrez
Down Sensors inconsistencies- XIP Robot
by Erik Gutierrez - Sunday, December 20, 2009, 11:49 PM
Down sensors had no issues when detecting edge of table tests. But I'm know experiencing inconsistencies with down sensors when trying to detect white ring on sumo rink. On the same test/run, you can see the led's turn off when the sensors detect the white ring but the robot responds differently all the time, e.g. 1)sometimes there's a delay (goes about 3 inches off rink), and then it'll execute instructions, 2) will not execute constructions or 3) executes instructions as expected. I have tried MANY settings on the sensitivity control and with/without initialization of respective digital ports with no success.

OtHer info: currently happening on only two robots. The other three robots as working as expected as of this past Wednesday.

Please help. Thanks.

Sensors QRB114
----------------------------------------------------------------------
#include <machinescience.h>
#include <mastermod.h>

int main(void)
{
servo_control(ENABLE); //Initialize servo motor control
digital_port(5, INPUT); //Initialize digital port input #5
//digital_port(0, INPUT); //Initialize digital port input #0
//digital_port(1, INPUT); //Initialize digital port input #1

while(1==1) //Execute the following code repeatedly
{
delay_ms(2000);

if (digital_read(0)==HIGH) //If left down sensor detects white rim on SUMO rink
{
//Move the robot in reverse for 1.5 seconds and spin
servo_robot(REVERSE, 50);
delay_ms(1500);
servo_robot(SPIN_RIGHT, 30);
delay_ms(250);
}
else if (digital_read(1)==HIGH) //If right down sensor detects white rim on SUMO rink
{
//Move the robot in reverse for 1.5 second and turn
servo_robot(REVERSE, 50);
delay_ms(1500);
servo_robot(SPIN_LEFT, 40);
delay_ms(350);
}
// else if (digital_read(5)==HIGH) //If front sensor detects an object
//{
//servo_robot(FORWARD, 100); //Make robot move at full speed
//}
else
{
servo_robot(FORWARD, 40); //Move forward at normal speed
}

}
end(); //End program
}


Picture of group3 SHPE
Re: Down Sensors inconsistencies- XIP Robot
by group3 SHPE - Monday, December 21, 2009, 06:43 PM
Disregard, we figured out the issue, somewhat accidentally. One of the students complained about a delay at the beginning so we went back to the code and realized a delay statement was a delay (delay_ms(2000);). Once we removed it, his robot worked as commanded. That's when we realized, the delay statement at the beginning of the code was delaying everything. DOH!