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.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Custom made Robotic Arm serial interface with Pic microcontroller

Hello Everyone... I am new to labview and This is my first time posting in the labview forum. So Here's the question. I Have a custom made robotic arm with 6 dof using servo motors and need to impliment inverse kinematics on it. I have been looking around and found this http://zone.ni.com/devzone/cda/tut/p/id/10687 I m really impressed by the simplicity of it. I can build a model for my robotic arm and then do as stated on the page for inverse kinematics. The problem arises in the interface. I have never interfaced through serial port ever before and dnt know how to do it in labview. Parallel port is kind of easy compared to serial cause we directly send signals to each servo motor. Question 1 What blocks are we going to use to interface servo motor with the serial port. Question 2 What kind of programming will we do in the microcontroller so that it recieves and understand the signals sent by the serial port. Thanks
0 Kudos
Message 1 of 11
(4,419 Views)

Hi Warlox,

 

Can you tell me a little bit more about what you are communicating back and forth between? Are you trying to send serial commands directly to the motor or to a designated microcontroller? What kind of microcontroller are you using?

 

In case your interested in learning more about serial, here is a brief overview of serial communiation:

http://zone.ni.com/devzone/cda/tut/p/id/2895

 

A great place to start with serial programming in LabVIEW is from our example programs. You can find these in the LabVIEW Example Finder (Open LabVIEW, choose Help >> Find Examples).

 

Regards,

Andrew M.
Applications Engineer
National Instruments
0 Kudos
Message 2 of 11
(4,408 Views)
I am Thing of interfacing the serial to pic microcontroller. I have read that one have to store the serial data in some arrays in the microcontroller and then the microcontroller processes and send relevent commands to the servo motors. The thing that i m not understanding is what kind of data does the serial port sends for each motor to contol, and how does the microcontroller knows that this data recieved is for driving this motor. Has anyone did this before who can guide me ?
0 Kudos
Message 3 of 11
(4,404 Views)

Hi Warlox,

 

The serial commands depend on what kind of servo motors you are using, and what kind of microcontroller you are using. We will need to know what commands the motors are expecting to receive in order to know what commands to send. Can you tell me a little more about the microcontroller and servo motors you are using? Who is the manufacturer that makes them and what are their product numbers?

 

Regards,

Andrew M.
Applications Engineer
National Instruments
0 Kudos
Message 4 of 11
(4,392 Views)
The servo's i m using are of tower pro Mg 945 and any model of pic microcontroller can be used. I m thinking of pic18f452. Its because it has builtin hardware for serial communication. If ur good in any other microcontroller i can used it too. Regards Omer
0 Kudos
Message 5 of 11
(4,387 Views)
Can Anyone plzzzz help me... its really frustrating.
0 Kudos
Message 6 of 11
(4,368 Views)

Hi Omer,

 

I found another discussion forum of someone who was doing a similar project. The information might answer all your questions. You can find that here.

 

Furthermore, do you have a soft copy of the servo motor and microcontroller manual that you can send me? I need to understand how the motors are controlled over serial to help you with you microcontroller and LabVIEW code.

 

Regards,

