Categoryengineering

Running Selenium Webdriver on Bash for Windows

Bash for Windows has been working pretty great for me until I needed to run Selenium Webdriveron it. I quickly learned that it wouldn’t work just work right out of the box, and the set up for it is quite convoluted.

You will need

Bash setup

Install Firefox:

sudo apt-get install firefox

Export DISPLAY variable in ~/.bashrc. Just add this to the ~/.bashrc:

export DISPLAY=:0

Xming setup

Just download it from the link above and run it.

Download geckodriver

Download geckodriver from the link above and put in the /usr/bin/ folder in Bash for Windows.

Running Selenium

Here is a piece of sample Python code I used to setup the web browser. It will setup the browser, open Google, sit there for 10 second and then quit.

import time

from selenium import webdriver
from selenium.webdriver import DesiredCapabilities

def execute_with_retry(method, max_attempts):
    e = None
    for i in range(0, max_attempts):
        try:
            return method()
        except Exception as e:
            print(e)
            time.sleep(1)
    if e is not None:
        raise e

capabilities = DesiredCapabilities.FIREFOX
capabilities["marionette"] = True
firefox_bin = "/usr/bin/firefox"
browser = execute_with_retry(lambda: webdriver.Firefox(
    firefox_binary=firefox_bin, capabilities=capabilities), 10)

browser.get("https://www.google.com")

time.sleep(10)

browser.close()

Should you be an engineer?

It’s not easy to decide what career path to take.  Especially for high school students, who don’t yet know what they want to do.  During my time in university, I spent a bit of time in engineering outreach to speak to high school students and first-year university students about studying engineering.

A few days ago, I had the opportunity to go back to my old high school and present to students about studying engineering (link to presentation below), and to help guide them with their career choices.  The idea was to communicate:

  • What engineering is as a profession
  • What engineering is about
  • That they should consider it as a career

At the same time, it wasn’t meant to “persuade” them to study engineering, but more like show them what it’s about so that they can make a more informed decision when they choose their university majors.  I also wanted to tell them this as general advice:

  • Do what you’re interested in
  • Nothing worth doing is ever easy
  • Don’t do it just for the money

Overall, the students seemed to be receptive to what I had to say, and had good questions to ask me about my experiences.  Hopefully, I helped guide them to make a career choice for themselves!

Link to the presentation: here

RoboCup 2013 in Eindhoven

After a year of hard work redesigning our soccer robots, it was time to take them to the real competition.  Last year, the team went to Mexico City, but this year, we went to Eindhoven, Netherlands to compete. The event was so well known, that even the queen of the Netherlands paid a visit to the competition!

We had spent a whole year upgrading everything.  I designed a new ball kicking system that was more durable, more maintenance free, and more powerful than the year before.  The other mechanical systems were more robust as well.  The electrical system also had a huge upgrade.  Burning and smoking electrical boards were a thing of the past!  We have never had a design this robust – ever!

What is RoboCup?

For those who don’t know what RoboCup is, RoboCup is an international robotics competition aimed to further robotics research.  Their long-term goal is to have robots beat the World Cup Soccer team winners by 2050. There are various leagues within RoboCup, such as in robotic soccer (where we participate), home care, rescue, simulation, etc.  Our team, the UBC Thunderbots, compete in the small-size soccer league, which is probably has the fastest game play of all the different leagues.  The robots are generally cylinders with a diameter of about 18 cm and a height of 15 cm.  They can move at around 4 m/s and kick a golf ball at 8 m/s.

One of the other leagues, the Standard Platform League competes with standardized robots for all teams and the key difference between each is the software that is written for the robots.

Another league, the mid-size league in RoboCup Soccer competes with robots that are about a 1/3 of the size of a person. The game isn’t as quick as the small-size league game and they play with a real soccer ball instead of a golf ball. During the competition, it gathered quite the crowd too.

Preparing for the Games

Most teams arrived at the venue when it opened to get to work right away. Everybody wanted their robots in tip-top shape. Our team did the same. Even though our robots were ready mechanically and electrically, the key game changer was seeing which team had better artificial intelligence for their robots. Whenever got time to test on the field, we took advantage of it to make sure our AI was working well too.

Round Robin

In the round robin stage, each team gets four games against other teams in their bracket. Each bracket is made up of five teams and the skill level is spread out based on the rankings of the previous year.

We lost our first two games against a team called KIKS from the Toyota National College of Technology in Japan, and a team called STOx’s from the Universidad Santo Tomás in Colombia. In both of those games, we were simply outplayed because the other team had better software than we did. At the end of the game against the Japanese team, I spoke a bit of my horrible Japanese to them and they were super surprised and impressed that I knew a bit of Japanese!

Because our robots were finished not long before the competition began, the software team did not get a chance to test the code that was written, and so we found out the problems during the competition. Our robots were never able to drive up to a ball and take possession of it. The robots somehow always missed the ball. When the robot had the ball, it didn’t know what to do with it. It sat there holding onto the ball doing nothing. This was so frustrating for our team and even more so for the software team who wished they had more time to test.

