Shop OBEX P1 Docs P2 Docs Learn Events
Infared troubles — Parallax Forums

Infared troubles

landonmay13landonmay13 Posts: 10
edited 2015-01-26 08:01 in Accessories
I am trying to have my Activitybot do a simple u-turn using infrared roaming. After my fifth try, I turn my robot on and the left wheel is going backwards. I looked at the code and checked the wires to see if it was in the way, but everything seems fine. Why is it doing this and how do I fix it?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-12-22 11:58
    There really isn't enough information to be able to provide an answer. Assuming the ActivityBot works normally when running the IR roaming code then it is most likely a code issue. I would verify the operation using known good code and then if that works post the modifications you have made to see if there is a logical error there.
  • landonmay13landonmay13 Posts: 10
    edited 2014-12-22 15:21
    All right, here is a little more information:

    1. I was using the code that went with SimpleIDE
    2. This did start going weird in the middle of the test, I turned it off and back on and the wheel was going backwards.
    3. It worked perfectly before the 5th try.
    4.I am using the reset button then turning all the way off, editing the maze for a few seconds, and turning it back on
    5.I did not make any modifications from the code
    6.I tried putting in a blank code and then the IR Roaming code, but still wouldn't work.
    7.On the 4th try, the robot rammed into a wall
    8.I waited overnight
    9.I turned it off and back on again.

    Does this help at all?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2014-12-22 17:04
    It sounds like you may have corrupted the calibration data. I would re-run the wheel calibration code.
  • landonmay13landonmay13 Posts: 10
    edited 2015-01-04 16:07
    All right, I have re-run the code and it still has not worked. The right wheel worked normally, while the other wheel did not stop moving counter-clockwise. The lights stayed on the entire time.

    Can I fix this without buying anything?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2015-01-05 08:11
    Well, based on your original post I made the assumption the robot worked four times and then did not on the fifth try. Is this accurate? Can you post a photo of the connections on the robot?
  • Courtney JacobsCourtney Jacobs Posts: 903
    edited 2015-01-05 09:59
    Also, posting the calibration tables would assist in diagnosing any common issues related to calibration and robot setup/connections.
  • landonmay13landonmay13 Posts: 10
    edited 2015-01-11 15:10
    All right, here are some pictures.

    https://www.dropbox.com/sh/xcj5snqzvjss6r9/AADypYlxXNAS3eqXV7OPyOGAa?dl=0

    Tell me if you need more accurate pictures or if I need to photoshop the pictures to explain more.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2015-01-12 09:26
    From the photo I can see that the 220 ohm resistor from P2 is connected directly to ground (middle pin of detector), but should be connected to pin 1 of the detector. That will cause your right IR not to work.
  • landonmay13landonmay13 Posts: 10
    edited 2015-01-19 15:51
    I did what you said to do, and it worked! Thanks, man.
  • ercoerco Posts: 20,257
    edited 2015-01-21 22:02
    @landonmay13: Glad to hear Chris got you up & running. Smart fellow that Chris.

    @Parallax:

    IMO this is a carryover issue from BoeBot which could benefit from some attention. I was never a huge fan of those two IR LEDs hanging out in the breeze for proximity sensors. Proper alignment & aiming with the IR receivers is pretty important, yet the IR LEDs are constantly tweaked, either by a collision or just pickup up the robot. It would be a major improvement (and not too difficult) to mount the IR LED and receiver together on a small board to keep them aligned. One 4-pin header would make all the connections and might have prevented the problem in this thread. It would also add a sleeker look. A good Matt_G project. :) An upgrade path for ActivityBots and Boebots.

    An alternative is to simply use an existing sensor such as http://www.ebay.com/itm/IR-Infrared-Sensor-Switch-Module-for-Arduino-/331446227653 which has an onboard 555 oscillator, pots for adjusting sensitivity, and a red "sense" LED for feedback.

    Next, we can talk about laser sensors. :)
  • Steph LindsaySteph Lindsay Posts: 767
    edited 2015-01-22 12:11
    erco wrote: »
    @landonmay13: Glad to hear Chris got you up & running. Smart fellow that Chris.

    @Parallax:

    IMO this is a carryover issue from BoeBot which could benefit from some attention. I was never a huge fan of those two IR LEDs hanging out in the breeze for proximity sensors. Proper alignment & aiming with the IR receivers is pretty important, yet the IR LEDs are constantly tweaked, either by a collision or just pickup up the robot. It would be a major improvement (and not too difficult) to mount the IR LED and receiver together on a small board to keep them aligned. One 4-pin header would make all the connections and might have prevented the problem in this thread. It would also add a sleeker look. A good Matt_G project. :) An upgrade path for ActivityBots and Boebots.

    An alternative is to simply use an existing sensor such as http://www.ebay.com/itm/IR-Infrared-Sensor-Switch-Module-for-Arduino-/331446227653 which has an onboard 555 oscillator, pots for adjusting sensitivity, and a red "sense" LED for feedback.

    Next, we can talk about laser sensors. :)

    It is a good idea Erco, and one we have thought of before. However, including such a sensor in the kit it would be at cross-purposes with some of the educational goals of the product. The sensors in the Boe-Bot, Shield-Bot, and ActivityBot are of the DIY/home brew variety on purpose, to give people hands-on experience of building the circuits and understanding the components --- a hallmark of our educational program. Mistakes, caveats, and adjustments are part of the learning process. If we make it too foolproof and ready-made, that experience and inherent understanding of what is actually happening is rarely gained.

    Also, having the components not in a fixed position allows for different kinds of activities --- one configuration works well for following hands or a lead robot, another for object avoidance, and yet another for edge detection. Using a single receiver elsewhere in the board allows for IR remote control, with whiskers mounting in the front instead. Sometimes it is necessary to change resistor values to get the best results in different environments. Having to adjust a system to in response to a number of environmental factors and applications is also part of the learning goals for a future engineer.

    There are ready-made sensors like the one you mention above, in addition to the PING ultrasonic distance sensor, that can be used in place of the DIY component system in a situation where the end functionality is the goal rather than the learning process. Being able to upgrade and expand with other sensors and accessories after learning the basics is another goal of the robot' design.
  • ercoerco Posts: 20,257
    edited 2015-01-22 12:44
    Excellent points all. In this instance, what's good for hands-on experience and education is counter to long-term reliability. I still feel that some way of keeping things aligned would be a nice option for people looking to use these bots for contests or longer term goals. An intermediate solution would be to create a simple bracket (molded or 3D printed) of black/IR proof plastic which would hold an IR LED and receiver module in a properly aligned configuration. The pins could still plug directly into a breadboard to hover in place as-is, or the bracket could have a screw hole and be mounted more permanently on the robot, connected by a short cable.

    Posting a downloadable file for users to 3D print such a bracket would be a win-win for all.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2015-01-23 10:08
    erco,

    In my experience there is no set alignment when it comes to the IR sensors. They often have to be moved around to find that perfect point where they respond well to the test program. This can also change if you add the PING))) Mounting Bracket, which then gets in the way of the IR sensors pointing straight forward. Given the option, I personally would prefer to adjust and move them myself. But I am sure there are some who would prefer the "IR Shield". =)
  • ercoerco Posts: 20,257
    edited 2015-01-24 07:32
    There's no disputing that the LED and receiver need to be aligned parallel, which is the whole purpose of the bracket I'm suggesting. The assembly can of course be aimed and relocated in several locations. I'll make some.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2015-01-26 08:01
    There you go erco! Fill a need! Offer them on eBay! =)
Sign In or Register to comment.