Andrew M.
Applications Engineer
National Instruments
0 Kudos
Message 7 of 11
(4,357 Views)
Hello Andrew.. Thanks for taking out the time for helping newbies. Here are the specifications of the servo motor i m using. Specification shown: Control System: +Pulse Width Control 1500usec Neutral Required Pulse: 3-5 Volt Peak to Peak Square Wave Operating Voltage: 4.8-7.2 Volts Operating Temperature Range: -20 to +60 Degree C Operating Speed (4.8V): 0.20sec/60 degrees Operating Speed (6.0V): 0.19sec/60 degrees Stall Torque (4.8V): 9kg.cm Stall Torque (6.0V): 11kg.cm Operating Angle: 45 Deg. one side pulse traveling 400usec 360 Modifiable: Yes Direction: Clockwise/Pulse Traveling 1500 to 1900usec Current Drain (4.8V): 8.8mA/idle and 350mA no load operating Current Drain (6.0V): 9.1mA/idle and 450mA no load operating Dead Band Width: 4 usec Motor Type: 3 Pole Ferrite Potentiometer Drive: Indirect Drive Bearing Type: Dual Ball Bearing Gear Type: All Metal Gears Connector Wire Length: 11.81" (300mm) Dimensions: 1.59" x 0.77"x 1.48" (40.6 x 19.8 x 37.8mm) Weight: 1.94oz. (55.2g) The Servo needs a PWM of 1ms high followed by a 20ms low pulse to be at 0degree and 2m high pulse followed by 20ms low pulse to be at 180degrees. Similarly 1.5ms followed by 20ms to be on neutral postion. And for the controller part we can use any microcontroller. I was thinking of pic18f452 But if you know of something else we can switch on that. I have read on many forms that using boards of NI can do this but we cant find of them and it will take too long to ship and we dont watn to use hardware of national instruments. I have seen sites where they build their own boards using usb pic microcontroller.Here is a video of something similar. But its a simulation in proteus but we can build somthing like this if it really works. http://www.youtube.com/watch?v=r3mIP2aSN1Y Regards Omer
0 Kudos
Message 8 of 11
(4,352 Views)
Hello Andrew.. (Sorry about the previous message it all messed up in richtext format). Thanks for taking out the time for helping newbies. Here are the specifications of the servo motor i m using+ a snap of the servo motor. Specification shown: Control System: +Pulse Width Control 1500usec Neutral Required Pulse: 3-5 Volt Peak to Peak Square Wave Operating Voltage: 4.8-7.2 Volts Operating Temperature Range: -20 to +60 Degree C Operating Speed (4.8V): 0.20sec/60 degrees Operating Speed (6.0V): 0.19sec/60 degrees Stall Torque (4.8V): 9kg.cm Stall Torque (6.0V): 11kg.cm Operating Angle: 45 Deg. one side pulse traveling 400usec 360 Modifiable: Yes Direction: Clockwise/Pulse Traveling 1500 to 1900usec Current Drain (4.8V): 8.8mA/idle and 350mA no load operating Current Drain (6.0V): 9.1mA/idle and 450mA no load operating Dead Band Width: 4 usec Motor Type: 3 Pole Ferrite Potentiometer Drive: Indirect Drive Bearing Type: Dual Ball Bearing Gear Type: All Metal Gears Connector Wire Length: 11.81" (300mm) Dimensions: 1.59" x 0.77"x 1.48" (40.6 x 19.8 x 37.8mm) Weight: 1.94oz. (55.2g) The Servo needs a PWM of 1ms high followed by a 20ms low pulse to be at 0degree and 2m high pulse followed by 20ms low pulse to be at 180degrees. Similarly 1.5ms followed by 20ms to be on neutral postion. And for the controller part we can use any microcontroller. I was thinking of pic18f452 But if you know of something else we can switch on that. I have read on many forms that using boards of NI can do this but we cant find of them and it will take too long to ship and we dont watn to use hardware of national instruments. I have seen sites where they build their own boards using usb pic microcontroller.Here is a video of something similar. But its a simulation in proteus but we can build somthing like this if it really works. http://www.youtube.com/watch?v=r3mIP2aSN1Y Regards Omer
0 Kudos
Message 9 of 11
(4,350 Views)
Hello Andrew.. (Sorry about the above posts that went wrong) Thanks for taking out the time for helping newbies. Here are the specifications of the servo motor i m using. Specification shown: Control System: +Pulse Width Control 1500usec Neutral Required Pulse: 3-5 Volt Peak to Peak Square Wave Operating Voltage: 4.8-7.2 Volts Operating Temperature Range: -20 to +60 Degree C Operating Speed (4.8V): 0.20sec/60 degrees Operating Speed (6.0V): 0.19sec/60 degrees Stall Torque (4.8V): 9kg.cm Stall Torque (6.0V): 11kg.cm Operating Angle: 45 Deg. one side pulse traveling 400usec 360 Modifiable: Yes Direction: Clockwise/Pulse Traveling 1500 to 1900usec Current Drain (4.8V): 8.8mA/idle and 350mA no load operating Current Drain (6.0V): 9.1mA/idle and 450mA no load operating Dead Band Width: 4 usec Motor Type: 3 Pole Ferrite Potentiometer Drive: Indirect Drive Bearing Type: Dual Ball Bearing Gear Type: All Metal Gears Connector Wire Length: 11.81" (300mm) Dimensions: 1.59" x 0.77"x 1.48" (40.6 x 19.8 x 37.8mm) Weight: 1.94oz. (55.2g) The Servo needs a PWM of 1ms high followed by a 20ms low pulse to be at 0degree and 2m high pulse followed by 20ms low pulse to be at 180degrees. Similarly 1.5ms followed by 20ms to be on neutral postion. And for the controller part we can use any microcontroller. I was thinking of pic18f452 But if you know of something else we can switch on that. I have read on many forms that using boards of NI can do this but we cant find of them and it will take too long to ship and we dont watn to use hardware of national instruments. I have seen sites where they build their own boards using usb pic microcontroller.Here is a video of something similar. But its a simulation in proteus but we can build somthing like this if it really works. http://www.youtube.com/watch?v=r3mIP2aSN1Y Regards Omer
0 Kudos
Message 10 of 11
(4,349 Views)