Reader Question Submission #4

Jean-Marc emailed: "Hi, I am just starting out programming the NXT robot. I want to use one as a master with levers which will control the movement of the slave. I will use the motor as a rotation sensor in the master, but I'm not powering on the motor (it's to attempt to duplicate Steve's "omni"). Here is my question: When I start out with the lever in the straight up position, what numeric reading will the rotation sensor give me? If I want to move the lever forward and backward in a range of approximately 180 degrees, what is the reading of the "up" or neutral position? Thanks for your help!"

Any thoughts or answers?

Comments

Anonymous said…
Jean-Marc,

The rotation reading will be 0 when you first start the program no matter where the lever is. So just put the lever upright before starting the program.

I'm not sure how your master bot is set up, but you can find out how many rotations the lever has turned at any time by the "view" section on the NXT. Just go to "motor rotations", and it will show you how much rotations the motor has turned at all times.

-Jonathan
Anonymous said…
I had mine set up with 4 mailboxes. 2 mailboxes had the rotational value for each sensor and the other 2 were for direction. Direction was true if it was a positive number and false if negative number. Anyway by connecting it to power and direction on the move block I was able to drive with varible throttle in a "tank like" fashion. I got the code if you want.

nicthegr
Anonymous said…
Jim - if nicthegr emails you the program, would you post a screenshot of it?
Yes, I will... please email me a screenshot or .rbt file to jktechwriter at gmail dot com and I'll get it posted...

Jim
Brian Davis said…
The position that the motors start in *should* be the zero angle - although I usually include a Rotation sensor block set to reset to make sure.

Huh, I thought I had posted more detailed stuff on that. I've used remote control for my dual-NXT projects, and actually popped some of the code into my LEGO MDP profile page. The other place to look is in my Brickshelf folder: look at the screenshots "btrc" and "remote":

http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1891684

http://www.brickshelf.com/cgi-bin/gallery.cgi?i=1891688

Note that I didn't like the position & direction as seperate things... so I wrote a MyBlock to roll them into one (signed) value. Are these screenshots enough?

--
Brian Davis
Anonymous said…
Brian,

Is there some explanation somewhere about the "mux/demux of the switch"? I has a hard time figuring how to wire your GetAngle block (tried to wire directly add/substract inside switch to input of next block -> grey invalid wire!)

Philo
Brian Davis said…
There's a rough exaplination or guide here, in the screenshot of my abs(y) MyBlock:

http://www.brickshelf.com/cgi-bin/gallery.cgi?i=2029011

The trick (I think) is that the two wires coming out need to connect to the same wire *at* the boundry of the Switch, *not* at the downstream plug. Even then, it seems to be... tricky, to get it the first time.

--
Brian Davis

Popular Posts