Shop OBEX P1 Docs P2 Docs Learn Events
Regarding linefollower using linescan camera — Parallax Forums

Regarding linefollower using linescan camera

Klambert05Klambert05 Posts: 3
edited 2010-05-07 00:16 in Robotics
I have used everything like in the red eye line follower that is located within this forum but I am having a problem with right angle turns, if there is·a known solution to this please help me out, because I can't figure it out on my own.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-05-06 19:43
    If it's an abrupt right-angle turn, and if you're sampling the linescan sensor often enough, there will be a point at which the width of the line suddenly increases to the right or to the left. You can use this a a cue for making a turn in the proper direction. If you can't sample the sensor fast enough with your current line, you can either use a heavier line, or else just bulk it up at the corners so you won't miss the cue to turn.

    -Phil
  • Klambert05Klambert05 Posts: 3
    edited 2010-05-06 19:57
    So this is what i am thinking, could i get some input on it?

    whenever my line reads a certain size, take the average, and if it is to the left, then send to a subroutine and make a 90 degree left turn, and if the average is to the right do the same, but to the right.

    will this work? or am i missing something.· And if this does work, how do you tell a servopal to do just a 90 degree turn.· I have been playing with the prgram but cant figure that out.
  • Klambert05Klambert05 Posts: 3
    edited 2010-05-06 20:27
    okay, i've got the right turns down, thanks a lot phil, that helps. But now I have another issue. My line that I am following is 1 inch wide. now I get to a certain point where the line becomes 3 inches thick and i want it to hit that and pull a 180 (preferably making the servopal send one motor forward and one motor backward) until it gets back on the line it just came from and continue back into the line following program, is there a way to do this?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-05-07 00:16
    You can check to see if the width suddenly increases in both directions, instead of just one. That will indicate a "T" junction, which you can use as a cue to turn around.

    -Phil
Sign In or Register to comment.