Friday, July 28, 2006

Time Drags

Things seem to have slowed down a little as we come to the end of our PCB design. (See previous post for a break down). There are a few little niggly things that need to be sorted and then hopefully all will be ready for manufacture. We are having a couple of issues with the footprints as some need to be manually designed on the computer and this means we have to find the supporting documentation that will allow us to get it right. But as I said we are nearly there.

From here we are beginning to look at the software side of things and this is a lot more interesting as far as I am concerned. There are three processors on the mother board and another on the daughterboard that need to be programmed and a lot of the code will be... how to explain?
Lets say you want to play a game of Cluedo. You get out the board, pick who plays which character, sort the cards and pick out the murder pack, shuffle, deal, and finally begin the game. Programming a proccessor is similar in that you have to organise the program before it can begin doing it's thing. There are a lot of ones and zeros which must be used to turn on certain functions and set operating parameters. It can be hard, but only if you don't know what to look for and this side of things comes with experience. The manufacturers supply pretty detailed instructions anyway :-)

So the next chapter in the saga is a move from hardware to software, but the going doesn't get any easier. More later.

Friday, July 21, 2006

Green Square thing with Shiny bits

Yeah, in geek speak it's a PCB which stands for Printed Circuit Board. It's the green board you see when you open up your tv or computer. We have to make a few to get Libramentum up and running, and they have to be done by Tuesday. Let me take you through the process.

When we choose the components we want, like which processors and which accelerometers, they come with a data sheet that detail everything you need to know to get the thing running and how to extract the information. It'll tell you things like the maximum and minimum voltage levels, maximum current draw and where to put all the little resistors and capacitors that you see around a microchip. With this information we can get to work and start making electrical schematics to show how the electrons are going to make it from chip to chip. Schematics: Completed.

We're now coming to the end of the hard part. This is where we look up every single individual component and order it, as well as recording the details of the size and shape so that we know where to put the holes and the solder pads on the PCB. We save this information against each component on the schematic. It's not hard - until you can't find a source for the part you want, or the dimensions are not already in the library of 'footprints' and we have to make them up ourselves. This won't make any sense to anyone who isn't into this sort of geeky stuff, but I'll come back later and load some pictures to show you what I mean.
Once we have a footprint loaded against each component on the scematic we can run a program which places each footprint on a digital PCB. Then we can simply click and drag to get them all fitting on the outline and try to place them so that the solder tracks won't have to cross each other. From there we can run the "Auto-route" and the computer will try to connect all the pins up itself. If there are contentions, then that's for us to sort out and that's the hard part. My lab partner and I have been working on these PCBs for several weeks now and we're starting to get really sick of it!

Okay, here's a breakdown with images of the design process. I'll use images from the power supply so as not to compromise our intellectual copyright (as it were).

This is the basic outline of what we want to achieve. See how we have seperated the motor supply from the proccessors. This is because the motors can introduce noise which is in the form of voltage and current spikes. These spikes can seriously damage the more delicate processors. Next we need to take these components - the voltage regulators and the charging micro chips and turn our design concept into a schematic diagram.

The two big yellow components are the charging micro chips. You can see they have a lot of inputs and outputs to make sure they won't blow up the batteries. There are two lots of two batteries, one set each charged seperately. Then on the right are some small yellow voltage regulators for 3.2V and 5V. The 6V system for the motors didn't need to be regualted in the end. So now all those little resistors and capacitors, inductors, diodes and microchips need to be 'placed' on an electrical design of the PCB, here's an image of what a 'footprint' for a microchip might look like;
This particular footprint is designed for a 'quad flat package' micro chip which has 32 pins. The green rectangles will become solder pads on the PCB and the red lines are just guide marks. This particular chip is only a few milimetres across so you can imagine how tiny those solder pads are, and the hassle it would be if we got our dimensions even a little bit out!

So now you can see what I have been talking about when I say we had to find or design the correct footprint for every single component on the shematic. The computer will transfer those footprints onto the digital PCB and try to put lines that represent solder tracks between all the pins, but it can get very complicated and in the end we
had to opt for double sided boards. This means we can have solder tracks crossing each other by travelling onto the other side of the PCB first. It is much more complicated to manufacture a double sided board and in the end we may even have to go to a company who will do it for us. Here's a glimpse at what the finished design for the power supply PCB will look like:
It doesn't make much sense does it? Well in the end it doesn't have to. This very image will be printed out onto basic transparent OHP plastic and placed on top of the blankboard. The board has a layer of conductive material across it. During the manufcturing process the board is bombarded with UV light except for the areas where the ink from the printed desgn halts the light. Then the plastic design is removed and the board is placed in an acid bath. The weakened metal will be eaten away and the protected metal remains, and there you have your tracks and pads, ready for soldering. Easy!

Hopefully the finished product will look something like this design:

Thursday, July 20, 2006


Libramentum can be split into three basic hardware systems. Build, sensors and peripherals, and proccessing.

