Coach needs some help...
I'm not that experienced on RoboLab - I received the following request from Jim C. and am hoping some of our readers might be able to offer some suggestions:
"I am teaching a group of students immgrating from the RCX to NXT. We have been working on buidling a line follower using the NXT set.
We have decided to use the robolab 2.9 program to work on this project as they are more familiar with robolab software.
Would appreciate it if you could help to point us in the right direction with regards to the following:
1) How do I calibrate the NXT light sensors? I understand that the NXT-G software has a calibration function but not the robolab 2.9 software. There is no calibration file in the NXT brick as well so we can't use that.
2) Can 2 NXT light sensors be used to build a line follower robot? How different would the program be via-a vis using a single light sensor?
Thanks for the help."
"I am teaching a group of students immgrating from the RCX to NXT. We have been working on buidling a line follower using the NXT set.
We have decided to use the robolab 2.9 program to work on this project as they are more familiar with robolab software.
Would appreciate it if you could help to point us in the right direction with regards to the following:
1) How do I calibrate the NXT light sensors? I understand that the NXT-G software has a calibration function but not the robolab 2.9 software. There is no calibration file in the NXT brick as well so we can't use that.
2) Can 2 NXT light sensors be used to build a line follower robot? How different would the program be via-a vis using a single light sensor?
Thanks for the help."
Comments
Why do you need to? The light sensor returns a value: all the NXT-G calibration does is select two numbers to scale that value between, so that the sensor returns 0 to 100 over a certain specified (calibrated) range of the raw return from the sensor. You could certainly do this under Robolab 2.9, it's just not built in. short version: the light sensor works JUST FINE without any special calibration.
> Can 2 NXT light sensors be used to
> build a line follower robot?
Certainly. And yes, the possibilities of using two light sensors are significantly different than with just one. How do you follow a line with one light sensor? Can you (or better yet, your students) think of a way to use two light sensors? A way similar to the one light sensor solution? How about completely novel ways?
Yes, I could stop being cryptic and just "give you an answer" here, but this is a fantastic chance to get the students to teach themselves. I'd encorage you to treat it that way.
--
Brian Davis
But then wouldn't the value need to be hardcoded thus making it operate incorrectly under different conditions?
This book is like the bible for RoboLAB
Not at all. The first thing the program could do is "request" the user to hold it over a white area and a black area, and use those to compute what the "correct" raw limits are, and use those in the program. Don't like that? Then write a seperate program that does this "calibration", and write those values to a file... which your line following program can read and use later. This, after all, is all the light sensor calibration really is - an auotmation of a technique that's been used by a lot of folks for a long time.
As to the book, does it cover Robolab 2.9 on the NXT?
--
Brian Davis
Engineering with LEGO bricks
and Robolab (3rd Edition)
http://www.collegehousebooks.com/lego_bricks_3.htm
LEGO NXT-G for ROBOLAB Users
http://www.collegehousebooks.com/Lego%20Migration%20Guide.htm
Physics by Design (2nd Edition)
ROBOLAB Activities for the NXT and RCX
http://www.collegehousebooks.com/physics_2.htm
for the light sensors, the best way to use a single light sensor in my opinion (easiest, plus helps build simple math logic) is by using 3 values, 1. the value of the black line (middle of it) 2. the medium value of the edge of the line 3. the value of the white area.
so its a matter of light sensor hits white (assuming you start on the left side of the line) u turned to far left, so keep turning right untill you get to the medium value.
if you hit the low/dark value, then you turned to far right, move left.
play around with this, make it go forward or just keep bouncing back and forth between two values (slow but very accurate)
TWO light sensors: so much more fun and so much easier. a tank bot would work best (for turning).
simply "sandwich" the line by putting two light sensors at least a centimeter from the edges of the line. you can either have each light sensor control one side of the bot (simple program, i think the brick was called task split or something split) or make a more complicated program.
two light sensors would work extremly better, and iv been able to test it on complicated courses with sharp turns and gaps, easier to program, more fun too.
single light sensor works just fine one the circular track provided by lego.
and if you get the light values perfectly, u can do complicated tracks. the only problem with that is depending where the robo is facing, the light values will be different (angle, shadow, people blocking light, etc) so it becomes much harder to use 3 different values.
sorry if none of this made sense, no sleep can kill ya after a time.
I have written a program that is marginally working but am having trouble with light shadows and inconsistent response. The robot moves foward 2 seconds and reads each each light sensor . If left sensor reads black then robot turns left until it sees white. If right sensor reads back then it turns right until it sees white. Then it repeats the process. does anyone have any hints?