Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

error 1097 occurs when i try to run my vi

hi everyone,
                      i am trying to perform forward and inverse kinematics on a 2 degree of freedom robot.  My final goal would be to rotate the two motors using a mathscript code of inverse kinematics. currently i am working on the codes for the inverse kinematics in Matlab. since i am new to mathscript in Labview can anyone suggest me how to interface it with the motors in labview, so that i can move the motors when i input a certain position in the X and Y co-ordinates.  Any views and suggestions will be of great help.

regards,
 vijay
0 Kudos
Message 11 of 15
(1,681 Views)
Dear Vijay,

I would recommend using the Load Vector Space Position VI. You can output the X and Y coordinates from the Mathscript node and then input them to the Load Vector Space Position VI. You will probably want to create a loop around this process so that as you feed your equations new inputs, the your motor positions will dynamically update. See the attached image for of how you would start to set this up.

NOTE: the code in the image is not functional and is just meant as a suggestion of where to start. You will definitely need to make extensive additions/changes.

Also, I was reading your earlier posts to this thread, and see that you've been working on using a joystick to control the motors. Have you taken a look at the JoyStage example VI? This VI shows how to use a motion controller with a joystick.

Hope this helps!

Best Regards,

~Nate




0 Kudos
Message 12 of 15
(1,655 Views)
Opps. Here is the real image.

~Nate
0 Kudos
Message 13 of 15
(1,652 Views)
Thanks Nate,

                         I took a look at the image that you sent and i think that should help me out. Until now i have been able to move the two motors through a joystick, further i would like to go ahead and input the X and Y co-ordinates taken from the joystick, perform the inverse kinematics and then move the motors accordingly. i have attached my joystick VI that i developed on which i need to perform the inverse kinematics. please take a look and i would appreciate if you could let me know of any suggestions you have on it.

thanks,
 vijay
0 Kudos
Message 14 of 15
(1,633 Views)
Dear Vijay,

Your motor VI looks like it should work fine to move the motors once. If you incorporate a loop like I was talking about in my last post, I think you should be well on your way. The way I see it, you may want to implement a master/slave design pattern, or other queued architecture in making your program dynamically update. You can explore some of these architectures by going to file»new from LabVIEW, and then browsing the different options.

The portion of your code that reads data from the joystick would be constantly updating in the master loop, and the code that send target positions and velocities out to your motors would be in the slave loop. You may run into trouble with the response time of your system with some queued architectures, because I would think the joystick position could update much faster than your motor positions, thus resulting in a backlog of positions waiting to be sent to you motors. If this were the case, you would see an ever increasing delay between the positions your commanded and the actual motor motion. There may be ways around this, like resetting the queue after it reaches a certain size, or limiting the loop rate for the loop that gets the joystick data.

Hope this helps!

~Nate

0 Kudos
Message 15 of 15
(1,611 Views)