{"id":7457,"date":"2016-11-23T11:51:06","date_gmt":"2016-11-23T00:51:06","guid":{"rendered":"http:\/\/legoeng.local\/?p=7457"},"modified":"2018-03-22T15:52:39","modified_gmt":"2018-03-22T04:52:39","slug":"nxt-nxt-remote-control-in-labview","status":"publish","type":"post","link":"http:\/\/legoeng.local\/nxt-nxt-remote-control-in-labview\/","title":{"rendered":"NXT-NXT remote control in LabVIEW"},"content":{"rendered":"

\"nxt-remote-control\"<\/a>The idea for this challenge is to design and build an NXT-based remote control that you will use to steer an NXT-based robot vehicle through an obstacle course or maze as fast as you can, using NXT-NXT Bluetooth<\/em>.<\/p>\n

An obstacle course or maze is required for this challenge. For example, this could be two lines of electrical tape about three metres apart with lots of NXT tubs scattered in between.<\/p>\n

Robot design<\/h3>\n

The interesting part of this challenge is in designing a remote control that is easy to use and is able to control the robot vehicle effectively.<\/p>\n

Nearly any vehicle will suffice, e.g. the TassieBot<\/a> would be fine. Whatever vehicle you decide to use, don’t spend long getting it ready.<\/p>\n

Program<\/h3>\n

To communicate by Bluetooth, the NXTs need to be \u201cpaired\u201d. One NXT brick will be the “master” (or \u201chost\u201d) and can link with up to three “slave” (or \u201cclient\u201d) NXT bricks. It helps if each NXT brick in the room has a unique name. Chris Bracken\u2019s \u201cEducate NXT\u201d has a good chapter dealing with NXT-NXT BT communications.<\/p>\n

One approach<\/h3>\n

A very simple approach is to use the Left and Right NXT Buttons on the remote control to make the Left and Right motors go forward respectively. For example…<\/p>\n

\"Simple_remote_-_master\"<\/a>Master – Wait until the Left button is pressed on the NXT and then send a message to mailbox 1 on the slave (on connection #1). The message in this case happens to be the number “1”, but any message will do.<\/p>\n

If you want to send a message when the Right button is pressed, it would be best to have it in a separate loop and use a different mailbox. You will be connecting to the same NXT brick so keep it set to connection #1.<\/p>\n

\"Simple_remote_-_slave\"<\/a>Slave – Wait until a message has been received (note that this is a Wait block set to “Wait for Bluetooth message” – it’s not the Mail block) and then move forward for one second.<\/p>\n

Notice that we don’t do anything with the message – that’s why I said any message will do.<\/p>\n

Also, notice that we’re waiting for a message to come in on mailbox 1. We could set this to be the left motor only. We could then have another, separate loop, waiting for mailbox 2 to receive a message before moving the right motor.<\/p>\n

Another approach<\/h3>\n

A more sophisticated approach is to use rotation sensors (i.e. motors) on the remote control and then set the power on each of the car\u2019s motors to the rotation value of the corresponding motor on the remote. Here\u2019s how to send and receive the power for one motor\u2026<\/p>\n

\"Remote_-_master\"<\/a>Master – Read the rotation sensor for a particular port and send it.<\/p>\n

Note that I reset the rotation sensor before starting the loop (this probably isn’t strictly necessary here – I think the rotation sensor is reset whenever the program is started – but it might be useful to reset the rotation somewhere else in the program…)<\/p>\n

 <\/p>\n

\"Remote_-_slave\"<\/a>Slave – Wait until we receive a number and then use it to set the motor power.<\/p>\n

Notice that either “Port B” or “Mailbox 2” can be used for the four different kinds of blocks used in these examples, and that they effectively mean the same thing…. Very cool!<\/p>\n

 <\/p>\n

Assessment<\/h2>\n

Your grade will be based on an average of these two criteria…<\/p>\n\n\n\n\n\n\n\n\n\n
Grade<\/th>\nPerformance<\/th>\nCreativity & aesthetics<\/th>\n<\/tr>\n
A+<\/td>\nYou make it through the fastest<\/td>\nYour remote is the best<\/td>\n<\/tr>\n
A<\/td>\nYou make it to the end<\/td>\nOutstanding and easy to use<\/td>\n<\/tr>\n
B<\/td>\nYou make it more than half way<\/td>\nGood<\/td>\n<\/tr>\n
C<\/td>\nThe robot is under your control at some point<\/td>\nOkay<\/td>\n<\/tr>\n
t<\/td>\nYour robot wanders aimlessly<\/td>\nNothing special<\/td>\n<\/tr>\n
Z<\/td>\nYou don’t turn up<\/td>\nLook away!<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n

 <\/p>\n","protected":false},"excerpt":{"rendered":"

The idea for this challenge is to design and build an NXT-based remote control that you will use to steer an NXT-based robot vehicle through an obstacle course or maze as fast as you can, using NXT-NXT Bluetooth. An obstacle course or maze is required for this challenge. For example, this could be two lines […]<\/p>\n","protected":false},"author":4,"featured_media":11834,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[99],"tags":[129,600],"_links":{"self":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/7457"}],"collection":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/comments?post=7457"}],"version-history":[{"count":0,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/posts\/7457\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media\/11834"}],"wp:attachment":[{"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/media?parent=7457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/categories?post=7457"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/legoeng.local\/wp-json\/wp\/v2\/tags?post=7457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}