Using Two NXTs brick

This is where you talk about the NXJ software itself, installation issues, and programming talk.

Moderators: roger, 99jonathan, imaqine

Using Two NXTs brick

Postby tamasu » Sun Jan 27, 2013 8:11 am

Hi,

I have a project where I need to use 7 motors and therefore I have to use two NXTs. My understanding is that the only possible way of connecting one NXT to another is to use bluetooth. From testing I have carried out it seems that it is not adequate to control the robot in realtime. For instance if the robot needs to move forward, the NXT 1 is sending a command to NXT 2 to instruct the motors A and B to turn, however it seems that the second command does not arrive immeadiately and motor A will start turning without motor B, causing the robot to drag to one side.

I have also noticed that if an obstacle is detected, the robot is unable to stop both motors immeadiately.

if the avoid behaviour detects an obstacle the NXT 1 sends a a backward command from NXT 1 to NXT 2. If after completing the backward process the robot detects again that there is no obstacle it moves straight forward and so forth. The process itself is very slow and sometimes the robot moves forward whilst an obstacle is being detected but since it is still executing the previous commands it will get out of synch with the real behaviour.

I am sure that there is a solution to these issues. Any ideas how to resolve?

Thanks
tamasu
New User
 
Posts: 7
Joined: Sun Nov 25, 2012 12:14 am

Re: Using Two NXTs brick

Postby gloomyandy » Sun Jan 27, 2013 9:30 am

You can also use RS485 to connect the two NXTs via a wired connection. This should give a more responsive level of control... If you already have code to do this with Bluetooth it should be very easy to change it to use RS485, If you are using the RemoteNXt classes which controls the other robot via LCP you may have to write a small program that creates a RS485 LCP responder for the slave robot as the standard leJOS menu does not contain a built in RS485 LCP responder.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3012
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Using Two NXTs brick

Postby tamasu » Sun Jan 27, 2013 10:12 am

Thanks for that.Great feedback

Can you pls confirm if the RS485 cable should be connected to port 4 of the NXT's sensor Ports or I should use the usb connection?

Considering that I have 7 motors I have purchased a multiplexer. From your experience do you know if the remoteNXT APIs are able to work well for multiplexers..

Thanks again for your assistance
tamasu
New User
 
Posts: 7
Joined: Sun Nov 25, 2012 12:14 am

Re: Using Two NXTs brick

Postby gloomyandy » Sun Jan 27, 2013 1:15 pm

Hi,
Yes you connect port 4 to port 4 with a standard cable. You can test things are working by using the NXTConnectTest sample on one NXT and NXTReceive sample on the other.

Sorry I've no experience of using the multiplexer so I'm not sure how well that will work with the RemoteNXT code. You may want to consider running your own code on both NXTs and using the standard stream connections over either RS485 or Bluetooth to send your own command codes between the two devices.

Andy
User avatar
gloomyandy
leJOS Team Member
 
Posts: 3012
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Re: Using Two NXTs brick

Postby kirkpthompson » Sun Jan 27, 2013 5:29 pm

Hi.
The lejos.nxt.addon.NXTMMX class allows you to use the Mindsensors NXTMMX multiplexor but I don't have experience with the remote LCP-centric code to know if it will work with that. What multiplexor did you purchase?

Best,
-K
Leg Godt!
User avatar
kirkpthompson
leJOS Team Member
 
Posts: 285
Joined: Wed Dec 05, 2007 1:27 am
Location: New Mexico, USA


Return to NXJ Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff