Page 2 of 2

Re: Lego Mindstorms NXT working on solar energy

Posted: 24 Dec 2010, 12:43
by wildman09
I have tested it, and it works quite well.

Only some problems:

-The accuracy (the angle) isn't perfect yet. He drives in to the direction of the light source, but it has a deviation.

-If the light source is between two light sensors (between for example Nord and East), he isn't able to detect that/not accurate, or make strange movements.

-If I turn off the light source, he makes strange movements. He isn't able to detect the brightest place in the room (with no additional Light sources, only sunlight).
You need a big difference in light intensity, so that the robot detect it and drive too it. With a small difference in light intensity, the robot does not work that well.

Wildman

Re: Lego Mindstorms NXT working on solar energy

Posted: 26 Dec 2010, 09:46
by loopymech
Cool project and nice work!

Here's an idea that might help with the deviation problem: use some simple subtraction and the steering hub to guide the robot to the brightest area. The difference between two light sensor readings gives you a value that can be used to steer in the right direction and proper amount of turn. When both sensor readings are the same, the robot goes straight (presumably centered on the brightest light source).

I've attached two programs written in NXT-G that help the bot seek the brightest light sources; one uses two light sensors and the other gets similar results using one light sensor and a motor to rotate it from side to side. They are both based on the basic tribot platform seen here: http://www.nxtprograms.com/explorer/index.html In fact, the "wobbler" design, using the light sensor, was an extension of the Explorer design and worked very well for me.

Note that in the "2LSLS" design, the light sensors are mounted forward, facing about 45 deg off center in each direction.

Cheers and good luck with your project.

-Loopy

Re: Lego Mindstorms NXT working on solar energy

Posted: 26 Dec 2010, 12:26
by wildman09
Thanks for your reply.

I'm using 4 light sensors (Lego), in a angle of 90 degrees. Will you program work as well with 4 light sensors as with 2?

Thanks,
Wildman

Re: Lego Mindstorms NXT working on solar energy

Posted: 26 Dec 2010, 17:35
by loopymech
wildman09 wrote:
I'm using 4 light sensors (Lego), in a angle of 90 degrees. Will you program work as well with 4 light sensors as with 2?
My program as it is won't use 4 light sensors, but in concept, it could be adapted to do so. Perhaps you could start by adding the values of the front two sensors and comparing to the sum of the values of the back two sensors. If the sum is greater for the back two, do a 180 deg turn and then use a routine as in 2LSLS using just the front two sensors to zero-in on the target. If the sum is greater for the front two sensors, do the same, but skip the 180 deg turn.

I only have two light sensors, so I can't really test a design that uses more. It will be fun to see your final results, so please keep us posted with the code you come up with (and video if possible).

-Loopy

Re: Lego Mindstorms NXT working on solar energy

Posted: 28 Dec 2010, 16:13
by wildman09
I'm trying to improve the driving angle, so I started with some adding values etc.
The software program is in the attachment.

But it doesn't work any more. Only light sensor 1 (south) does react on a flash light (light sensor 1 is blinking, I don't know why).
All the other light sensors (2/3/4 > East/North/West) doesn't react on the flash light.
The robot is just driving straight on now.

Anyone can help me ? I think I made a stupid fault somewhere.

Thanks,
Wildman

Edit: Re-uploaded the file, some lines where gone.

Re: Lego Mindstorms NXT working on solar energy

Posted: 30 Dec 2010, 15:04
by wildman09
Tried to fix it, but no solutions so far.

Wildman

Edit:
Made some adjustments, but now all the light sensors (4) are blinking and he reacts now on the flash light.
But he doesn't follow it now, he makes strange movements.

See attachment for the software.

I don't think this approach works. Or does anyone knows a solution/see a error?