Together with the launch of the new robotics programming platform FlowBotics Studio, RobotShop also launched the Servo Erector Set V1.1 from Lynxmotion. This is a kit of over 500 parts enabling you to build five different robots and control them via pre-made robot applications inside FlowBotics Studio which is also included.
The five robots are:
- 2WD Rover
- AL5 Robot Arm
- BRAT Biped
- MH2 Hexapod
- SQ3 Quadruped
Hardware
The hardware kit comes with detailed instructions on how to build each robot; many of the parts are shared, so you need to decide which robot to build at a time. This is a neat idea as you can start simple and work your way up to the more complex kits as your experience builds. We would suggest starting with the Rover, then the Arm, Hexapod, Biped, and finally the Quadruped. You also get a wireless Lynxmotion PS2 controller included to control your robot. The Servo Erector Set comes complete with everything you need including even a powerful rechargeable battery and charger, and in fact contains over 500 components!
Software
In this article, we are going to focus on the software side using FlowStone inside FlowBotics Studio to control these awesome little robots, although there is also an Arduino control board included in the kit if you prefer a low level approach.
Connectivity
Each robot is controlled by a Lynxmotion SSC-32 servo controller board which allows up to 32 servos to be controlled from a single board. In addition to this, there is a Bluetooth daughter board that gives you wireless control over your creations.
All of the processing is done via the PC and FlowBotics Studio, so you have masses of processing power at your disposal to do cleaver things like Inverse Kinematics, etc. This wireless telemetry approach is really cleaver and more importantly gives you lots of possibilities for the future to enhance your robot.
So the system looks like this: Wireless PS2 Controller – PC – Bluetooth – SSC-32 – Robot
FlowBotics Studio
At this point, you have your robot built and wired up, and it’s now time to take control using the FlowBotics Studio software. On opening FlowBotics Studio, you can navigate to the Lynxmotion folder where you will see five pre-made robot control projects. Double-click to open one of these and you will be presented with the application window for that project running like a standalone application. This App is an on-screen simulation of your robot where you can use the mouse to drag the limbs of you robot around on screen and the connected robot will move simultaneously.
To connect to the physical robot, click on the ‘Port’ button and wait for you robot to be connected via Bluetooth — note that the Bluetooth daughter board and your USB Bluetooth receiver must be already paired in Windows. The Port button will scan the various serial ports on your PC until it finds the Lynxmotion SSC-32 controller board. Once connected, any movements you make on screen with be relayed directly to the robot hardware. Now that you have control, it’s time to discover the new Robot Pattern Sequencer. If at any point you need help, in addition to the comprehensive user manuals, there is a simple onscreen information system if you hit the ‘I’ button.
Robot Pattern Sequencer
Included in each of the robot application is a very powerful robot pattern sequencer. This is here to allow you to create patterns of movement. Since many of the robots can walk or move in so many different ways, this is really useful to build up a library of movement patterns. E.g. walk forwards, walk sideways, rotate, etc.
Also included are demo patterns and sequences for each robot: to load these, go to the import pattern button and select the correct file for your current robot. This will load various example patterns that you can use or modify to take control over your robot. For each robot, there is also some pre-programmed control using the wireless PS2 controller: once the demo patterns are loaded, you can literally make you robot walk straight out of the box.
Creating Patterns
Once you have explored the example patterns and sequences, you can start the real fun part: creating your own!
To do this, you first need to understand how the patterns are constructed. Each pattern contains a series of ‘Frames’ — each frame representing a particular position of your robot — and by building up frames of movement, a bit like a movie, you can animate your robot. Frames can be infinitely modified and refined to perfect the movement, and the frame length can be adjusted to give you control over the speed of movement. You can also save and load your work to disk at any time.
Creating Sequences
Once you are happy with your patterns, they can be added to the timeline in any order you like, including multiples, to create a sequence of movements. These sequences can then be played, paused, looped, etc. using the transport controls, and sped-up or slowed-down using the playback speed options.
If you spot any errors in your work, fear not, as you can always modify any sequence, pattern or frame at any time.
The Robots in Detail
The 2WD Rover
The 2 wheel drive rover comprises of 2x continuous rotation servos connected to the SSC-32 servo controller and a Bluetooth wireless connection back to FlowBotics Studio running on the PC. In the software, you can control each wheel's speed of rotation to steer you robot around the floor. If you use the included PS2 controller, you can control the rover like a remote controlled car, but since FlowBotics Studio is as much about robotics programming, there is also an autonomous mode that uses the Sharp distance sensor to allow the rover to autonomously navigate around the room. All of the source code is available at the touch of a button by entering the FlowStone programming view in FlowBotics Studio (Shift+Escape): most of the source that does the autonomous mode is contained in the User Programming area, described later in this article.
The AL5 Robot Arm
The AL5D robot arm is a 3 axis arm with base rotate and a gripper. This robot can be wireless using Bluetooth or connected directly to the PC using the serial to USB adapter. Inside FlowBotics Studio, the arm App allows you to drag the graphical arm around on the screen and the real arm will follow: seeing is believing, and this is a really neat feature. In addition, you can take control over the arm (both graphical and for real) using the PS2 controller and move the arm to the position you wish. You can now use the remote to help you make robot sequencers: use the remote to move the arm to a specific position, for example to pick up an object, and use the sequencer to record each frame and create the moves necessary to complete the task. Once you are happy with your pattern, it can be saved to disc and re-used as part of a sequence to achieve bigger and more complex tasks. In the classroom, students can even work on individual patterns and bring them together to form a bigger sequence at the end.
In addition to the sequencer, there is the ability to add buttons or sensors, and interconnect different robots electronically to allow them to communicate. This can be achieved using the ‘User Programming’ area in the FlowStone programming view.
The MH2 Hexapod
The MH2 Hexapod is a 2 DOF (degrees of freedom) hexapod with two joints per-leg. Using the SSC-32 and the Bluetooth adapter gives you wireless connection to your PC. In the FlowBotics software, you can move each joint and explore the various gaits to make this robot walk and turn. Again you can use the PS2 controller to control the hexapod using the demo pattern files.
The BRAT Biped
The biped is a great robot with 3 DOF in each leg allowing it to walk and turn really smoothly. Each leg uses Inverse Kinematics (IK) to create more human like walking movement and also makes the programming of this robot much easier. You can move the feet in the software and the whole leg will follow because of the IK. The BRAT uses the SSC-32 servo controller with the Bluetooth board to gain wireless control and also uses the PS2 controller for remote control.
The SQ3 Quadruped
Finally, the SQ3 Quadruped: this is the most sophisticated and complex of all of the robots in the SES kit with 3 DOF for each leg. Once again, the programming uses IK to make it simpler. Using the PS2 controller, you can even rock and roll the robot to bring this creature to life: the IK makes it move in all directions whilst keeping all of the feet on the ground. The SSC-32 and Bluetooth adapter are again used for wireless control.
Custom Programming
Each of the robotics projects included in the Servo Erector Set has a
User Programming area inside the FlowStone programming view where you can easily modify, add to, and enhance your robot application. You can even connect to the MyRobots.com Robotics Cloud (‘
Facebook’ for Robots) to log your robots movements or to communicate with other robots around the world!
Example User Programming Area
Now, we are going to dig a little deeper and enter the world of the FlowStone programming language running underneath the main projects to explore the possibilities of creating custom projects. This can be split into three parts, 1) Using the stock programmability, 2) Tweaking the User Programming Area, and 3) Full custom programming.
Using the stock programmability
With the latest version of FlowBotics Studio, you get some neat pre-programmed features that allow you to take external control of your robot without creating any code. These largely use the spare input pins (ABCD) on the SSC-32 servo controller to control the software state as well as hardware control from the included wireless PS2 controller. Earlier, we introduced the concept of patterns and sequences allowing you to build a library of robotics movement. Now using the ‘Special Operations’ tools you can add a ‘Pause Before Frame’ command on the timeline to control your robot. This will pause the sequencer at a particular frame until you toggle input ‘B’ on the SSC-32 server controller board which will resume playing. Input ‘B’ can also be used to start playing from anywhere in the sequence. Input ‘C’ will stop the sequence, giving you full control of the timeline transport via external hardware pins. This basic functionality enables you to get multiple robots to interact and can be used to add various sensors to control your robots behaviour.
The User Programming Area
If you want to add more functionality than the basic start/stop/pause, then you can create whatever you need in the User Programming Area. This is nothing more than an area within the FlowStone code set aside for users to be creative without the worry of messing up the whole program; after all you get access to the full source code so you can change absolutely everything!
In the User Programming area, there is a set of simple building blocks and Ruby scripts that should allow the more adventurous roboteers to create custom interactivity with the minimum of effort.
What’s really exciting about FlowBotics Studio when you start to delve deeper, is the fact that the FlowStone code used to create the project is running underneath the main application all of the time in real-time. This means that there is only one program running, not a separate source code that needs compiling. If you press ‘Shift+ESC’ from inside a FlowBotics application, it will reveal the FlowStone code underneath; since these projects are quite sophisticated and complex, there is a special module for beginners to create their custom interaction and it can be found at the top left of the project, one level down once you are in the FlowStone mode:
Once in the User Programming Area, you can see a set of pre-made modules that you can easily re-connect and modify:
For example, you can now see how the pre-made pause mode works and how it’s controlled from Input ‘B’ & ‘C’ from the SSC-32 servo controller. These inputs are on drop down menus, so you can easily select a different input.
You can also see the pre-made modules for the PS2 controller interaction. If we enter one of these modules, for example the ‘Gripper Open/Close’, then you can see how the interaction is allocated:
These are wired to the PS2 Controller by default, but could be wired up to a different interface very easily. For example, if we were to add a Phidgets 8/8/8 interface board, we could have 8 digital and 8 analogue inputs with sensors to control our robot:
Adding the FlowStone Phidgets 8/8/8 module, we now have control of the base rotate from analogue inputs 0 & 3. If input 0 > 100 rotate clockwise, if input 3 > 50 rotate anti-clockwise. The same with the Gripper Open/Close: if digital input 0 = 1, Open Gripper, if digital input 1 = 1, Close Gripper. For those of you that also spotted the ‘After Load’ module on the Phidgets Start input, this merely connect to the Phidgets hardware on start-up by sending a trigger to the Start input of the module when the project loads. FlowBotics Studio supports literally hundreds of different hardware interfaces, including the entire Phidgets range, all sorts of motor controllers, sensors, cameras, sound cards, DAQ interfaces, USB, serial, and networking too.
So far, we have seen how we can control our robots movement via external inputs and use the SSC-32 ABCD inputs to play/pause and stop our sequencer, but what if we want to play specific patterns of movement from external control?
This is where the Ruby code scripts come in: these are inside the modules across the top called things like ‘Play Home’, ‘Play Pattern1’, etc.
Inside these, there are some Ruby scripts that you can modify to create complex interaction with your patterns of movement:
These look complex at first, but once you understand, the Ruby code is quite simple. There are seven basic script commands: Play, Stop, Reset, Goto Pattern, Loop False, Loop True, and Speed; these can be seen in the ‘Sequencer Commands’ Help bubble. This script works by receiving a Start Trigger from some external hardware, then as can be seen in the Ruby code: stopping the sequencer, setting the playback speed to 2, turning off the loop mode, then setting the play position at the pattern called ‘Home’, and then finally playing that pattern. Once the Pattern called ‘Home’ is finished, it outputs a trigger to the ‘Done’ output so that the next pattern can be started, and so on. You can edit this Ruby code to do whatever you like: it is totally open and very powerful. For example, you could add some more ins and outs and make logical decisions to create a fully autonomous robot!
In addition to controlling your robot from external hardware and programming some decisions for pattern playback within the sequencer, you can also add any of the 100’s of FlowStone modules to create something even more elaborate. For example, you could add a webcam module and some motion or colour detection to give your robot vision, or add speech synthesis or audio playback to give it a voice. The possibilities with FlowBotics Studio are truly endless!
Full Custom Programming
For most people, the ‘User Programming’ area will be more than enough to enhance their robot to be all it can be, but for others, they might consider making a totally new robot using the Servo Erector Set parts. After all, this is a kit of over 500 parts and isn’t limited to just the five stock robot configurations!
For example, you could have a hexapod robot with a robot arm on top of its body, or something total new and innovative. For this, you would need to make your own program with your design mirrored in the FlowStone code. To cater for every eventuality and make FlowBotics Studio future proof, you can create your own projects in FlowStone from scratch from inside FlowBotics Studio. To do this: from the FlowBotics Studio main window click the ‘+’ sign to create an empty project. This is exactly what it says: a totally blank sheet for you to create your FlowStone code. You can of course copy and paste between projects too, so you can re-use parts from other projects and in fact re-use entire projects if you like. Here’s an example of the Hexapod and arm projects added together:
Conclusion
So, from what we have shown you here today, you can see that Flowbotics Studio is far more powerful and open than a fixed robotic application, and is ideal for education, learning computer science or just playing with Robotics. For most people, using the FlowStone ‘User Programming’ area will be plenty to keep them inspired for the foreseeable future and, for those that want to create something entirely new, there is the full FlowStone programming language underneath to liberate your inventions.
Links: