Dusting off the cobwebs

Recently I got back to doing some work on the Ice Breaker Lenin. I started this project before the robots were even a thought but since then Lenin was put aside. So in the last week I applied a coat of resin on all the interior walls mostly for waterproofing. I installed the outer two screw shafts as I only had the central one mounted. I made the rudder blank using PCB fiberglass sheeting that was laminated (3 in total) with a tube which is used as the guide for the shaft. This blank was cut out to the proper shape and fitted to make sure it works properly. I also installed what is now the main deck. This was done so that the edges where the deck and hull meet could be filled in and properly sanded and leveled out. Once the glue holding the deck cures say after 48 hours I will finish the edges off and prep for the ruder followed by paint. That should be it for the hull.

Bipeds old electronics writeup

Since I’ve recently made some major changes to the robot I need to update the information about it. I don’t want to loose the previous work that is on the robots page so I am saving it in this blog.


The electronics will comprised of a network of RaspberryPi single board computers connected to a ethernet switch. One of the computers will have a gyro board connected to it through a USB port. The board is a Razor 9 DOF (degrees if freedom) gyro board from Sparkfun. Also connected to the switch will be two ethernet shields that interface with two Arduino Mega microcontroller cards.  Both of the Arduino Mega microcontrollers will interface with the robots hardware through a Controller Interface Card. This interface card will connects to a Signal Distribution Card that connects to all of the Motor Driver Controller cards and Feedback Sensors. Power to all the cards and muscles of the robot will be supplied through a Power Distribution Card. The human computer interface will be established through a USB mouse and keyboard with HDMI video to the RaspberryPi or through an ethernet connection to an external computer.

Electronics: RaspberryPi

The RaspberryPi is a single board computer measuring 85.0 x 56.0 mm. The board is made by the Raspberry Pi Foundation and it’s an inexpensive (about $35US) board designed to encourage young people to take up computer science. The RaspberryPi uses a 700 MHz CPU manufactured by Broadcom BCM2835. It has an internal memory of 256MiB SDRAM, two USB-2 ports, HDMI for video, SD card reader, 10/100 Ethernet, and it is powered through a micro USB 5VDC port. There are more powerful single board computers on the market, but I am interested in working with RaspberryPi in order to explore its possibilities and/or limitations.

Electronics: Gyro 9 DOF Razor

The Razor is built on a 28 x 41mm circuit board by Sparkfun Electronics. The board houses 3 sensors which give it nine degrees of inertial measurement. The 3 sensors are the ITG-3200 (triple-axis gyro), ADXL345 (triple-axis accelerometer), and HMC5883L (triple-axis magnetometer). The data from these sensors is processed by an on board microcontroller, an 800 MHz ATmega328. The output is a serial RS232 stream that is connected to a FTDI FT232RL USB and to a serial IC that allows the data to be sent via USB. External power to the board which can be anything from 3.5VDC to 16VDC is regulated and set internally to 3.3VDC.

Electronics: Arduino Mega 2560 and Arduino Ethernet Shield

The hardware/software interface is an Arduino Mega. The Mega uses an ATmega2560 microcontroller running at 16 MHz clock speed. It had 54 I/O pins, 15 of those pins are PWM digital I/O pins and 16 are analog input pins. Out of all the Arduino cards the Mega has the most number of pins that can be configured to the needs of the robot. The Arduino also uses open software as there is a large online community that can help with software/hardware oriented problems. At the moment each PWM pin, feedback pin and enable pin of the MDCC card connects to specific digital PWM enabled pins, Analog pins, and Digital pins respectfully on one of the Mega cards. In the future these pins will possibly be reconfigured to run through a multiplexer to increase the number of I/O ports and still run with only 2 to 3 Mega cards. The Mega will be interfaced through an Ethernet shield to increase the baud rate between the Mega and the RaspberryPi computers. The Mega cards will be connected to a Ethernet switch alongside the RaspberryPi computers.

Electronics: Controller Interface Card (CIC)

The Control Interface Card allows the Arduino Mega microcontroller to be safely secured to the structure of the robot while electrically connecting all ports of the microcontroller to the card. The CIC supplies power to the microcontrollers and through a series of 2X10 serial data ports connects the digital and analog pins of the microcontroller to the Signal Distribution card.

Electronics: Signal Distribution Card (SDC)

The Signal Distribution Card distributes power to all MDCC and feedback sensors downstream of the card. The SDC interfaces with the CIC through a series of 2X10serial sockets and with the individual MDCC through 2X6 serial sockets. It receives power through a 4 pin power socket that is connected to the PDC.The data lines from the 2X6 sockets to the 2X10 sockets are separated into groups of uplink analog lines, downlink digital lines, and downlink digital PWM lines. The grounds and 5VDC lines are also grouped together at this point.

Electronics: Motor Driver Control Card (MDCC)

