LabVIEW for LEGO MINDSTORMS and LabVIEW for Education

cancel
Showing results for 
Search instead for 
Did you mean: 

move motors to specific coordinates

Hey everyone,

 

I'm working on developing a NXT robot that can move motors to a given set of coordinates. I am using Labview 8.6. So far I'm using the initialize mouse VI to give the coordinates of the picture that I've pasted onto the Labview front panel. My problem is that I do not know how to make the motors move to these coordinates. I know that I can set the motors to run for a specified time or number of degrees, but I do not know any other way. I've attached the program with the initialize mouse VI to get the coordinates. I am unable to download this onto the NXT. I've also attached the basic program of how we are moving the motors. I think it would be best to combine these some how. Any help is appreciated! Thanks.

Download All
0 Kudos
Message 1 of 7
(11,089 Views)
Those VIs calls a DLL from C:\Program Files\National Instruments\LabVIEW 2009\resource\lvinput.* so those cannot be target to NXT, what you can do however, is to use USB cable and run the VI on the host machine with those VIs and control NXT.
Andy Chang
National Instruments
0 Kudos
Message 2 of 7
(11,077 Views)
Yes, I am able to make each of the programs run individually while connected by USB. Now, I need to somehow connect the two. I have attempted to do this with the attached program. However, I think that the coordinates need to be converted to degrees for the Motor Distance. Another problem is that it will not compile and download to the NXT. The error says, "ERROR: An error occurred during parsing. Node was unable to be parsed. ((Class: CallLibrary) (VI: mouseAcquire.vi))" Also, I need to implement some kind of delay because it doesn't allow the user to move the mouse around to the desired coordinates. Please help!
0 Kudos
Message 3 of 7
(11,068 Views)
I'm not exactly sure how you are planning on converting your mouse cooridinate (0,0 := top left of your screen) into degrees of distance since it would depend on the resolution of the particular monitor. You may coorelate the desire distance to your mouse coordinate for the particular resolution that you have.
Andy Chang
National Instruments
0 Kudos
Message 4 of 7
(11,059 Views)

As in most vision Motion Systems, you will need to consider that the system will need to be calibrated.  In your case, pixels to degrees of rotation.  First consider the width and height of your clickable picture control.  For the sake of discussion, let's say that it is 100x100 pixels.  Now you will need to determine the distance that the motors can travel in each axis, in degrees.  Lets say 720 degrees (two full rotations).

 

Position the motors in the upper left corner of the travel area, and zero them out, them move them to the opposite corner, and read the number of degrees.  Lets say 720 degrees on X (two full rotations), and 270 (3/4 rotation) on Y.  These are the "real world" coordinates that we will convert to pixel counts.

 

The conversion looks like this: Xd= (X*(720/100)) Yd=(Y*(270/100)

 

When you click the Upper Left-most pixel in your image (0,0), you will send  Xd=(0*(720/100))=0 Yd=(0*(270/100)=0

 

When you click the Upper (22,77) in your image, you will send  Xd=(22*(720/100))=158.4 Deg.  Yd=(0*(270/100)=207.9 Deg.

 

Hope this helps.

0 Kudos
Message 5 of 7
(11,026 Views)

Hi,

 

I am new to the LabVIEW, I am trying to learn basics of it as I do not have much time to spend on learning process but I'm trying my best.......Could you help me by saying How to move the motor to the specific degree I required both in forward as well as backward direction?

 

For example, If I want to move my arm about 60 degrees and again backward to 45 degree 

 

Thank you in advance 

 

0 Kudos
Message 6 of 7
(6,256 Views)

Hi mittapar,

 

To be of further assistance, it would help to learn more about your system. 

  1. What kind of motors are you using?  Are they stepper or servo?
  2. What motor drives are you using?  Are you using the NXT platform like those who posted before?
  3. What software addons are you using?  Are you using NI Softmotion to control the motors?

Also, it may be worth making a new post since this one was made back in 2010, and likely will not get the same visibility.

Trevor H.
Technical Support Engineer
National Instruments
0 Kudos
Message 7 of 7
(6,233 Views)