We won our next two games against two lower tier teams. One is called RoboFEI, from the Centro Universitário da FEI in Brazil, and a team called RFC Cambridge from Harvard and MIT. It’s nice to be able to say that we beat a team from these two ivy league schools. Looks good when we look for sponsors too!

Lucky Loser Round

Because we had a 2-2 record during the group stage, we played a fifth game, the so-called Lucky Loser Round, to see if we could qualify for the quarter finals. Our match up was against a team called ODENS from the Osaka Electro-Communication University in Japan.  The game was so close that there was a dispute about the rules and whether what our team did was legitimate. Because our robots were not able to move up to a ball and shoot it at the net during the shootout, the referee introduced a workaround that the other team disputed.

Our referee’s native tongue was Portuguese, we spoke English, and the other team spoke Japanese. I didn’t know enough Japanese to translate. Eventually, members from other teams like the Thai and Chinese team came to help with the dispute. During the discussion that took about an hour, I heard people speak English, Japanese, Portuguese, Thai, Japanese, and Mandarin all at the same time. It seemed like nobody had the full picture of what was happening and how to resolve it.

The dispute was resolved when both teams agreed to a specific workaround that made it possible for our robots to do shootouts.  The game ended with a shootout and we lost on the very last shot of the shootout unfortunately. We almost made it to 8th place.  Still, achieving 9th place out of 22 teams was the best that the team has ever done before.

The Competition Ends

Skuba, from Kasetsart University in Thailand, had won the competition for four years in a row since 2009, but this year they had a surprising finish that was not even the top 4.  The second place team, ZJUNlict from Zhejiang University in China had beat them early in the quarterfinals.  ZJUNlict’s strongest opponent this year was CMDragons, from Carnegie Mellon University in USA.  In the final round, they were tied for the entire game and the game went to shootouts where CMDragons lost by one goal.  ZJUNlict had made first place in the RoboCup 2013 in the Small Size League.

As the competition came to a close, we said goodbye to the people on other teams that we met and as a parting gift from the German team ER-Force, they gave us a German flag with the names of all their team members signed onto it, with the message, “for our amazing friends, the Thunderbots, from team ER-Force”.

I realized now that the competition is over, I probably wouldn’t be going to competitions in the future because I’ve graduated from university. It made me feel a little bit sad that I couldn’t compete anymore, but at least I can still help out the team wherever they need it.

Link to photo album here

RoboCup Workshop in Mannheim

After two weeks of travelling in Europe, the next part of my journey was to participate in the RoboCup competition.  The team that I am part of, the UBC Thunderbots, would be participating in the RoboCup 2013 competition in Eindhoven.  But before that began, we spent a few days in Mannheim play a few games with two of the German teams: ER-Force from the Friedrich-Alexander University in Erlangen and the Mannheim Tigers from the Duale Hochschule of Baden Württemberg.

This gave us a lot of opportunities to find out what was wrong with our robots before the real competition began. We found out that are mechanical and electrical systems were quite robust, while our software system was the weakest link of the three.

In the downtime, we were taken on a tour of the nearby Eichbaum Brewery. The tour was quite difficult to follow because it was pretty much all in German. Even though I had learned some German, it was still quite difficult for me to follow.

I had been to Mannheim before and both times I went to Mannheim before this time, I had a very negative experience. The first time, I got food poisoning (I still remember which restaurant it was), and the second time, my friends and I waited at the Mannheim train station for 4 hours for a train to Berlin with a scheduled departure time of 12am.

Having had lived in Germany before meant I recognized a lot of brands like food chains, department stores, cell phone companies, etc. Because of that, my teammates often asked me different things about Germany such as how German phone plans worked and how to sign up for a plan. I explained it to them and even asked the cashier at the supermarket who didn’t speak English about phone plans.

On another day, we were also taken on a tour to the nearby city of Heidelberg. I had also been here before and vaguely knew my way around. We hiked up to the castle again, but we were there in the evening so the inside of the castle was closed by the time we arrived, so we just went as high as we could.

After spending a few days in Mannheim, all three of the teams organized transportation together to Eindhoven, where the real competition would begin. The workshop allowed us to see what our robots were capable of and what we could improve on early, so that we would be better prepared for the real thing.

Link to photo album here

BMW Museum

I had already been to the Mercedes Benz Museum and the Porsche Museum in Stuttgart, and now I got the chance to go to the BMW Museum.

The museum showcased their history by displaying their past motorcycle, car and aircraft engine designs.

Some of their brands like the BMW 328 still exists today, but there is little resemblance in the historic version of it.

They’ve made so many cars that they have a giant display of all the logos.

One of their concept cars was displayed too. The idea was that each fin on the car could orient itself depending on whether the car wanted to accelerate or decelerate.

Another concept car was the BMW GINA. There isn’t a lot of information about this car. I guess it stayed as a concept car.

