Here I describe how to control Robotis Dynamixels (smart actuators) from a PC via a serial protocol. I also provide code for this.
Archives For Robotis
Recently, I have been playing with a robotic kit – Bioloid from a Korean company Robotis (this kit has been around for quite some time, so this post may repeat well known facts). If you are interested in robotics, but do not want to deal with low level details, this kit might be for you. It is very easy to create robots with it – you only need a screwdriver and a PC. At the same time it is very flexible and allows creating a variety of robots – from simple manipulators to humanoids.
Here is how this kit looks like when you buy it (this is a “comprehensive” version of the kit, the humanoid robot does not come pre-assembled):
It includes: 1 main controller, 18 servos, 1 sensor, wires and a variety of frames. Robotis calls their servos and sensors dynamixels. They all have the same unified casing (even sensors) and serve as basic construction blocks for robots. Dynamixels are wired together (and to the main controller) in a daisy chain fashion (see picture). This minimizes wiring and simplifies assembly.
Each dynamixel has a unique ID and when they are wired together they form a “chain of responsibility”, i.e. each dynamixel reacts only to commands that are sent to it even though they all listen to all commands on the wire. In addition to controlling servos, the main controller can read their parameters, e.g. current position, temperature, applied force, etc. Bioloid servos, sensors and frames are connected together with small nuts and bolts, which makes assembling a bit tricky.
Bioloid comes with great software support. There are 2 main tools for programming a Bioloid robot – Motion Editor and Behavior Control Programmer. It is also possible to program in C if you want to have greater control.
The Motion Editor allows recording basic joint movements. This process looks like making a cartoon animation – you move joints by hand and record snapshots in sequence. Then this sequence is given an ID and saved in the main controller, so it can be invoked later by a higher level behavioral program.
The Behavior Control Programmer allows writing higher level programs that either use pre-recorded motions or control servos directly. Bioloid has its own language that looks like BASIC. If you are familiar with basic programming you will have no problems coding in this language. Programs are event driven – they respond to events from sensors and launch different motions or procedures according to current state.
Here is the video of a manipulator that I made with this kit. This simple robot detects objects in front of its sensor and tries to grab them. The claw and the sensor have some slack, so objects may be placed in a small area and not only in one spot:
It took me about 2 hours to assemble and to program it. I spent most of the time assembling it mechanically, because the kit has rather small nuts and bolts (at least for my hands) and it is pretty tricky to put nuts into their slots in dynamixels/frames. Programming was very easy and straightforward – I recorded several basic motions with the motion editor and then used them in the Behavior Control Programmer tool. It required very basic scripting skills and I think anyone can do it, but I am a software developer, so it could be easier for me than for others.
Here are pros and cons of Bioloid kit that I can think of after playing with it for some time:
- Very flexible. Allows creating a variety of robots
- Very easy to assemble and program robots
- Motion Editor is great – it takes just a few minutes to create a very complex motion
- It includes only 1 sensor. It is infrared and very inaccurate. It would be great to have a set of different sensors including ultrasonic distance sensor.
- Assembling/disassembling robots can be tricky due to very small nuts/bolts and not precise slots in frames.
- It is easy to code a small program in the Behavior Control Programmer, but this tool and the Bioloid language does not scale well in terms of complexity – when you want to create something more complex, it becomes very hard to maintain and change control programs. It is almost impossible to code any AI algorithm of medium complexity (to be fair – you can program Bioloid in C, but in this case, the complexity goes through the roof and this kit loses its attractiveness)
Overall, I think it is a great educational kit/toy for people interested in robotics