Shop OBEX P1 Docs P2 Docs Learn Events
Scribbler S2 IR Detection — Parallax Forums

Scribbler S2 IR Detection

LucasTLucasT Posts: 3
edited 2014-02-14 14:42 in Robotics
I'm currently working on a project with the Scribbler S2 robot. I need to use an unmodified S2 robot to do some various things with obstacles.

Currently, I am looking at detecting distance with the built in IR sensors. I looked over the s2.spin file and used the obstacle method to get some readings, but I was wondering if it was possible to get more accurate readings.

While doing some research, I stumbled across this thread: http://forums.parallax.com/showthread.php/93328-IR-detect

In the thread it refers to using duty cycle sweeping. After reviewing the Propeller manual, I see how to possibly make the changes to enable this, but I'm not quite sure what it does or if it would actually work with the S2 robot.

I'm mostly a software developer, but I do have some basic hardware understanding. I was hoping someone might have some useful links or insights into whether this is possible before I wasted my time on it.

Also, I think I have most of the basic links and information for the S2 such as the Propeller manual, the quick reference document, the default S2 spin files, and all the other documents linked from the S2 section of the Parallax site. Are there any other useful S2 resources that I should know about?

Thanks for reading.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-02-14 12:21
    LucasT wrote: »
    I'm currently working on a project with the Scribbler S2 robot. I need to use an unmodified S2 robot to do some various things with obstacles.

    Currently, I am looking at detecting distance with the built in IR sensors. I looked over the s2.spin file and used the obstacle method to get some readings, but I was wondering if it was possible to get more accurate readings.

    There are a lot of limitations with uses the type of sensors in the S2 for distance sensing. There was a recent thread on this topic. I'll try to find the link and post the link to this thread.
    LucasT wrote: »
    While doing some research, I stumbled across this thread: http://forums.parallax.com/showthread.php/93328-IR-detect

    In the thread it refers to using duty cycle sweeping. After reviewing the Propeller manual, I see how to possibly make the changes to enable this, but I'm not quite sure what it does or if it would actually work with the S2 robot.

    I think duty cycle sweeping would work with the S2 but Phil Pilgrim who wrote the software for the S2 thought changing modulation frequency worked better for distance sensing than duty cycle sweep. At least this is the way I remember it.
    LucasT wrote: »
    I'm mostly a software developer, but I do have some basic hardware understanding. I was hoping someone might have some useful links or insights into whether this is possible before I wasted my time on it.

    Duty cycle sweeping should be possible. Accurately measuring distances with it, not so much.
    LucasT wrote: »
    Also, I think I have most of the basic links and information for the S2 such as the Propeller manual, the quick reference document, the default S2 spin files, and all the other documents linked from the S2 section of the Parallax site. Are there any other useful S2 resources that I should know about?

    I've listed some S2 links in post #12 of my index.

    I added an ultrasound (US) sensor to my S2 and I was very pleased at how the US and IR sensors complimented each other.

    I'll find that link to the IR limitations discussion and post it here soon.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-02-14 12:25
    Here's the recent thread about the limitations of IR distance sensing.

    Posts #3 and #5 explain the limitations.
  • LucasTLucasT Posts: 3
    edited 2014-02-14 13:56
    Thanks for the response and the links. I will look through them.

    While I was waiting, I decided to play around with the default setup of the S2 IR sensors. I have two S2s. I use one to send IR and one to receive IR. I noticed that if an object temporarily moves in front of it, the number of True IR hits will go up.

    For example, I have the receiver bot printing out to the serial debug every time it receives a True value. If I wave my hand in front of it for a second, the amount of printed True values spikes upward for several seconds before settling back down.

    I'm not quite sure what is causing this. Does anyone have any suggestions?
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-02-14 14:26
    LucasT wrote: »
    Thanks for the response and the links. I will look through them.

    While I was waiting, I decided to play around with the default setup of the S2 IR sensors. I have two S2s. I use one to send IR and one to receive IR. I noticed that if an object temporarily moves in front of it, the number of True IR hits will go up.

    For example, I have the receiver bot printing out to the serial debug every time it receives a True value. If I wave my hand in front of it for a second, the amount of printed True values spikes upward for several seconds before settling back down.

    I'm not quite sure what is causing this. Does anyone have any suggestions?

    I'm not sure what your question is. It seems like one would expect the "true" hits would increase with an object in front of the S2.

    I'm not sure what you're trying to do with the two S2 configuration. Since the S2 changes the output to the IR LEDs as it monitors the input from the receiver, I'd think a second S2 in the vicinity would just confuse the readings.

    Have you tried the "Monitor the Scribbler's sensors" feature in the GUI? Its icon is just to the left of the large question mark (help) icon. It will show you when the S2's sensor detects something within its set threshold.

    I noticed one can change the threshold of what triggers an object being detected but I haven't figured out how to access the raw sensor reading from the IR sensors. I'm not sure if the IR detection software would have to be significantly changed in order to retrieve the raw value or not.
  • LucasTLucasT Posts: 3
    edited 2014-02-14 14:42
    I'm working on a research project for my University. They want to use these bots to test Artificial Intelligence projects, but they need to solve some simple problems before they can make use of them.

    My project right now is to get two S2 robots to line up head to head in front of each other in an automated fashion using their IR sensors. My intention was to use a signal strength to possibly get them to line up, but after experimenting with the sensors, I'm not sure that is a viable option. They need to be able to align in the presence of obstacles, and I haven't been able to get a steady signal strength without obstacles.

    To test things, I had one robot receive signals, and the other send. I noticed while debugging that the receiver robot received a majority of false with a few true scattered throughout the results, so I decided I would possibly take many samples and count the true results to get a representation of how close to facing the robots are.

    While I was debugging this, I noticed that waving my hand in front of the sensor increased the number of true hits, which is to be expected, but the number of true hits continued for many seconds after I removed my hand. I know there would have been a delay from the debug information, but the spike seemed to last longer than it should have.

    I've just started on this project, so I'm not very familiar with how these robots work yet. I thought perhaps there might be another factor I was missing. Perhaps I was just mistaken on the delay to the debug. I will try something different tomorrow.

    I will have a look at the GUI sensor monitor. I didn't figure the GUI had much application to what I was doing, so I skipped straight to the Spin code and debug terminal. Thanks for the suggestion.
Sign In or Register to comment.