The museum also had a bonus exhibit for Rolls Royce, which is one of BMW’s child companies.  Not really a car I’d buy, but it would still be pretty sweet to own one.

The BMW Museum was pretty interesting and I wish I had booked the factory tour ahead of time.  Apparently I was supposed to book the factory tour a few weeks in advance in order to get a spot.  That would have made the visit to the museum even better.

Link to photo album here

Deutsches Museum

From Vimy Ridge, we went back to London for another day and then we parted ways.  Edward flew back to Vancouver while I stayed in Europe for another two and a half weeks.  My next destination was Munich.  Each of our flights were very early in the morning from London Gatwick, so we just went to the airport and slept there for a night.  It wasn’t restful sleep at all.  At least I managed to sleep more on the flight there.  I met up with a friend of mine that I met while taking courses at UBC while he was an exchange student.  I stayed with him for a few days.  The last time I went to Munich, I never got the chance to visit the Deutsches Museum, which was my first destination this time.

The Deutsches Museum is one of the largest museums I’ve been to. There were so many topics on technology that the museum had. They had the usual topics on flight, ship building, engines, etc., but they had even more exhibits on classical mechanics, electromagnetism, chemistry, nuclear physics, mining, semiconductors, computers, cartography, microsystems, space exploration, printing, etc.

There was even a cool demonstration of arc lightning.

The section of space exploration was quite interesting too, but it wasn’t as big as the exhibit at the Smithsonian Museum of Flight.

The clean room exhibit reminded me a little bit of the type of work I did during my internship at Bosch.

Of course in any exhibit on computers, there has to be a computer from Remington Rand.

Here is the experimental apparatus that was used to discover nuclear fission.

The stuff I looked at was only scratching the surface of the museum. I pretty much skipped entire sections like time keeping, wind turbines, bridge building, among other things. I was there for four hours too and I didn’t even look at any one section in a lot of detail. To see everything, one would have to spend days here.

Link to photo album here

Considerations in Buying A 3D Printer

These days, there are so many people who are very excited with the latest developments in 3D printing.  There are so many different options out there for people who want to purchase their own machine.  Having worked with them before, I’ve come up with a list of considerations for buying a 3D printer.

Print Volume

This is the amount volume that the printer is able to print in.  Generally, the measurement is given by the three dimensions of a rectangular prism.  The thing to watch out for here is that just because a printer has a large print volume, it does not mean the printer can reliably print in all of it.  Say the design calls for a thin flat plate.  If the plate is too wide, then the edges of the plate will peel/warp during the print and the flat shape that was intended will be slightly curved.  To visualize what warping is, imagine a flat plate lying on the print bed as it is being printed.  Warping is when the corners of the plate start peeling off the base during a print.  Warping will be explained in a little more detail later on.

Resolution

This describes the accuracy of the nozzle’s positioning.  It is usually measured in microns or inches.  Clearly a smaller value means that the printer will be more accurate in its position.

Layer Thickness

Because the printer works by extruding layers of plastic, thinner layers allow for more fine details.  However, more layers means that the part will take longer to print (all other things being equal).

Print Speed

3D printing is generally a slow process, but a faster print speed could definitely help offset that.

Nozzle Diameter

A small nozzle diameter means that the extruded plastic will be narrow and thus allow for fine details.  It also improves the smoothness of the printed object.

Ease of Removing Parts off the Platform

Because during a print, the base of the part (ideally) should be firmly adhered to the print bed, one must take care when removing the part from the print bed.  In some cases, removing a part requires a little bit of force to pry the part off the print bed.  This application of force may affect the alignment of the print bed relative to the nozzle.  In lower quality printers this can permanently affect the alignment or require frequent re-calibration   Seeing how “rigid” the print bed assembly can help assess how the machine accuracy can be affect during part removal.  For example, if the print bed is mounted on really large support structure, then the affect of misalignment is less of a problem than a machine where the print bed is mounted in a smaller support.

Enclosure

Some printers enclose the part to be printed in a box and some don’t.  The reason an enclosure exists is so that the machine is able to prevent the part being printed from losing too much heat during print.  Loss of heat during a print negatively affects the adhesion of the printed plastic.  Also a larger temperature difference means the part will warp more.  Without an enclosure, heat is able to freely transfer to the ambient.  High quality printers generally have an enclosure.

Variety of Printed Materials

A common material to print with is ABS.  Other materials such as PLA can be printed as well.  The use of the particular material can be quite dependent on the application of the printed part.  The cost of material also differs.  It is worthwhile to determine what material will be printed.  In many cases, ABS should be sufficient.

Warping

