how do i ...?

Discussion specific to NXT-G, NXC, NBC, RobotC, Lejos, and more.
Post Reply
monster53
Posts: 3
Joined: 18 May 2011, 12:45

how do i ...?

Post 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
webstorms
Posts: 38
Joined: 10 Mar 2011, 15:27

Re: how do i ...?

Post 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.
pbenco
Posts: 71
Joined: 29 Sep 2010, 09:43
Contact:

Re: how do i ...?

Post 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
pbenco.wordpress.com/
monster53
Posts: 3
Joined: 18 May 2011, 12:45

Re: how do i ...?

Post 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
hassenplug
Posts: 346
Joined: 27 Sep 2010, 03:05
Contact:

Re: how do i ...?

Post 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
---> Link to lots of MINDSTORMS stuff under my picture --->
monster53
Posts: 3
Joined: 18 May 2011, 12:45

Re: how do i ...?

Post 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
timpattinson
Posts: 224
Joined: 30 Oct 2010, 04:10
Location: 127.0.0.1
Contact:

Re: how do i ...?

Post by timpattinson »

If the power is negative the motor will go the other way
Commit to Lego Mindstorms StackExchange Q&A http://area51.stackexchange.com/proposals/4105
Minboards IRC Channel #mindboards on Freenode
My blog: http://timpattinson.wordpress.com/
Post Reply

Who is online

Users browsing this forum: No registered users and 23 guests