Hello,
Sorry if the question has already been answered, but the search function is not helping me further.
I use the AL5D robot arm which I can control using the RIOS software or LynxTerm. For some strange reason it does not work from the Dual Lynx Arm Controller software.
Now I want to control the robot programmatically, preferably from MatLab or C++. What is the best way to get started? I use MatLab7 and Visual C++ 2010 Express (but e.g. Eclipse would be fine as well).
Thanks a lot!
Pieter Kubben
There are code examples here on the forum for matlab and labview. I’m not sure what eclipse is. We are working on the dual arm controller program. viewtopic.php?f=46&t=8123
Thanks for the reply and the link to the other topic. I replied there too, as I am experiencing the same issue with the Dual Arm Controller software on Win7. The Rebuild Debug version does a better job, but with the same issues as the topic starter describes. Anyway, it is getting better, and you are working on it. Thanks for that.
Regarding the programming, I do not seen anything about programming in that topic, except for Dev5994’s signature link to the FlowStone User Guide. However, my question is whether there is some kind of API to control the robot arm in MatLab or C++. Can you help me on that? How can I program the robot to perform certain tasks? Maybe the Dual Arm Controller is the only way, but then it needs to work better. On the other hand, this software needs to be programmed in a certain language, thereby directly controlling the robot arm. In what language is this done? Is this code accessible, especially the code to control the arm?
And FYI: Eclipse is an IDE, mainly for Java. On Mac I work in XCode, on Windows in Visual C++ 2010 Express.
Looking forward to continue the discussion, and keep up the nice work on the arm!
Pieter
Here’s the section of my arduino program that manipulates the Arm.
int Arm(float x, float y, float z, int g, float wa, int wr) //Here's all the Inverse Kinematics to control the arm
{
float M = sqrt((y*y)+(x*x));
if(M <= 0)
return 1;
float A1 = atan(y/x);
if(x <= 0)
return 1;
float A2 = acos((A*A-B*B+M*M)/((A*2)*M));
float Elbow = acos((A*A+B*B-M*M)/((A*2)*B));
float Shoulder = A1 + A2;
Elbow = Elbow * rtod;
Shoulder = Shoulder * rtod;
if((int)Elbow <= 0 || (int)Shoulder <= 0)
return 1;
float Wris = abs(wa - Elbow - Shoulder) - 90;
#ifdef DIGITAL_RANGE
Elb.writeMicroseconds(map(180 - Elbow, 0, 180, 900, 2100 ));
Shldr.writeMicroseconds(map(Shoulder, 0, 180, 900, 2100));
#else
Elb.write(180 - Elbow);
Shldr.write(Shoulder);
#endif
Wrist.write(180 - Wris);
Base.write(z);
WristR.write(wr);
#ifndef FSRG
Gripper.write(g);
#endif
Y = tmpy;
X = tmpx;
Z = tmpz;
WA = tmpwa;
#ifndef FSRG
G = tmpg;
#endif
WR = tmpwr;
return 0;
}
basically the function tests the input variables to make sure they provide a legal solution, if it works the input is stored and the arm moves, if not the input is ignored and the arm stays at the stored position.
Since you control your arm from LynxTerm or RIOS, I assume (hopefully not incorrectly) that you have an SSC-32 controller.
This page contains a link to the user’s guides for the controller. Look under “Servo Controllers” and “SSC-32 (Atmega168)”. Simple commands sent over a serial port can control your arm, but you are problably familiar with these since you use LynxTerm.
So you would write your code in C++ (or Matlab, although I am not familiar with that platform) to send commands directly to the AL5D arm via a serial connection in order to control it. I would say, the API of which you were enquiring is indeed the SSC-32 commands.
dj’s fantasi
@Dev5994: thanks, this looks like a C++ implementation of an Arm class. Maybe it’s proprietary, but is there any documentation about other code, e.g. to connect to the arm from the computer?
@djsfantasi: indeed I have the SSC-32 controller. I see some code in the Atom language, which I am not familiar with. What software can I use to compile / send the commands? Google did not have that much info here…
Thanks,
Pieter
Okay, silly me… I had not yet noticed that you could actually TYPE in that Lynx Terminal. I had just been playing around with the sliders… Now I understand why djsfantasi sent me that link. Works perfect!
Next: in the end I will need to do this from outside LynxTerm. Either I can write code and have it sent to LynxTerm (if a connection can be made), or I still need some API (C++ or other) to connect and interact with the arm.
So, is there a way to control the arm programmatically (e.g. direct from C++) outside of the RIOS / LynxTerm software. And how? (including some kind of API to make connection to the robot). Is there any API available? (don’t see any)
Thanks,
Pieter
It’s a serial servo controller. There is no API. You simply send it ascii commands. Any programming language that can send serial data can control the arm. Read the SSC-32’s users guides to learn how to send the commands.
lynxmotion.com/s-4-electroni … .aspx#serv
The commands covered in the documentation are what RIOS and LynxTerm are sending to the servo controller.
Okay, that anwers my question, and is actually pretty good news. Thanks!