This is probably one of the biggest limitations of 3D printing.  Because of the use of heat during print, it is natural for the part to shrink as it cools down.  The problem is that the shrinkage is not uniform.  Some parts of the model shrink more than others and most of the time it is very unpredictable.  While there are some general guidelines that designers can follow to reduce warping, there are definitely some machine features that are good to have to help reduce warping even further.  Because the nature of the way the printer prints is that plastic is extruded layer by layer, the plastic layer at the very bottom is the first to cool down.  Cooling down means shrinkage.  This also means that as the bottom of the model shrinks, the printer is still printing on top of a slightly shrunken part.  Sometimes the shrinkage can be so bad that the part pulls itself off the print bed.  When the part is no longer securely adhered to the print bed, the part may slide around and ruin the entire print.  Warping is the enemy of 3D printing.

Below are some qualities of a machine that help reduce shrinkage:

  • Heated print bed – a heated print bed keeps the plastic hot during the print and does not let the base cool down as much as if there were no heated print bed
  • Enclosure – described above

There are more ways to reduce warping that the designer can do, but that is outside the scope of this article.

Number of Nozzles

A lot of printers just have the one print nozzle, but there are some with multiple.  This allows printing with multiple colours or in some cases printing with a water soluble support material.  Generally, support material has to be manually removed from the printed part, but if the support material is water soluble, this saves a lot of the manual labor involved in cleaning up the model.

Nozzle Maintenance

Through extended use, the nozzle can become quite dirty, that is black gunk starts building up on the surface of the nozzle.  If one is not careful, this can clog the print nozzle.  It is worthwhile to find out how often the nozzle needs to be replaced.  There are also other factors that may result in the need to replace a nozzle.  This is a recurring cost of maintaining the printer.  Some nozzles are cheaper and more common than others and it is worth it to see how often the nozzle needs to be replaced and how much it will cost each time.  Machines may come with extra nozzles.

Lubrication

Over time, moving parts may have to be lubricated.  Printers should come with a maintenance manual to help instruct the user how to do this.  It is also helpful to know the cost of the lubricant and how often it will be required.

Machine Lifetime Cost

Aside from the cost of the machine, operating a 3D printer can also incur the following costs:

  • Shipping
  • Insurance
  • Brokerage fees
  • Tools for removing support material
  • Currency conversion
  • Sales tax
  • Print material (recurring)
  • Replacement nozzles (recurring)
  • Lubricants for moving parts (recurring)

As it can be seen, the extra costs can be quite significant.

Conclusion

Hopefully this has given a good general overview of some of the considerations in buying a 3D printer.  Different people will value different things in the printer and hopefully this subset of possible considerations for buying a 3D printer helps people make a decision as to what to look for in a printer.

Thunderbots Team Retreat in Whistler

Back in September, the Thunderbots team went on a nice team retreat at the UBC Whistler Lodge (it’s been a while since I posted anything on this blog).  After the creation of the new @Home and Simulation teams, the Thunderbots team has grown quite a bit in size.  It was great having so many people there.

Since it was late September, we weren’t expecting any snow.  It wasn’t even cold for that matter.  We all met up on campus in the morning and off we went.  From there, it was about a 2.5 hour drive.  I would have stopped in Squamish to go to Tim Horton’s if I had known to take that exit.  We arrived at the UBC Whistler Lodge at around 11.  The lodge had a pool table and an arcade machine!  They didn’t have Tetris on the arcade machine though.  If they did, that would have been super awesome.

The lobby also featured nice First Nations artwork over top of the fireplace.

We spent about an hour and a bit with presentations from each of the sub teams (mechanical, electrical, and software) so everyone could get a little bit of an orientation about what everyone else was working on on the team.  This was helpful in that each sub team would not be working alone on their components anymore.  This promoted the very important idea of multi-disciplinary teamwork.

After the exploring, we decided to walk around to check out the scenery.

We spent the rest of the day socializing with one another and it helped us all get to know each other a little better.  It’s definitely better to know one’s teammates better in order to help team chemistry.  It definitely helped the team get a lot closer.

People took part in a variety of activities: Big 2, drunken poker, Apples to Apples, just chatting, among other things.  Pretty sure everyone had a good time.

We stayed for a day and a night at the lodge.  Before we left, we took a nice stroll in the Whistler Village. It was nice since there was not a lot of people during the off-season.


On the drive back, we stopped at some viewpoints to appreciate the scenery.


Some of the mountains still even had snow on them!

Once we left Whistler, the drive back became a lot more boring. I guess I was just in a hurry to head home then. I figured that was a long enough break (even though I only had less than a month of school), so I probably should take care of my actual priorities again…

RoboCup Mexico City 2012

Almost immediately after the conclusion of the North American Open, the Thunderbots team flew to Mexico for the next competition.  Everyone woke up super early (in fact so early that the sun hadn’t even come up yet) and arrived at Vancouver International Airport at around 5:40 in the morning.  We flew from Vancouver to Dallas/Forth Worth and then to Mexico City.  Walking through that tunnel to board the plane gave a brief sense of deja vu – it felt exactly the same as the time I flew to Germany.   It was a sudden realization that I would be leaving my home for the next little while and staying in a foreign place.

Flying to Mexico City