The motor driver card is a home built driver that takes a PWM signal (pulse width modulated), an enable/disable signal, and returns 0-5VDC as feedback. It is also powered by 2 power sources: 5VDC to run the circuits and 24VDCwhich is fuse protected with a fast blow 3A fuse to power the motor. These voltage lines have red LED indicators showing if power is coming in. The PWM signal is fed through a NOT gate to separate it into two signals that are opposite to each other. The two signals are then sent to two AND gates where the second input of both AND gates are joined together and controlled by the output of a voltage comparator. The output of the AND gate then feeds two sides of the bridge driver and green LEDs that are used for easy diagnostic of the signal indicating if a signal is coming its intensity. The bridge driver is a dual L298HN Full Bride Driver that is used to control the direction and speed of a single motor. The two channels of the driver are connected together to increase the power output to 4A max. The enable/disable channel turns the driver IC ON/OFF this too has a green LED indicator for easy diagnostics. The ground of the bridge driver IC has a current sensing resistor added between it and the ground. This resistor gives a voltage which is proportional to the current that the IC is outputting to the motor. The voltage is sent to the negative side of a voltage comparator and is compared with a pre-set voltage on the positive side of the comparator. The voltage comparator is part of a current chopping circuit that is used to control how much current the motor receives. When the current through the driver IC increases it increases the voltage that is sent to the voltage comparator. The voltage comparator works by comparing a preset voltage level on the positive side to an input voltage level on the negative side of the comparator. If the negative side of the comparator is less than the positive the comparators output is high or 5V. When the negative side of the comparator becomes equal to the positive side it switches the output of the comparator off or 0V. At the point when the voltage comparator shuts off the output it in turn shuts off the output of the AND gates and stops the PWM signal from reaching the driver IC. The 0-5VDC feedback voltage is a value that is produced by the positioning sensor built into the joints. This value is then used by the computer to calculate where each joint is located and allows the computer to make decisions on how to move the joints.

Electronics: Power Distribution Card (PDC)

The Power Distribution Card receives its power from an external supply that is running 30VDC at 30A. On the card the voltages to the muscles are separated and passed through a slow blow 3.5A fuse. There is also a LED indicator downstream of the fuse giving it a quick visual reference. If all is working then the LED is ON and voltage is sent to the MDCC. The PDC also supplies power to all the cards and sensors. The voltage supplied is a regulated 5VDC.

Rethinking biped electronics

After being away from the robot for a few months I started rethinking what it was that I really wanted from this project. I was having hardware issues on the cluster and I had a few other minor irritations. So I decided to adopt a bit of the KISS method as I was not working on the software the way I wanted. The cluster of computers has been removed and will stay as its own project till it’s fully functional. The networked stereo vision has been removed as well. Just like the cluster this will stay on it’s own, at least for now.

The replacements that have been added to the robot are a single board computer with a J1900 Celeron processor running a full Ubuntu 14.04.02 operating system and 2 PS3 Eye USB cameras.

On the software side I decided to scrap what I had for the communications protocol and the GUI that supported it. I am now in the process of getting ROS (robot operating system) setup to communicate with 2 of the Arduino Mega boards.

Issue Resolved

With a little help from my friends, well one friend. The dual router issue has been resolved and as expected it was something simple. Turns out it was an addressing issue in the Raspi’s. When setting up the static IP on the Raspberrypi the gateway address was set incorrectly, it should be the address of the router. Since I don’t know to much about setting up networks and the ins and outs of static IPs this simple mistake was missed though a lesson was learned.

More about the network

Yesterday I had a chance to work on the robot. I was able to reset the router using the 30-30-30 hard reset which didn’t work for me when I tried it in June. After the router reset I reconfigured the Raspis for the time being so that I can continue working on the software. Changes to the Raspi settings allows me easier access to the internet for software downloads amongst other things but disabled the cluster temporarily.  At the moment I don’t need the cluster and having proper internet access will allow me to work on increasing the communication speed between the microcontroller and raspi computer, and finding a suitable solution for the cluster.

Things are going slow.

I haven’t had much time to work on the robot in the last few months. I barely managed to set up the network so that I can connect the Raspis to the internet through two routers. After the initial setup I made a mistake somewhere with the Linksys router settings while changing it to a repeater bridge and now I can’t access the setup page or do a hard 30-30-30 reboot.It will be a sometime again before I can try and resolve the issue.

Its alive!

So currently I have the cluster of 10 Raspberrypi’s,  a netowrked of 2 additional raspberrypi’s for stereo vision (currently not seeing anything) and 2 Arduino Mega’s for hardware control with a RAZOR 9DOF gyro. I transferred all the python code to the master Raspi and uploaded the IO boards (The Arduino’s) with the last working version of its code. I had to make some changes to the python code as it was originally written in python running on windows. Once everything was completed I fired it up and no issues. Well there were some minor mistakes that were easily fixed. Now I have the master talking to the left and right IO board. I am now reconnecting each motor and running it manually to make sure the feedback is working properly and the motor is not running away after it receives a command.

Next big thing is to write a script that will automatically start communications with both the IO boards, turn on the relays and allow me to manipulate the higher level commands.

The commands to the motors will come from two sources. There will be the voluntary commands, ie stand on left foot, walk forward…, these commands will come from the Raspi or operator. Than there will be the involuntary commands which will be responsible for balancing the robot while it stands and as it moves. The involuntary commands will be generated within the IO boards, they will be based on information received from the gyro and foot sensors. The involuntary commands will be mixed with the voluntary commands which should result in movements of the robot.

That’s all I got for now.

Back to software

Now that just about everything is wired in I can start looking at software again. I’ve been procrastinating on the software side for to long.

So on that note I have updated and upgraded the software on the master raspberry pi. I uploaded all the files that I had saved on my regular computer to the raspberry and even managed to get a test line running between the Arduino and the Raspi.

Next step is to get the original code working between the two Arduinos and Raspberry.


Tweaking the lower back

After assembling the lower back with the new configuration I noticed that when the rams were fully extended the angle between the joints was very small and this allowed for the upper body to move without actuating the rams. The fix was easy as all that needed to be done was to relocate one of the hinging points further out which increased the minimum angle.