The physical build of our robot was designed by a german engineering exchange student. Though my lab partner and I had decided we wanted two motors driving the ball at ninety degrees to each other - similar to a mouse ball - our engineering student redesigned Libramentum to have three rollers at 120 degrees to each other.
With two rollers (90 degrees) there would always be a particular direction at which one of the rollers was doing no work, and in fact the friction of the ball rubbing across the unused roller would seriously distort our balancing calculations. The three-roller design (120 degrees) solved the problem by requiring all rollers to be driving the ball at all times. Therefore even though there would still be friction involved, it would be a more constant variable and easier to compensate for in the calculations.
Libramentum is not a large robot. There are pictures of other balancing robots on the net, and some of them are even as tall as a person! But Libramentum will be able to be placed on a table and should stand (once built) about 200-300mm high. The diametre of the ball is only 100mm! Most of the robot will be machined from aluminium with some parts being left in their 'rapid-prototyping' states. Rapid prototyping is a big 3-D printer. You can make a design on computer and the printer will construct it out of special powder and glues for you to see and test the design before making it out of a more expensive material.

The sensors will be placed at various points on the robot to assess where it is and what attitude it is in. To do this we need to be able to calculate Libramentum's angle of tilt to earth (attitude) and its position relative to other objects, or to its start point. Attitude is calculated using a small piezo-gyroscope and an accelerometer. The gyroscope uses oscillating vibrations to detect its movement relative to where it started, and an accelerometer detects the rate at which it is moving relative to gravitational pull. Because the robot can fall over the ball in any of 360 degrees, we need to have two sensing systems (two each of the acceleromter and gyro) each at ninety degrees to each other. Each set gives us accurate fall rates in each direction (the X and Y directions) and we can combine the two rates to calculate the real direction of fall - which will be a combination of the X and Y vectors.
The 'station-keeping' sensor is simply an optical sensor taken straight out of an optical mouse. It is mounted over the ball and takes pictures of the surface of the ball. The sensor then compares two pictures and works out how far the ball has moved in both X and Y directions then feeds that information back to the proccessors. This isn't much help when the robot is standing still trying to balance, but when it will be moving from place to place it will be using its own momentum as an aid to balancing and at that point the optical sensor will be able to tell us how fast Libramentum is travelling across the floor or the desk.

As well as the sensors are the motors and these will be controlled by the processors based on the information from the sensors. Each motor will be controlled individually - forward or backward - at a variable speed to get Libramentum upright again. The motors are situated near the top of the ball and belts run down the arms to the rollers which are postioned just under the equator. The arms provide the double purpose of holding the robot on top of the ball, and also providing the rollers to drive it.

The third part of the hardware is the electronics and processing. This is made up of two electronic printed circuit boards similar to what you would find in a computer, and a power supply board. The power supply is a rechargeable battery system which can provide the current and voltage for all the electronics and also a seperate and more powerful supply for the motors. The motors can draw a lot of current and they also introduce a lot of electrical noise which can fry an electronic chip. We don't want that! So it is important to keep them seperate.
The two proccessing boards are the motherboard and the daughterboard. The motherboard takes care of the sensors and peripherals. It receives the inputs from one gyro/accelerometer pair and combines it, recieves inputs from the other pair and combines it, then it sends these values to the daughterboard.
The daughterboard takes these rates of movement from the X and Y axis, and calculates in which direction the robot is falling over the ball and at what speed. Then it calculates which motors need to be driven in which direction and at what speed in order to get the robot back up on top of the ball again. It sends these values back to the motherboard which ensures the motors are provided with the correct voltages to do what they have to. The proccess repeats, and should catch the robot beginning to fall before it gets very far from top and centre.
Added to this the motherboard will read inputs from the optical sensor and send these to the daughterboard. The daughter board will assess if the ball has to be moved in a particular direction and command the mothorboard to move the motors as required.

You can see there are a lot of very high speed calculations that need to be done. The motherboard has three large proccessors designed to handle the sensor inputs and motor outputs, and the daughterboard has an even larger proccessor to handle all the calculations. The idea for us is to get Libramentum balancing. We will design the robot so that different types of daughterboards can be interchanged. This means other students can try their hands at writing code that will be more efficient and more able to balance Libramentum and in the future - command her to move in a particular direction via radio control or even bluetooth. Our supervisor even wants to use an FPGA daughterboard which is a revolutionary type of electronic processor which will quite literally be able to program itself into balancing the robot.

But we have to get there first :-)


I'm starting this blog about 5 months into the project, and there are only 5 months left to go, but let me tell you about the robot I am making.

Name: Libramentum
Purpose: To balance on a ball, and use that ball as a 'wheel' for maneuvering
Design Conecept: Libramentum is being designed to provide a 'proccessor intensive' platform from which other students can design proccessing systems that will be more and more efficient at stabilising and driving the robot.

But what does this all mean?
Take a robot like R2D2. He's pretty cool right? He's solid and stable and he's not about to fall over just sitting there. But what happens when he does fall over? Now he's lying on his side and there is no way to get back onto his wheels again. What we are designing is a robot that is built onto a ball and it needs a comprehensive system to ensure that it doesn't fall over even when it's just standing still! The idea is similar to a Segway - but with an extra plane of freedom, and the robot will use a combination of accelerometers and gyroscopes along with steady drive motors and some heavy duty proccessing in order to remain upright.
The end result is a machine that will actually fight back when gravity tries to pull it to the ground - or when someone tries to knock it over. From there, the instructions required to drive Libramentum in a particular direction are calculated into the balancing routine.It sounds tricky, and it is. There are two of us working hard to get it built and running as well as our supervisor and another engineering student who has designed the build of the robot itself. And his supervisor. And an outside source for power supplies who helped us design a lightweight, high capacity rechargeable battery system similar to what you'd find in your mobile phone. So what have we done so far? I'll get you up to speed in the next installment but until then - watch this space!