When we got to Dallas Airport, we had a stopover of few hours, so we decided to have some Texan steak – or at least as Texan as we tried to get without leaving the airport.  We ended up at TGI Fridays.  It was the first steak that I’ve had in a long time, and I definitely could use another one.  The steak even came with “Jack Daniel’s Sauce”, which made it that much better.

After eating, we met up with two others on the team who had flown from San Jose and Toronto.  After a four hour flight to Dallas, and other few hours of stopover there, we had to fly for another two and a half hours to get to Mexico City.

As my friend said, “it’s like China happened”.  The Benito Juárez International Airport was probably the most disorganized airport I’ve ever seen.  It’s as if every single flight landed at the same time.  The lineup to grow through customs took at least forty-five minutes.  During this whole time, everyone was tired and wanted get their sleep.  A lot of the people on the team hadn’t slept the night before (rather than sleep 2 or 3 hours to wake up early for the flight right?).  While in this lineup, we saw a couple of other RoboCup teams landing as well (Skuba, MRL, among others).  After finally getting through customs and a security check, we got a ride to our hostel via transportation that we organized with the hostel prior to our departure.

Hostel Mundo Joven Catedral

The hostel we stayed had very nice staff that really cared about making its guests feel safe there.  It’s a common feeling among travelers to think that Mexico City is definitely not one of the safer places to travel to.  To combat that, the hostel had its own security guards, security cameras, and they even called legitimate taxi’s for its guests.  They even told us which direction to walk when leaving the hostel to avoid going to the shadier parts of town.  Furthermore, it was situated in the historic center of Mexico City, within walking distance of the Metropolitan Cathedral of the Assumption of Mary of Mexico City and the Plaza de la Constitución.  From some of the rooms at the hostel, there was a nice view of the cathedral.

Work Day

We spent the next day working on the robots to make sure none of the mechanical parts had been affected during the flight from Vancouver.  We had packed all the robots in a regular suitcase with packing foam all around it to protect it.  Looking over the mechanical parts, everything was in order.  The main things we had to fix were tightening screws, adjusting the wiring etc.  The software team had very little to do because they’ve written all the code they could, and just needed robots to test with.  The electrical team on the other hand, toiled tirelessly to troubleshoot all the boards and make sure they were all functioning properly.

RoboCup Begins!

We arrived at the competition venue, the World Trade Center at 8 AM to find a slew of other teams patiently waiting to register.  After probably an hour long wait, we all finally moved in and set up our work places.  When we looked at the field the robots would be playing on, we noticed that the organizers hadn’t yet set up the cameras yet (required for the robots to “see” where they’re going).  This meant that no teams could test.  Teams that were ready could only wait until the organizers got those set up.  Because of this delay, the games had to be delayed as well.  This gave us more time to get the robots ready.  For the next little while, we were the first team to arrive and the last team to leave everyday.  The electrical team needed all the time they could get to finish everything.


Because we had already finished most our maintenance work the day before, there wasn’t a whole lot we could do.  The electrical team had to continue working on their stuff to get as many robots ready as possible.  For the next day and a half, we let the electrical team do their work and we’d help them along the way by replacing parts that were broken (encoders and such).  Otherwise, there wasn’t much we could help with.

Food for the next Week

When we got hungry during the competition, we did a little bit of exploration to find food.  Eventually, all the teams wound up at the same shopping mall for food.  There was a supermarket downstairs to buy water and a food court upstairs with a variety of foods.  We went to this mall pretty much everyday for as long as we were at the World Trade Center.  One day we’d try Mexican food, other days we’d try plain-old hamburgers and other days we’d try even Chinese food (at least the white person’s interpretation of it).  It wasn’t really healthy for us, but we figured it was only for a week.

For dinner, most teams ended up ordering pizza from the nearby Domino’s.  We ate it so much that everybody got sick of having pizza.  Sometimes, we’d have dinner with other teams at our hostel restaurant so we could get to know them a little bit better.  After all, the competition is more about mutual learning and robotics advancement rather than about winning.

Let the Games Begin

Because our team wasn’t that ready to begin with, we had to forfeit our first game against the Immortals from Iran.  By the time we got three robots up and running, we played against the RoboJackets from Georgia Tech.  They only fielded five robots out of the total six.  For most of the game, both teams played pretty evenly, despite their two-robot advantage.  All was going well until one of the opponent’s robots chipped the ball that hit the top of one of our robots, bounced off and rolled into the goal.  In that particular situation, the referee had called an “indirect free kick”, meaning the shot, even if it went in the net, would not count.  But unfortunately, that rule was not applicable because it hit off of another robot.  It was an unlucky goal for us, and we definitely could not score a goal to tie up the game.  We ended up losing one-nil.  For the next few days, we kept complaining about that goal.

