Robot not working.

My robot will not work while running "HelloRobot" or "myRobot". It does run with "MotorTest4wd". I can see the sensor outputs while running "myRobotDebug" on the serial monitor. Do you think I need to be looking at a shield problem or a software problem? Thanks, Rodger.
1 person has
this question
+1
Reply
  • Brian Jepson (Editor, Maker Media, Inc.) April 24, 2013 13:04
    Hi Rodger,

    Can you post as much information as you can? It would be helpful to see a photo of your wiring, and if you can use a multimeter to test the outputs of the motor shield (what voltage do you see when the motors are supposed to be turning?), that would be helpful.

    Regarding whether it is a software problem or a shield problem, I'd suggest that you have a look at the Adafruit documentation at http://www.ladyada.net/make/mshield/, and see if you can make it work (especially the steps in the Use It! section that run a DC motor).

    That would help you figure out whether it's a software or shield issue.

    Best,

    Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • I went to the web site you suggested and used the code from the "Use It" section and the motor ran. I was able to run each motor, individually, by changing the motor number.

    When "Hello Robot" is running there is no voltage (multimeter tested) at any of the motor terminals. I get the message "Waiting for sensor to detect blocked reflection" (serial monitor) but nothing happens when I block the reflection.

    I can see the sensors (serial monitor) running "myRobotDebug" and I see a difference in the readings when a sensor is blocked.

    The file RobotMotor.h is defined as 4WD.

    I tried some of the other sketches, "myRobotWander" and "myRobotLineDisplay", and the robot runs and seems to be responding to the sensors but will require some calibration.

    I'm not sure why the "HelloRobot" and "myRobot" won't work. Attached is a picture of the wiring.

    Rodger

  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Brian Jepson (Editor, Maker Media, Inc.) April 26, 2013 13:11
    Hi Rodger,

    I've asked the author to take a look, and he says it's most likely the sensor at this point. What can you tell me about the surface you are using, the distance between the sensor and the surface, and the object you're using to block the reflection?

    You mentioned that the sensors work fine with myRobotDebug, so you might want to try adjusting the thresholds in Hello Robot (irReflectThreshold/irEdgeThreshold) to see if that helps.

    Thanks,

    Brian
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • The tests seem to indicate that the sensors are functioning but the edge detection used in the hello sketch is not responding as expected.

    The detection thresholds are calibrated when the Arduino sketch is started so make sure the robot is on a reflective surface when powered up. For the initial test, place the robot on a fresh sheet of white printer paper. After powering up the robot and waiting 10 seconds or so (there is a delay of 8 seconds to give you time to start the serial monitor if you want to display serial output for debugging). Place a non-reflective object under one of the sensors, for example, a piece of black electrical tape stuck to a small card

    Did you try running the Processing sketch discussed in the ‘Debugging your Robot’ Appendix? This displays the real time values of the sensors. Figure C-1 show typical output from the sensors. As shown in that figure, the output from a sensor that is over a reflective area should be at least 5 times less than one over a non-reflective surface. Let me know the values you get from your sensor when one is detecting reflection and another is not.

    Knowing the calibration thresholds will be useful. Adding the following two lines to the end of the irSensorCalibrate function will print the thresholds to the serial monitor:
    Serial.print("Sensor "); Serial.print(sensor);
    Serial.print(" edge threshold is "); Serial.println(irSensorEdge[sensor]);

    Thanks,

    Michael
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Good news. The robot is working running the sketch "myRobot". I used recipe 5.6 from the "Arduino Cookbook" and modified it so I could use the serial monitor to test each sensor individually. I had to edit the "irEdgeThreshold", in irSensors, to a value of 40 before the right sensor was recognized. The left sensor was recognized at a value of 70.

    I had been using the "MyRobotDebug" sketch and I could see the sensors, in real time, but I was having problems with the "my Robot" sketch recognizing them.

    The surface I am using is the white plexiglass surface of my work table and the sensors are a 1/2" from the surface blocking them with a thin piece of dark green plastic.

    Thank you for all your help.

    The best to both of you,
    Rodger
    .
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. indifferent, undecided, unconcerned happy, confident, thankful, excited kidding, amused, unsure, silly sad, anxious, confused, frustrated

  • Hi Rodger, great to hear you have it working.

    You may get better performance if you can reduce the gap between sensors and the surface, try 3/8" inch or less.

    Have fun!

    Michael
  • (some HTML allowed)
    How does this make you feel?
    Add Image
    I'm

    e.g. kidding, amused, unsure, silly happy, confident, thankful, excited indifferent, undecided, unconcerned sad, anxious, confused, frustrated