PDA

View Full Version : [Question(s)] How to control Arbotix-m through Labview?



asdkaresz
01-16-2018, 12:39 PM
Hi guys, at first sorry for my bad english.

Im very new to this whole thing, thats why Im asking for your help.

I want to make an arm with 5 AX-12s, Arbotix-m and Labview. But Im stuck at the beginning.. I tried to program the Arbotix-m using a USB-TTL (UART) cable through Arduino IDE that was ok, but I would like to make my whole program in LabView, and I dont know how to begin. Is here someone who managed to get this thing working with these parts?
Or should I just use LabView, the cable and the servos? (without the arbotix)

I saw a lot of forums and videos about the USB2Dynamixel, but I do not would like to pay for it, if I could get it working with Arbotix-m and Labview.
I would be happy if you guys could help me out with some infos, instructions, thank you in advance!
(I have to do it with LabView, if you wondering why.)

Karesz from Hungary

darkback2
01-18-2018, 11:27 AM
Hi guys, at first sorry for my bad english.

Im very new to this whole thing, thats why Im asking for your help.

I want to make an arm with 5 AX-12s, Arbotix-m and Labview. But Im stuck at the beginning.. I tried to program the Arbotix-m using a USB-TTL (UART) cable through Arduino IDE that was ok, but I would like to make my whole program in LabView, and I dont know how to begin. Is here someone who managed to get this thing working with these parts?
Or should I just use LabView, the cable and the servos? (without the arbotix)

I saw a lot of forums and videos about the USB2Dynamixel, but I do not would like to pay for it, if I could get it working with Arbotix-m and Labview.
I would be happy if you guys could help me out with some infos, instructions, thank you in advance!
(I have to do it with LabView, if you wondering why.)

Karesz from Hungary

I do not think you can do exactly what you are trying to do, but you can do something similar.

You would need to write a program in Arduino that listens to the serial port, and translates messages from the serial port into commands to the servos telling them where to go.

With the help of some other people I came up with a program that did that a bunch of years ago, and I'll try to dig around and find the snippet of code that would help you.

Basically the host computer sends a series of messages that include servo numbers, and servo positions, and the arbotix then passes that info on to the servos.

Again, busy at work at the moment, but I'll try to get back to you about this later today.

DB

asdkaresz
01-18-2018, 12:01 PM
Thank you for your help. I understand what youre saying and I agree with it.
Today I ordered a USB2AX adapter, thats might be a better choice for my project.
But if you find your code, ill be very happy, and thank you very much again.

darkback2
01-18-2018, 12:43 PM
Found the bit of code:



//format # servonumber "p" four didget position---------------------------------

char cmd[8];
int startByte = 0;

// if there are bytes waiting on the serial port
if(Serial.available() > 0) {
// read the incoming byte
startByte = Serial.read();
// toggle LED so we know johnny5 is alive
digitalWrite(0,HIGH-digitalRead(0));
} // end Serial.available()
if(startByte == '#') {
// get the command from the serial port
while(Serial.available() < 8); // wait for data to arrive, do nothing
for(int i=0;i<8;i++){
cmd[i] = Serial.read();
} //this creates an array that takes in the data from the serial port
// convert command to two numbers
int servoNum = 0;
int servoPos = 0;

servoNum = (cmd[0]-48)*10 + (cmd[1]-48);
//builds the 2 diget servo Id number
servoPos = (cmd[3]-48)*1000 + (cmd[4]-48)*100 + (cmd[5]-48)*10 + (cmd[6]-48);
//builds the 4 diget goal position
SetPosition(servoNum,servoPos);
//sets servo position using 2 numbers one for servo, other for position.
// debug
Serial.print("cmd array:");
for(int i=0;i<8;i++){
Serial.print(cmd[i]);
}
Serial.println("----");
Serial.print("servoNum:");
Serial.println(servoNum);
Serial.print("servoPos:");
Serial.println(servoPos);

}// end if(startByte == '#')