In our third game, we played against RoboFEI from Brazil.  There were so many good scoring chances in this game from both our teams that made this game so intense.  Even though we were only watching machines play, everybody cheered them on.  We had four robots on the field this game and they all worked like a charm.  The mechanical system, electrical system, and the artificial intelligence worked so well together.  It was a great feeling for everyone on our team – to see our design work.  After almost a year of hard work, this was it.  We saw our robots move, intercept balls, shoot on the goal, etc.  A lot of the robot shortcomings from the North American Open were also dealt with, such as the problem of the break beam sensors not working, and the robot not moving accurately on the field.  When we scored, we cheered so loud that every single person in the room could hear us (there were probably about 1000 people in that room).  We all got an immense feeling of satisfaction in seeing our working robots score their first goal.  A few minutes later, the other team scored a goal.  It didn’t matter to us, we were still high in the clouds in terms of our mood.  The game ended 1-1.  Despite the tie game, everyone on the team was so happy in seeing our robots work, it didn’t matter what the result was.

This was a great morale boost for the team because for our forth and last game, we played against BRocks from Turkey.  This time, we had our full fleet of robots.  We played our first six on six game.  Yet again, we saw our robots work.  Nothing broke down during the game and everything just worked.  It was quite rare for us to just put our robots on the field and have nothing go wrong.  At one point, our robot shot the ball into the opposing robot and a piece fell off of it.  We knew our design worked when stuff like this happens.  This game was less intense for us than our previous game, but we did end up winning.  That put our record at 1 win, 1 tie, and 2 losses – a total of 4 points.  Unfortunately, this wasn’t enough for us to advance to the next round of the competition and as a result we finished 13th out of 20 teams in the league.  Not so bad for having zero working robots when we got to Mexico.

After the official games, we played a couple friendly games with other teams.  The first game we played was against the Mannheim Tigers.  The game was going well, until we found problems where some of the screws on the robot weren’t tightened sufficiently.  As a result, things well off the robot when we played.  It was quite embarrassing to see.  At least it was only  something minor like putting in a screw, and not something major like a design problem.  In our second friendly game, this time against ER-Force from Erlangen, we found some electrical parts frying randomly on the board, which wasn’t good either.  Out of six working robots, we now had three – still a net gain I guess.

After we were done playing, we watched the other teams play for first place.  From watching their games, it was clear that they played on a way higher level than we did.  Everything that their robots did were way better than ours.  Shooting was faster, chipping went further, robots moved faster, kicks were more accurate, etc.  Everything about their robots was just better.  There is definitely a lot we could learn from these teams.  The final winner of this year’s competition ended up being Skuba from Thailand, who beat ZJUNLict from China.  Both teams analyzed each others strategies for days, but only one team could come out on top.  And now for the fourth year in a row, Skuba remains the undefeated winner of the competition.

Other Leagues in RoboCup

During our idle time, we walked around the other rooms to see how the other teams were working.  RoboCup has many different competitions under its name, while our Small Size League competition is only one small part of it.  Leagues range from soccer robots, rescue, simulation, to even home care robotics.  In the home care robotics league, the competition involved a robotic navigating through a mock house to perform certain chores such as picking up objects to hand to people, speaking and hearing instructions, etc.  It was an admittedly difficult task to do for these robots, but many teams were quite successful at it.


Accidents Happen

Just like in the North American Open, there was yet again another accident involving batteries.  Except this time, nobody noticed and the whole battery lit up in flames.  Somebody just yelled “fire, fire!” and started trying to pat it down with something.  Knowing that I was too far away to do anything, I just took out my camera and snapped a picture of the whole thing.  Eventually, someone just poured lots of water over it to put our the fire.  In retrospect, that might not have been a good idea since water in an electrical fire is not really a good thing.  Nobody got hurt though, which is good.  Afterward, the organizers didn’t let us charge batteries nearby our work space anymore.

Some Design Shortcomings

Knowing that our ball kicker would be able to withstand impacts of the ball, what we had forgotten to analyze was how well the kicker would hold up if it hit a object fixed to the ground.  We found out the hard way at the competition after a few games when we discovered that our robot kicker head was bent out of shape.  We also had a lot of turf buildup inside the robot that was enough to slow down the wheel during the game.  This turf had to be cleaned out after every match.

For the kicking mechanism, the robot uses a solenoid/plunger mechanism.  Activating the coil would cause the plunger inside the core to move quickly to hit the ball.  A rubber band secured to the end of it would allow the plunger to return to its initial position.  The problem with this setup was that the rubber band would easily break and had to be replaced after every game.  When we took out the rubber band, we could always see cut marks along it.  In another instance, a chipper solenoid on a robot almost popped out.  It’s not really clear why this happened at all, but it could have been a screw that was not very tight to begin with.

RoboCup Closing

To close the competition, there was a soccer game where humans played against the middle size league robots.  It was pretty funny to see the robots struggle to take the ball away from people who could handle the ball way better.  At the same time, the humans were really scared of the robots since if a human ever got hit by the kicker head from the robot, it would break bones.  The robot goalie however, proved quite competent in blocking shots – better than the human goal from what I saw.  Or maybe the human goalie wasn’t trying very hard.  I’m not sure who won the game since I didn’t watch the whole thing, but it was still really interesting to see.

