From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

Motor Control & TurnRatio

Hi All,

 

Just wondering if anybody out there has much experience/success with using synchronised motors on the NXT and the TurnRatio Property Node? I've attached a screenshot of a VI I'm working on at the moment, trying to get synchronised motors to turn left/right using the TurnRatio input... it's not working at the moment, just wondering if people can see anything obviously wrong or missing?

 

Thanks,

 

Mike.

0 Kudos
Message 1 of 2
(6,958 Views)

Hi Mike,

 

I can't remember the exact reasons, but I know there were issues trying to get a proper Sync behavior through Direct Commands... which is why we didn't ship any Sync versions with the NXT toolkit. When the command is issued by a program on the brick, it sets both motor ports values simultaneously. If you dig in to the Sync Unlimited NXT Library VI, you'll see we use the NXTOutputMulti property node to do this. Unfortunately there is no Direct Command equivalent.

 

However, in general I suggest that you don't try to do any fancy motor control through Direct Commands anyway. Since there is a latency in sending the message from the PC to the NXT and back again, it's very hard to send "simultaneous" commands as well as hard to ensure the motors stop at the right position or time (in the case of a Distance or Time based movement). Instead, put anything to do with your motor control algorithm down on a program running on the NXT. There you'll have access to the Sync commands and 1ms response time with the motors. After that, build a little Bluetooth messaging into the program on the NXT, then write a Direct Command program that sends a Bluetooth message that your NXT program will then interpret as a "Sync Unlimited". This is also a great way to build really fancy Direct Commands (like a "Drive this Path" command, which can be done by flattening a cluster of (Power, Distance, TurnRatio) to a string and sending it across). The only thing that this requires is that you actually have a program running on the NXT... hopefully that doesn't get in your way. Note that you can also programatically download an .rxe file and start a program up with Direct Commands, so it's pretty easy to make sure the program is running.

 

Hope that helps. Best of luck!

Brady

0 Kudos
Message 2 of 2
(6,908 Views)