Friday, March 22, 2013

Visual Programming for the Gizduino Mobot Set

Some time after the release of the e-Gizmo Mobile Robot, there was a peculiar software that was discovered (through an informant) which was almost immediately configured for use with the e-Gizmo Mobot. The software, a third-party program called ‘Babuino’, is a program that introduces a simplified and graphical method of mobot programming (a GUI).

What is simply astounding about the Babuino mobot programming software is its introduction of a very easy and intuitive method of creating a body of code or instruction for a mobot. This easy and intuitive method, called ‘Block-Oriented Programming’ involves the use of graphics (blocks) to assemble a body of code (similar to the programming platform of the LEGO Mindstorms product). With that, perhaps even a 10-year old avid hobbyist of robotics could understand and successfully utilize the program to create a variety of actions for his or her mobot.

Primarily, the Babuino software makes it possible for mobot enthusiasts to immediately start creating their desired mobot program codes without the need to first learn a considerable amount of information regarding conventional programming languages such as ‘C’ or ‘C++’. Although this may seem to encourage laziness in learning the proper coding (as it is always better to learn the proper programming languages), the software offers its users a grasp of the concepts of logic flow in robotic programming and how different functions and operations work in different positions within a body of code.

That is enough for introductions. Now we move on to how we incorporate the Babuino software into the Gizduino of the e-Gizmo Mobot!

————————————————————————————————————————————————–

Obtaining Files

There are actually two installations to complete. The first is the installation of the Babuino into the Gizduino. The second would be the program providing the ‘Block-Oriented Programming’ environment, this software is called ‘Blocos’ and goes hand-in-hand with the Babuino platform.

Begin by downloading all the necessary files. The programs are all freely downloadable, and can be obtained from these links:

Babuino Platformhttp://tech.groups.yahoo.com/group/babuinoproject/

Blocos Softwarehttp://sourceforge.net/projects/br-gogo/files/

Now you will notice that the download page for the Babuino Platform is a Yahoo! Groups webpage. For this you will have to log-in and join to access the ‘Files’ section of the groups. Once there, the figure of the ‘Files’ page will show the files you need to download. Make sure to get the ‘Command Reference’ file – it is a complete manual for using Blocos on Babuino. Next, click on ‘Firmware’. Look for the latest ‘.hex’ file in this page and save it through the save file command found after right-clicking on it. It is this file that will be uploaded to the Gizduino.

In the Blocos download page, you will see many different files available for download. Download the ‘Br_Gogo_python.exe’ file, then any of the files with the label ‘r141’. However, we recommend that you download the ‘r141.tar.gz’ as it is compatible with more compression/decompression programs such as WinZip, WinRAR, and the default windows ZIP program.

 ————————————————————————————————————————————————–

Uploading Babuino Platform

To upload the the Babuino Platform into your Gizduino module, use the Arduino Uploader program to upload the latest ‘.hex’ file you downloaded from the Babuino Yahoo! Groups webpage.

For a more elaborate guide, go to this webpage: http://babuinoproject.blogspot.com/2009/09/how-to-upload-babuino-software-to-your.html 

 ————————————————————————————————————————————————–

Blocos Installation

Windows:

For users of the Windows operating system, after you have acquired all the necessary files, open the ‘Br_Gogo_python.exe’ to run the Python installation process (this is needed since the Blocos software is written in Python). Run the executable file as an administrator to avoid the computer from blocking the installation, and after having done this, the installation process should start.