Afterward, all the teams packed up their things and waited for the closing banquet.  At the closing banquet, they served a standard meal for everyone.  It was a really good chance for teams to celebrate their achievements and finally relax a little bit after the competition.  Everyone deserved a rest after all of that.

First Real Tour of Mexico – Teotihuacan

After the competitions ended, most teams stayed an extra day or two to see the sights in Mexico City.  The organizers of the Small Size League were nice enough to organize a tour for everyone the day after the competition ended.  Most of the SSL teams went with us to the Aztec pyramids in Teotihuacan.  The tour first showed us how their predecessors used different plants and minerals to make tools such as knives and sewing thread.  That part was interesting at first, but I think what a lot of us really wanted to see were the pyramids.  Afterward, the tour guide led us to the gift shop.  For some reason, most of the people were so interested there, it took about an hour for everyone to finish so that we could move on with the tour.  After the gift shop, we finally made it to the pyramids.


After walking up and down the pyramids, we had lunch and went back to Mexico City to see the Basilica of Our Lady of Guadalupe.  This was one of the most visited Catholic shrines in the world.  But because I had already visited so many churchs and cathedrals from my tour around Europe, this part of the tour was less interesting for me.

Historic City Center

The team would fly back to Vancouver on the day after visiting the pyramids.  But before leaving, we made sure to visit the Metropolitan Cathedral of the Assumption of Mary of Mexico City and the Plaza de la Constitución.  In the plaza, hung a giant flag of Mexico.  This is where the city center used to be, at least during the 19th century.

Going Home

After 10 days in Mexico, we all longed to go home.  It had been a long week – full of stress, adrenaline pumping excitement and overall a good experience.  But after all that, we were ready to go.  We flew out in the afternoon from Mexico City.  Apparently, at around the same time that we were at the airport in Mexico City, three cops had been shot to death.  While we were there though, we didn’t hear anything of it.  We safely arrived in Dallas for a brief stopover and arrived back in Vancouver at about 8:30 PM, just in time to go home, wash up and go to bed.

RoboCup Small Size League North American Open 2012

From 9 to 16 June, the RoboCup Small Size League North American Open 2012 was held in Vancouver, Canada at the University of British Columbia.  There were three participating teams: Thunderbots (University of BC, Vancouver, Canada), ER-Force (Friedrich-Alexander-Universität Erlangen-Nürnberg, Erlangen, Germany), and ZJUNLict (Zhejiang University, Zhejiang, China).  This was the chance for these three teams to pit their robots against each other in preparation for the even bigger RoboCup competition in Mexico City.

Beginning of the Competition

On the first day of the competition, there was a work day for all the teams to use to get their robots ready again after a long flight to Canada.  As the current mechanical team lead for the Thunderbots, I too had to get our own robots ready to play.  The mechanical systems had already been completed some weeks ago, but unfortunately, even now, the electrical board testing and firmware coding still had not been completed yet and some parts that we needed were still not in.  For the next day and a half, the team was scrambling to get everything finished in preparation for the first game on Sunday.  Because, the only critical tasks remaining were the electrical testing and coding, only the electrical team had the know-how to tackle those tasks.  The mechanical and software teams could only wait for results.  As the electrical team worked, everybody else on the team became more and more stressed.  We all kept wondering whether the team would have working robots for the first game.  We were all helpless in this situation.  The electrical team worked throughout the day and night trying to finish.  Some of the other team members stayed in anticipation while others went home to rest hoping for results in the morning.

Throughout this work day, the Chinese team continued testing their robots on the field.  They seemed like the most ready team.  The German team however, had lots of work to do as well.  Their flight to London from Germany was delayed and as a result, they missed their flight from London to Vancouver.  They arrived in Vancouver on Saturday night.  They  had even less time than we did to get their robots working.  When each team set up their work space, they each made sure to put up their mascots.  For the Chinese team, they had a panda plush of about 1.5 ft tall and the Germans had a full size German flag.

Game Days

On the game day, I woke at up 5:30 AM and arrived bright and early on campus at 8 AM.  When I arrived, the electrical team was still at it and seemingly not even close to finishing.  This led to a change in the team’s strategy to the competition.  We would try to repair the electrical boards from last year’s robots.  These old boards had a different size than the new ones and had different mounting holes, but luckily, somebody on the team had the great idea of including mounting holes for these old boards for this year’s robots.  Otherwise, we would have had a really hard time hacking that together.  Given only the few hours we had to hack this set up together, the mech team and I worked as fast as we could to finish.  We each probably ran up and down the stairs at the UBC Engineering Design Center about 20 times that day looking for tools and delivering robots.

