Page 1 of 1

how do i ...?

Posted: 07 Jun 2011, 12:28
by monster53
hi folks,

i'm very new to lego nxt and i'm trying to make a little windmill project.

what i'd like to do is control the direction my windmill is facing. obviously i'd like to get it to face into the wind. and so i'm thinking about a compass sensor for determining direction, but i don't know how to connect the output of the compass sensor to the input on the motor control.

and that's my question i guess, how to i control a motor based on a compass sensor, so my windmill can stay focused on the wind?

thanks for the help
v

Re: how do i ...?

Posted: 07 Jun 2011, 12:53
by webstorms
monster53 wrote:hi folks,

i'm very new to lego nxt and i'm trying to make a little windmill project.

what i'd like to do is control the direction my windmill is facing. obviously i'd like to get it to face into the wind. and so i'm thinking about a compass sensor for determining direction, but i don't know how to connect the output of the compass sensor to the input on the motor control.

and that's my question i guess, how to i control a motor based on a compass sensor, so my windmill can stay focused on the wind?

thanks for the help
v
Helllo monster53,

I don't think you will be able to "find" the wind with compass sensor. I guess you should use a rotation sensor or a modified sound sensor. If you want the motor to face in one compass heading, you just tell the motor to run forward/backwards until the compass value is in between the wanted range. Then you tell the motor stop.

Hope this helps you.

Re: how do i ...?

Posted: 07 Jun 2011, 14:27
by pbenco
Hello

The easiest way to perform a wind direction following windmill is to put a sort of tail, as a Weather vane, like in this design
Image
Regards
Ben

Re: how do i ...?

Posted: 13 Jun 2011, 15:08
by monster53
hey guys,

thanks for the replies. yes !! i get that i can't find the wind from a compass sensor. what i wanted to do is attach a tail, just like pbenco suggested.

webstorms,
i get the idea. but wouldn't tell the nxt to go back and forth, even over a small range, cause it to stutter? the vibrants could be destructive for my little windmill.

my idea scenario is this:
1. a compass sensor mounted on top of a motor control (used as a rotation sensor)
2. a windmill mounted on top of a motor control

and the output (in degress) of the motor control in 1) is used to control the rotation of the motor in 2)

thanks again for all the help

monster

Re: how do i ...?

Posted: 13 Jun 2011, 17:02
by hassenplug
Generally, to do this type of thing, you HAVE the distance you want the motor to turn. That would be the difference between your two rotation values. Right?

You could feed that number into the motor distance block. But, yes that does seem to cause oscillation. Usually, I feed that number into the motor POWER. So, when it's far away, it uses a lot of power. And, when it's close, it sets the power low.

Steve

Re: how do i ...?

Posted: 15 Jun 2011, 14:57
by monster53
wow, feed it into the power. that's a brilliant idea. i'll test that tonight. do you suppose it will work if the number is negative? well i'll find out :)

thanks steve

monster

Re: how do i ...?

Posted: 16 Jun 2011, 08:16
by timpattinson
If the power is negative the motor will go the other way