The complete process will present a number of sub-installations, and all of these sub-installations are required. To put simply, just keep saying yes to all the occurring installation prompts that will appear throughout the main installation. There is the chance that you might be notified of missing files. If this occurs, and the entire software does not work, you can search for possible solutions or post questions at the Blocos forums (http://groups.google.com/group/br-gogo).

Linux:

To install the Python in Linux, open a terminal window and enter the command ‘apt-get update’. At the next prompt, type in ‘apt-get install python2.5 python-cairo python-gtk2 python-kiwi python-serial’, bear the time taken for it to process and in no time will Python be successfully installed.

Macintosh:

In the case of a Macintosh computer installation, installation using ‘Macports’ would be best, Macports ensures that the installation does not interfere with any system software. The MacPorts user’s guide can be found at http://guide.macports.org/. Following the directions, install the following in this order: python-cairo, python-gtk2, python-kiwi, and python-serial.

After the Python installation is complete, you may now unzip the ‘r141.tar.gz’ file to a desired and hopefully new folder. The executable file that opens the Blocos program is the file named ‘Blocos.py’.

(The above instructions are summarized from the original guide at http://www.instructables.com/id/Cheap-Easy-Robotics-for-the-Non-Programmer/step3/Creating-your-own-Babuino/)

 ————————————————————————————————————————————————–

Mobot Configurations

Once you have been acquainted with the Blocos software (with the help of the ‘Command Reference’ file which you should have downloaded), especially with the ‘Control’, ‘Flow’, and ‘Condition’ command categories, you can now use the software to program your e-Gizmo Mobot.

In the first place, you will need a switch that turns the mobot on and off. We suggest the tact switch type for this purpose, but you are free to choose any other switch that is to your desire (although a tact switch would ideally suffice). Attach the tact switch to the following digital I/O pins found on your Gizduino attached to your mobot: ‘GND’ and ‘12’.

The ‘On’ block from the ‘Control’ commands category simply denotes the code that turns on the mobot motors. For our case, the e-Gizmo Mobot only takes on the letters ‘a’ and ‘b’ of the ‘On’ block command, these correspond to the two motors of the mobot.

Of course, you might want to utilize the mobot sensors as switches to some action. For example, you might program your mobot to stop when a collision sensor activates, thus the sensor is a switch to the mobot’s ‘stop’ command. Here is a sample code of the example: 






The code above commands the mobot to continuously (loop) have its motors activated until the ‘Switch 1’ condition is met. ‘Switch 1’ is the condition that is concerned about the state of the sensor associated with ‘Switch 1’, which should be a collision sensor. The ‘loop’ command ensures that if the sensor is not activated, then the mobot will again continue to move.

If you select the ‘Switch’ block command (green-colored oblong thingy), you will notice that a list of numbered switches at the right-hand side of the Blocos program window will appear. These switches refer to sensors available on your mobot. However, for the e-Gizmo Mobot, these switches are directly connected the first four analog I/Os. Thus there are only four available switches one can use for this case, and to access the sensors on the mobot, you have to connect jumpers from the digital I/Os that handle the sensors to only the first four analog I/Os.




For our current example, to set the front (middle) collision sensor to the ‘switch 1’, you must attach a jumper wire from the digital I/O pin number 3 to the analog I/O pin number 0. The same applies for other sensors attach to any of the four analog I/Os.

Jumper at Digital I/O 3
Jumnper at Analog I/O A0
If you have correctly done the above, and assuming you tried the example on your own, then your mobot should continue to rotate its wheels until an object (such as your hand) interrupts the very front IR collision sensor. So long as an object interrupts the collision sensor, the wheels should stop turning and continue again once the interrupting object has been removed.

 ————————————————————————————————————————————————–

Comments

Actually, there is a peculiar thing that happens wherein the motors would turn on only when the collision sensor is activated (the example code above has been configured so that this does not happen for the front collision sensor). The cause for this, if it happens, is from the logic flow of the conditional statement ‘If – then’, and the activation type of the sensor in question. Under an ‘If-then’ conditional block there are two possible outcomes that depend on the state of the condition, which in our case is the state of the ‘Switch 1’. The left outcome occurs under the condition that ‘Switch 1’ is inactive, while the right outcome occurs under the condition that the switch is activated. 

For collision sensors, you will know that it is detecting an object when its corresponding indicator LED emits light, which sets the ‘Switch 1’ active. As such, to have the mobot stop when the collision sensor detects something, the command to turn off its motors goes to the right-hand side of the two outcomes of the ‘If-then’ conditional block, and to have your mobot continue moving when detection stops, the ‘On-ab’ block command goes to the left-hand side of the ‘If-then’ block. 

Front Collision Sensor Activated
 If it is in your desire to use one of the line sensors instead of a collision sensor to make your mobot stop upon detection – or some other desired action for that matter, then the two outcomes of the ‘If-then’ conditional block must be reversed. This is because (as is readily observable) the activation of a line sensor operates oppositely to that of a collision sensor. Its corresponding indicator LED is active whenever the line sensor is uninterrupted and is inactive when detection occurs.

Line Sensor Activated (unlit LED)

No comments:

Post a Comment