The first game was supposed to be at 9:30 AM, but my team certainly was not ready.  It seemed like the other teams weren’t completely ready either, so the game was postponed until the afternoon.  The Thunderbots was supposed to play the first game, but due to our lack of readiness, China and Germany played each other instead.  When it became our turn we play, we managed to get three robots out of six on the field.  None of these robots had a working break beam sensor (the sensor on the robot that is designed to detect ball possession).  Without break beams, the robots did not know they could kick the ball, since it would never know if it had ball possession.  The robots did not have a controller that worked well either (the controller determines how much voltage to apply to each of the motors such that the robot can move smoothly from A to B).  A controller that didn’t work well meant the robots drove about on the field seemingly confused.  “Derp” is probably the best word to describe it.  Despite the shortcomings of these three robots, they played their best against ZJUNLIct from China and the Thunderbots were defeated 10-0.

On the following few days, the mech team tried to help the electrical team the best they could with tasks such as building extra connectors.  We also tried to get the old break beam sensors working again.  It was something that had to be on the robot if it were to ever kick the ball properly.  After toiling for a few hours, we managed to get two out of three of them working.  We probably could have gotten more if we knew more about the electrical design.  There was little to go on in terms of the wiring schematic and spare parts.  It was also hard to troubleshoot since ambient lighting largely affected the sensor.  If it worked upstairs in our work space, it wouldn’t work downstairs on the playing field.  It took us a while to figure that out.

In our second game, we played against ER-Force from Deutschland.  For this game, we still only had three robots, but this time they were a little bit better equipped.  Even then, the robots still had trouble kicking because the lights being used on the field emitted too much infrared light, which obstructed the break beam sensors.  It was very frustrating to see the robots not knowing when to kick even though they were handling the ball perfectly. But somehow, we still managed to score a goal.  In the end we lost the game 6 to 1.

In the final game between China’s ZJUNLict and Germany’s ER-Force, the Chinese team was victorious.  Both teams had a full fleet of robots to play six on six.  A modest crowd of spectators also watched the whole game being played and in general people were quite impressed at this engineering feat.

Team Social

To allow the teams to better know one another, there was a social event planned by the organizers of the North American Open.  There, I met a lot of the members of the German and Chinese teams.  It was nice that that I could talk to each team in their native languages.  Although my German wasn’t that good to keep up a conversation for a long time, it was enough to get the Germans wondering how I knew it at all.  The last thing they’d expect is for a Chinese guy to start speaking German to them.  My Mandarin was at a level that I could talk to people in it, but there were still some occasions where I didn’t understand what they said.  It was probably because of me not having a lot of practice with Mandarin (I speak Cantonese normally) and them having an accent from their region that I didn’t recognize.

Press Conference

The organizers made sure to invite as much of the press as they could.  More publicity meant that the team could potentially get more money in sponsorship.  More money means better robots.  The administrative members of the team were in the spotlight and talked to most of the people from the press, while the technical members of the team continued to do their work.  The team leads from mech, software and electrical also had a brief interview with the 24 Hours Vancouver newspaper and ended up in this article.  The team was also featured in the Ubbyssey here and on MacLean’s magazine here.

The Chinese team also put on a show for the press by putting all 12 of their robots on the field so they could they play against themselves six on six.  The performance went quite smoothly as there were not random break downs and the press were very impressed.

Engineering Failures

As with these student projects, an accident was bound to happen.  This one was with a battery.  There was have been a defective battery that the Chinese team unknowingly brought and when they charged it, the battery started puffing up – not a good sign for a battery.  One of our team members was quick to notice and instantly dunked it in soap water and disposed of it.

For our team, we had problems where the solenoid kicker would get stuck after being used repetitively.  Heat from the power dissipation in the solenoid windings would heat up the whole assembly and cause the solenoid housing to permanently deform.  The solenoid was produced out of stacked layers of poly-carbonate sheets.  This stacking of layers allowed each layer to deform individually.  To fix this problem, we printed out new housings made of ABS plastic.  By having one solid solenoid housing, it was more difficult for it to deform.

The German team had some problems with the turf getting dug out of the carpet and getting everywhere inside the problem and also with their robot shells not staying on properly.  The turf inside the robot meant that gears could get stuck intermittently and could also get in the way of other mechanical components.  Their solution solution for now was to clean it all out every game.  During games, the shells of the robot would pop out randomly whenever there was an intense impact with a ball or another robot.

Getting Ready for Mexico

On the Friday before all three teams left for Mexico City, everybody had to pack up all of their things.  The German and Chinese teams could pack everything easily since they had packed everything once before when they had to fly to Vancouver.  For us, our tools were scattered all over the place.  It took us about 4 hours to find all tools to pack into the the luggage containers.  The approach to packing was that we would pack any tool that was ours and was already lying out on the table.  This is because if we took it out of the tool closet, it meant that the team used it for something.  Naturally all of the hex keys, screw drivers and the like were packed.  All spare parts were packed.  Every tool that we had sitting around was packed.  Even electrical equipment like a power supply and an oscilloscope was packed.  We had everything we needed for RoboCup 2012 in Mexico City.  Even though not everything was done in time for this competition, everybody was confident that things would be better in the competition in Mexico.

© 2017 Henry Poon's Blog

Theme by Anders NorénUp ↑