Arduino Robot won't follow line

I just bought the Arduino Robot for my son, and he's working through the included examples. We can't get the line following example to work at all. We are using black electrical tape on white poster paper, so the line is as dark as it can be and the contrast is good, so that's not the problem. The sensor array is seeing the line properly and correctly distinguishing between black and white, and the LEDs are lighting correctly as I manually move the bot over the paper crossing the line, so the sensors sem fine. But even though the sensors seem to be working properly, the included sample app isn't. It starts, plays the music, instructs to press the middle button, and then the screen says "Done". Most of the time it doesn't even wiggle to calibrate, it just says "Done" and shows a duration of 30-40ms. Occasionally it does try to calibrate, then makes a few rotations on the spot, and then says "Done". Has anyone gotten this example to work properly?

--- Ben

Have you got any serial debug output?

(Sorry, but I don't have the robot, and you didn't post any code)

The code is the sample that comes with the Arduino Robot, used as is:

/* Robot Line Follow

 This sketch demonstrates the line following capabilities
 of the Arduino Robot. On the floor, place some black 
 electrical tape along the path you wish the robot to follow.
 To indicate a stopping point, place another piece of tape
 perpendicular to the path.

 Circuit:
 * Arduino Robot
 
 created 1 May 2013
 by X. Yang
 modified 12 May 2013
 by D. Cuartielles
 
 This example is in the public domain
 */

#include <ArduinoRobot.h> // include the robot library

long timerOrigin; // used for counting elapsed time

void setup() {
  // initialize the Robot, SD card, display, and speaker 
  Robot.begin();
  Robot.beginTFT();
  Robot.beginSD();
  Robot.beginSpeaker();

  // show the logots on the TFT screen
  Robot.displayLogos();
  
  Robot.drawBMP("lf.bmp", 0, 0); // display background image

  Robot.playFile("chase.sqm");  // play a song from the SD card
  
  // add the instructions
  Robot.text("Line Following\n\n place the robot on\n the track and \n see it run", 5, 5);
  Robot.text("Press the middle\n button to start...", 5, 61);
  Robot.waitContinue();

  // These are some general values that work for line following 
  // uncomment one or the other to see the different behaviors of the robot
  // Robot.lineFollowConfig(11, 5, 50, 10);
  Robot.lineFollowConfig(14, 9, 50, 10);
  
  //set the motor board into line-follow mode
  Robot.setMode(MODE_LINE_FOLLOW);  
  
  // start
  Robot.fill(255, 255, 255);
  Robot.stroke(255, 255, 255);
  Robot.rect(0, 0, 128, 80); // erase the previous text
  Robot.stroke(0, 0, 0);
  Robot.text("Start", 5, 5);
  
  Robot.stroke(0, 0, 0); // choose color for the text
  Robot.text("Time passed:", 5, 21); // write some text to the screen
  
  timerOrigin=millis(); // keep track of the elapsed time
  
  while(!Robot.isActionDone()) {  //wait for the finish signal
    Robot.debugPrint(millis()-timerOrigin, 5, 29);  // show how much time has passed
  }
  
  Robot.stroke(0, 0, 0);  
  Robot.text("Done!", 5, 45);
}
void loop() {
  //nothing here, the program only runs once. Reset the robot 
  //to do it again!
}

It has no debug output, status is displayed on the robot TFT.

--- Ben

I just got an Arduino Robot and see the same issue with following the line. Right now, after I reset the robot, it wig-wags as noted, but stops as soon as it finds the line?? I have also been playing with the lineFollowConfig function to see if I can make headway in getting mine to follow the line. If I get anywhere with it I will update this post with what I did to make it work.

I did do the wheel calibration as the wheels were turning at different speeds.
I find that if I reset the motor control board as well as the robot control board, it will try recalibrating again.

I also had the wheels not gripping very well, and am still working on it.
So far, I have seen that the motors in their brackets have a lot of play when I wiggle them, so I have pushed a thick piece of paper between the motor and motor mount to stabilize. The wheels still slip but not as much.
I think the issue now is that ball bearing mounts, they may need to be shaved down a little to lower the body and place more weight on the wheels.

I am a little disappointed with this issue of Arduino hardware. The overall quality/functionality doesn't compare with the other hardware I have from Arduino (several UnoR3, Due, and shields). I've literally spent days (like other folks) wrestling with the serial communication on the Robot...I think I'm over that now (I hope).

Those are ALL symptoms I am seeing, too. I have calibrated wheels many times, but after a while it starts veering to the side.

And agreed, this device is not up to the quality I expect from Arduino, and it definitely appears to have been shipped before it was fully baked.

:frowning:

--- Ben

Anyone get this line follow to work yet ??
I'm having same issues as all of you....
Thing that confuses me is that I have seen a YouTube video of this line follow working really well....that's why I bought it !!

Awkward question, but does it require starting the robot on the line? Have you tried that?

I don't have the robot, so this was just a guess.

That code is built around the ArduinoRobot.h library. Is that library downloaded, properly installed, and available? And of the right version?

Yes started it on the line ....

There seems to be 2 versions of the sketch available with only difference being one has 2 extra imports that don't seem to be needed as if I comment out it compiles ok, runs and just does what I said previously

I have the library and I think it's ok, I'm presuming if it wasn't it would give compile errors ?? I'm new at this so if there is another way to check let me know please

Thanks for your help
Karl

Have you guys solved it yet? I have the same problem here even with stock settings. Sometimes it just stops after calibrating the IRs. Not even a wiggle.

Tried the beta IDE. Things are much smoother now.

Hi everyone,

I used to have the same problem, but now it fixed.
Try to change your port to "cu.usbmordem****", not the "tty.usbmordem".
Hope this will help.

My robot will not work with either line following programs. I decided to combine elements of the motor test example and the IR array example, and found that when I sent a command to the motor set, the IR data stopped coming back. When I now loaded
the IRarray example it reported all zeroes. When I pressed the reset button on the lower board, the IR data resumed correct operation. The IR response LED's continued to work properly all during this time. Maybe someone can take this info further.

Perhaps there is a conflict between the library you're using to control the IR and the library you're using to control the motor - for example trying to use the same pins or the same hardware timers.

I had compile the example line following programs using IDE 1.5.6-r2, these was the message shown

Sketch uses 28,616 bytes (99%) of program storage space. Maximum is 28,672 bytes.
Global variables use 2,092 bytes (81%) of dynamic memory, leaving 468 bytes for local variables. Maximum is 2,560 bytes.
Low memory available, stability problems may occur

Regarding library conflict: I am using the library supplied with the Arduino Robot for accessing the IR sensors and for driving the motor. I assume this is related to the fact that nobody seems to be able to get the published line following software to work.

I just faced the same problem and I assume it is because communication between sensors and motors. So I removed LCD screen and it worked. I don't details about it but just to try line follow function, you can remove screen and test the code.

Hope it helps.

Anyone get this line follow to work yet ??
I'm having same issues as all of you....

Watched a youtube video so was sold. Bought Arduino Robot, charged the batteries, created a track exactly as instructed, loaded line follow sketch without any modifications to the code.

Started Robot, placed on track, waited for chase music to start, clicked middle button, it wiggled then stopped, reporting done on TFT.

Then fiddled for 2 days changing config KP KD, etc. Still no result, followed forums and suggestions, with still no luck.

Is it faulty, do I send it back ?

5 sensors work, other sketches work perfectly, including motor calibration ...

Achieved some progress? I am also going through the same problem. I'm going to my second day with the KP KD.