AL5 Control with C++

I am completely new to robotics so I apologize in advance if my questions aren’t complete or silly. :slight_smile:

I’m interesting in purchasing an AL5 arm and attempt to have it move via C++. Before doing so I wanted to ask, has this been done? Are there libraries or code already written to accomplish this?

My end goal is to tie some C++ already created libraries into C++ code I’ll write to capture an object via a sensor, move the arm, and squeeze the object.

If anyone has done this with C++, have you done any timings? I’d like to have the arm move as fluidly and as quickly as possible.

I’m a Linux/UNIX person and would love to use Linux or a Mac to connect to the arm initially wired and eventually via bluetooth if possible.

Thank you in advance for any help and advice you may provide,
Adam

I have had an AL5 arm controlled by a Botboarduino (Arduino 328p), that I posted the code up here at some point. Actually it was in the Lynxmotion forum, which is now gone and folded into here… I did it a few years ago when Lynxmotion was in the process of converting from using Basic Atom Pros (Basic) to Arduino (C/C++).

I have since then disassembled the Arm and reused most of the parts in other projects. However I later built a Trossen Robotics Arm: (github.com/KurtE/Phantom_Arm. Note: the current code is configured to use their Arbotix Commander to control the arm and has three different, ways to control: (Cartesian, Cylindrical, and Backhoe mode)

It should not be difficult to change the code base to use the AL5 servos, especially if you are using an SSC-32 to control the servos.

It also should not be difficult to convert the code to Linux. I have a lot of my code bases converted over to run on Linux boxes. I have a version of the same Arm code working using Linux, again I was using the PhantomX arm and I was using a USB2AX device (xevelabs.com/doku.php?id=pro … 2ax:usb2ax), to connect the servos up to a Linux Box. I also built my own updated firmware for the USB2AX which added some capabilities. My Linux code is also up on github:
github.com/KurtE/Raspberry_Pi

Note: While the project name is Raspberry Pi, I have also run most of the code also on BeagleBone Black and on Odroid U3 boards.

Hope that helps
Kurt

There is also some example code in C for the BotBoarduino on the Lynxmotion Github. This program is designed to control an AL5 arm using a PS2 remote and inverse kinematics (Cylindrical).

But if you want to control an AL5 arm with a computer, like Kurt said, you will likely want to use an SSC-32 board to control the servos. To send commands from a computer to an SSC-32 board, all you need to do is open a serial port (/dev/tty0, /dev/ttyUSB0, /dev/ttyACM0, etc) and write the serial commands to specify channels and positions. The documentation for the serial protocol is available here: lynxmotion.com/images/html/build136.htm

You can reuse one of the inverse kinematic engines (from Kurt’s code or the Lynxmotion sample) to calculate the right servo positions, and then use the serial protocol to send the calculated positions to the SSC-32 board.

If your computer doesn’t have a regular serial port, you can use a USB-to-serial adapter to connect to it, or you can use these parts to use Bluetooth instead:

Hope this helps,