I have a robot run by a Raspberry Pi 3+ and is connected to a Lynxmotion SSC-32U USB Servo Controller(controlling 5 servos per arm, 10 servos total) via a USB cable from the Pi. Confused by the communications and programming protocol between the Pi and the Controller to command multiple servo motions. Suggestions please.
Communications and programming protocol between the Raspberry Pi and a Lynxmotion SSC-32U USB Servo Controller
From your previous posts, I’m thinking you are using two Lynxmotion AL5 robotic arms, but let me know if they are something entirely different!
Well, the USB controller chip on the SSC-32U acts as a virtual COM port (or VCP; on Windows) or something like /dev/ttyUSBn (on Linux, Unix, OSx, etc.) on your host. Since you are using a RPi, it is most likely showing up as /dev/ttyUSB0 or something like that.
The communication itself between the RPi and the SSC-32U will be done through that serial port. Simple open it (and set that comm at the right baud rate, of course!) and you’ll be able to send to and receive data from the SSC-32U.
So first some details:
The SSC-32U ships by default set to 115200 baud rate. You can confirm the baud rate by powering the board (blue PWR LED should be on) and then pressing the BAUD button once near the USB port. See the details about this in the SSC-32U manual on page 34 (bottom half).
If you want to control your 10 servomotors you should probably familiarize yourself with the SSC-32U protocol. You can find more details in the manual on pages 24-26 for basic commands. There are also some more advanced commands detailed on pages 32-35, such as querying the status of a channel, reading digital or analog inputs and changing the baud rate programmatically.
All of those commands are simply sent in clear text ASCII to the serial port directly, therefore any platform you use should be able to provide the required tools to communicate with the SSC-32U.
Since you already seem to be using Python in another project (from your previous posts), you may find these examples useful for you:
- Basic example/test (sends channel # 0 - # 5 to position 1500)
- Basic 2D IK example
If you want more info about the AL5D and 2D IK (Inverse Kinematics) for it, have a look at these discussions:
- AL5D Inverse Kinematics spreadsheets, need 3D version?
- AL5D inverse kinematics no constant gripper height
- Move the AL5D-Arm under his platform level
- Mac code for working with AL5D arm
- Lynxmotion AL5D w/ Raspberry Pi (and especially that one! )
I hope this helps you get started! Good luck!
That works and one arm moving in steps only. Trying to figure out best way to enable variable control of each servo. This definitely got it working though.
Again thanks for you response.
Incremental success is the way to completion!
Glad this helped!
Would you mind explaining more what you mean by variable control of each servo? I have a feeling I can probably provide some advice (or at least more starting points!) but I’m not 100% what that sentence implies.
Do you simply mean controlling each servo individually? The basic 2D IK example is basically just telling the servos to go to the next position all at once. Of course, you could be more fine-grained about it and create a more complex IK system on your RPi (which many people do), specifying various rate of motion for each servo/channel.
You may also be interested in using something like ROS2 to leverage complex components that are already well tested for controlling robotic arms! And adding a component to control the SSC-32U (or really individual channels) shouldn’t be too difficult, either. I know there’s already at least one SSC-32U ROS1 component so maybe that can be adapted relatively easily?