Xevelabs

To content | To menu | To search

Thursday, November 24 2011

USB2AX

It's about time I talked about this one. This post has been a work in progress for more than 6 months!

The idea behind the USB2AX

The USB2AX board is the small programmable USB to AX and MX-series Dynamixel adapter we designed with my friend JLG, in the early stages of developing the Xachikoma.

Basically, it's a gizmo you plug into an USB port that creates a virtual COM port on your computer, through which you can communicate to Dynamixel servos. It behaves much like the USB2Dynamixel made by Robotis (in most cases, it's a drop-in replacement), but is limited to AX and MX series servos. It does not provide power to the servos, this has to be done by other means like using a SMPS2Dynamixel Adapter or a home-made power cable.

I made the design (mostly from things I learned from the Arduino Uno and Adafruit ATmega32u4 Breakout Board+, but adding my own n00b mistakes), and he made the first versions PCB, under the constant pressure of me asking to make the board smaller, SMALLER, SMALLER!

USB2AXv1_top.jpg
USB2AXv1_bot.jpg
Version 1

Making such a beast is far from being a new idea, yet my version is the smallest of the "clean" ones I know of, and it's more versatile than most. I would not have made it if I did not have a real need of it: I use 4 of them in the Xachikoma.

The core of the project is an ATmega32u2, a 8 bits micro-controller from ATMEL without much bells and whistles, but with a full-speed USB device port and an UART. Its little brother, the ATmega8u2, is used to replace the FTDI in the Arduino Uno, and its bigger cousin the ATmega32u4 will be the heart of the upcoming Arduino Leonardo. Having a micro-controller do the bridge between USB and the half-duplex serial bus used by Dynamixel actuators is interesting for two reasons: you can use software tricks to create the half-duplex line instead of having multiple components, and you can create more complex firmwares which not only channels bytes from one side to the other, but can perform treatments on them.

The half-duplex trick used here is the same some people use to make an Arduino talk to Dynamixels by just tying TX and RX together. This is also used by the Arbotix controller and others, just to name a few sources you can learn from. The idea is that in the ATmega, you can turn ON and OFF each part of the UART (receive, transmit), and when one is not used, the corresponding pin can be left floating (meaning it does not impose a particular logic level to what it's connected to). This way, you can leave the receiving part ON most of the time, and switch to transmitting mode only when you have bytes going from the computer to the servos.

The ability to update and experiment with the firmware is potentially a great strength: not only can you optimize the inner workings to lower the latency (compared to the usual FTDI chip), but you can also add nifty features by allowing the USB2AX to understand what it receives and to react to it. Instead of only transmitting bytes blindly, you can imagine implementing macro commands, like a SYNC_READ (iBot has done so). Another possibility is to change completely the way the computer sees the board. For example, you could make a joystick with force-feedback based on Dynamixels, and program the USB2AX to appear to the OS as a plug&play joystick, allowing seamless use of your über-joystick in any game!

Some inspirational material around the topic of "stuff speaking with the dynamixel actuators":
http://billyzelsnack-robotics.blogs...
http://billyzelsnack-robotics.blogs...
http://www.siempreaprendiendo.es/pr...
http://www.pablogindel.com/2010/01/...
http://websvn.hylands.org/listing.p...
http://robosavvy.com/forum/viewtopi...

Latest developments

The latest version is the V3.0a (V2 never actually lived :/), and improves durability and reliability while still keeping a small form factor. Basically, this version should be roughly on equal footing with the USB2Dynamixel from Robotis when it comes to communicating with AX-series Dynamixels, just smaller and with slightly lower latency.

USB2AXv3.0a_top.JPG
USB2AXv3.0a_bot.JPG
The latest V3 prototype.

With a real USB plug, the risk of shoddy connection should be reduced close to zero. This causes a problem however, as the standard male Type A USB plugs are 20mm long, more than twice the size previously allocated to the plug and more than two third of the total length of the original board! That's why we remade the PCB from scratch, with better layout, smaller traces and smaller components where possible (0.5mm pitch QFN package for the ATMega32u2, small SMD crystal, 0402 capa and resistors...), even if it means that it can no longer be assembled with the good old soldering iron. That's an opportunity to practice reflow soldering with a hot plate, yeah :D Also added from the first versions are the recommended decoupling caps (!) and ESD protections on both USB and serial lines, to reduce risks of frying the board or any of the costly equipment connected to it.

USB2AXv3.0a_conn_bent_top.JPG
a V3.0a, plugged and connected to an AX-12+.

P1010183.JPG
It took me a few afternoons to make all of these, mostly by hand...

USB2AX documentation, schematics, BOM, code

(and if you may wonder: ParanoidStudio is the name under which we hack robotics stuff with this friend).

I still have a few units of the improved version (better quality and durability). If you are interested in buying one, please say send an email at xevel {at} xevel |dot| fr ! A commercial version will most likely see the light of day in a few weeks/months too.

Some threads with information and discussions about this version: http://forums.trossenrobotics.com/s...
http://robosavvy.com/forum/viewtopi...
http://forums.trossenrobotics.com/s...

Next time, I'll talk a little about the first prototypes of USB2AX, I had some real fun doing this...

Friday, July 1 2011

That's how we roll

Wednesday, June 29 2011

Approved

We passed the approval phase with flying colors, executing a perfect Funny configuration on the first try!

Now we have to continue working on scoring real points in a real match, that is to say having a system that works in all configurations!

Photos to come!

Добро пожаловать в Астрахани!

We are in Astrakhan!

After some Champagne and a good meal in first class (thanks Aeroflot!) from Moscow, we finally arrived at Astrakhan airport. Airport arrival

We are planning to get a short night, to be able to start working early in the competition arena.

Welcome package

Our hosts are very welcoming (although they mostly don't speak English, funky trip ahead). But we already planned a raid to a good restaurant with some of them :)

Anti-mosquitoes

The mosquitoes seem to like us as well...

Monday, June 27 2011

Travel hazards

Because of some trouble with the flights, the team is not in Astrakhan yet. We should be there tomorrow night.

  • Because of a delay on their Paris -> Moscow, Xevel, Napalm and Caro are stuck in Moscow for 24 hours. Hopefully they will find a hotel and be able to work on the robot or visit the city.
  • Because of massive flights cancellation from Air France (thanks guys!), Jlg is stuck in... Grenoble \o/ He should be able to rejoin the rest of the team in time for the Moscow -> Astrakhan flight tomorrow night.

That means we lose one full day, where we could have been experimenting and improving the robot on the competition tables. But we are still working on improving the algorithms (thanks to the simulator) and the vision part.

More information later!

Sunday, June 26 2011

And here we go

in a little more than 24 hours, we will be in Astrakhan, Russia, for Eurobot 2011.

I want to thank our two sponsors for this trip :

ESIAL ("École Supérieure d’Informatique et Applications de Lorraine", the School of Engineering in Information Technology of Lorraine most of the team graduated from).

ESIAL.png

INRIA Nancy Grand Est ("Institut National de Recherche en Informatique et en Automatique", the center of the "French National Institute for Research in Computer Science and Control" I work at).

Logo-INRIA-couleur.png

We'll see if updating while we are there is an option. In theory, we should have Internet access most of the time.

Thursday, June 9 2011

French Cup 2011 recap

Let's get this out of the way: WE NEED SPONSORS TO HELP COVER OUR TRAVEL EXPENSES!

Four of us will make the trip(Paris-Moscow-Astrakhan, 27 June - 3 July), and the estimated cost of the journey to Astrakhan is around 800€/person (a little less than $1200), including visa, train to go to the nearest airport, plane tickets, and taxes. And that's before spending a single ruble on tourism, vodka or caviar.

Please contact us at admin {at} xevel {dot} fr if you are interested in having your company's name on the robot everybody will be looking at, at an international robotic competition ;)

Also, while I have your attention, I (the guy who designed, built and programmed the robot) am looking for a job doing cool stuff with robots, if you think you have use for someone with this kind of skills. Same contact.


WithAward2011_small.JPG

Soooo, now for a recap of what happened...

The day before departure, the robot was not OK. It could roughly move around and avoid obstacles, but the legs kept on spreading uncontrollably, and this caused many problems: the servos were overheating, the movement accuracy was abysmal, and the Neato LDS would sometimes see the legs even with the algorithm used to ignore them, resulting in strange and unforeseeable reactions. Basic AI was ready but nothing dedicated to score points (!), and the CMUcam was not yet usable (it could distinguish colors but not interpret the result). During the 6-hours trip to the competition venue, I tried to plan the modifications I would have to work on to solve these problems.

Arrived a little after 9am on Wednesday, we had to wait until 2pm to enter the venue. Immediately after unpacking, hordes of members of the staff and other teams started circling the robot, asking questions and sometimes providing me with solutions for some of my problems :) I finally could sit to get back to work around 11pm, and started coding... In the meantime, my dear godfather Din' was trying to create a GIT repository and to setup stuff so that we could continue working with a source control manager, but without much results (we're so dependent on our Internet connection that we're lost without it :s)

Days can be relative, when they are not separated by sleep time. So later that day, on Thursday, we brought the robot to the referees for approval. This is usually done in 3 parts: - verifying that the robot is made in compliance with the rules, - testing that it can win a match, alone on the playing field, - testing that it can avoid a dummy opponent.

The first part is called "static approval" because it is normally done without the need to power the robot or have it moving... but in my case, it was not possible to do it like that. The maximum perimeter and the height of the beacon mast are both dynamic on my robot, so we had to come back and finish the "static approval" dynamically later ;)

A new rule this year was that every robot had to demonstrate leaving its starting zone before the beginning of the first series of matches (Thursday, 12am IIRC), or would be automatically disqualified. The robot was at this time still plagued by random latency problems induced by an error I made two days before, and even this so simple thing nearly got us evicted from the competition before it started. In the end, we negotiated a 10 minutes extension of the deadline and managed to make it leave its starting zone in the crudest way: we made the robot stand up with the wheels spinning, killed the AI program, then ran to the referees, put the robot on the table and watched as it brainlessly rolled around. xD This gave us a 24 hours delay to have the robot fully approved (before the start of the 3rd series), with yet another sleepless night ahead.

That night, we got the providential help of a guardian angel. The guardian angels are the volunteers tasked with leading teams from their pit to the main stage when it's their turn to play. They have (plastic) golden wings and basically without them having 70 matches per series would be an awful mess.

So this guardian angel, Alexis, took some time after his duties were fulfilled to listen to the problems we had, and to help us solve them, when instead he could have gone to sleep after a long and tiring day. At this point of the day (a 72+h day!) i was beginning to lose my mind as I did not have a versioning system on my source code anymore, and he installed a SVN repository on the robot, allowing me to regain some sanity. This also had the tremendously positive effect of lifting our spirits, which was much needed for the rest of the day (we had still 12+h to go before the end of the approval phases).

Once we could code without the gloom of breaking everything and not being able to get the last version back, everything went better. I fixed the latency problem we were having, while Din', Napalm and TicTac (late additions to the team) worked on movements, programs for the approval and image processing.

Friday morning, we came back to see the referees in order to finally have to robot approved. We had to convince them that all the dynamic behavior would always stay in line with the rules, not being able to show every possible scenario... Then we passed the obstacle avoidance part of the approval with a program dumbed down to avoid the problem of the LDS seeing the spread legs (the minimum detection radius had to be pushed away to around 30cm, which caused close obstacles to be ignored... :/ ):

Obstacle avoidance approval

As a comparison, here are the previous obstacle avoidance tests:

First obstacle avoidance

Better obstacle avoidance

At this point, we had around 2 hours left to validate the last required test: being able to win a match alone. Faced with little time and having few working neurons left, we opted for a simple "push the first pawn" strategy.

The first try was perfect, with a marvelously placed pawn...

Approval, winning a match... first try

...except that it was placed on the wrong color. The referee was not impressed xD

After a few more tries we managed to score anyway, earning the right to participate in the remaining series of match (3, 4 and 5). We were the last approved team of the 140 ones that managed to pass.

Approval, winning a match... other tries

The first match for us was 2 hours later, and we had no energy left to think of something clever to do, so we just added a dance to the program used for the approval. The idea was just to fill the remaining 80s of the match with some cool moves, instead of staying in the middle of the playing field, frozen.

Xachi vs Robokit

The next match was a few hours later, and still no brilliant idea to have a fully functional robot in such a short time. So we thought we would do the same thing. But "let's just clean up a few things here and there"... and with this thought came the error that led to the funniest match of the competition (yes, I'm not afraid to say it!):

Xachi plays possum

One minus sign missing, and there you have something completely different. The robot started as if it were on the other end of the table, collided with the border (scoring 10 points in the process :D ), then started dancing... but the legs were in a strange position and it lost its balance, falling on its back. At this point, still trying to dance as if nothing happened, it managed to flip its power switch ^^

We discussed with the referee, and his point of view was that no rules had been broken (!), so we kept our points, resulting in a draw 30-30.

A few hours of sleep and a steamy hot shower later, we're back for another busy night.

I finally managed to implement the closed loop control of the legs with reasonable latency. This allowed us to test the obstacle avoidance system at higher speed:

Fast obstacle avoidance

Notice how the legs return to where they should be after a perturbation :)

In the meantime, Din' and Napalm implemented the full image processing pipeline for the cmucam, but we had no time to properly test it. Due to an error in the control mechanism I implemented the night before, we had to choose between moving nicely and dancing. We chose dancing, as we still had no functional AI. For the last match, we faced 1000 Team with their incredible centipede robot ("random" selection of opponents sure does things well :D ).

XD vs 1000 Team

The last event of the day (after a few more hours of sleep) was before the finals, when we received the Creativity Award. The award in all its glory: Award2011_small.JPG

All the "little" awards (Creativity Award, Award of the Teams, Innovation Award, ... all except the ones for 1st, 2nd and 3rd place) are hand-made by volunteers of the organizing association, using parts collected here and there. It's very nice <3

As far as I know, it's not usual to send the recipient of the Creativity award to Eurobot, they usually sent a team that could do well in terms of points. We will do our best not to let them down :) (and considering the cost of the trip, we'd better have a functional robot >_>)

And for your pleasure, here is a compilation of xachi's best dance moves:

Dance compilation

The team (or at least the ones who were present on the first day):

Part_of_the_team.jpg Part_of_the_team_back.jpg

Logos of the sponsors are positioned on the legs, one on each side of the apparent servos. Sponsors_1.jpg Sponsors_2.jpg Sponsors_3.jpg Sponsors_4.jpg

Lastly, here is a short list of people I want to thank:

My sponsors, AIP Primeca Lorraine, I.materialise, Pololu for there support,

Caro, JLG, Sticky, Din', Napalm and TicTac for helping me on the robot, 'nd stuff :D

Alexis the guardian angel for saving me from madness (MADNESS? SPARTAAAAAAAA),

The geek of INSA Rennes who saved me Friday night with a copy of AVR Studio 4,

Samuel and all the Poivron team (hiiiii!)

RCVA for answering when I try to speak to them (just kidding, they didn't. Whatever, they will never know, they don't speak English >_>)

All the volunteers and other staff of Planete-Sciences for organizing all this,

and also all the people I don't remember now but I'm sure I will remember some day...


Now, It's time to get back to work, and try not to let myself be eaten by all the problems surrounding the trip to Russia... Why did it have to be THIS year that going to Eurobot would cost more than making the robot? :s

Tuesday, June 7 2011

XD is going to Eurobot

That's it. We won the Creativity Award at the French Robotic Cup, and we're going to the big game along with the two best french teams :D

Eurobot finals are held in Astrakhan, Russia, between June 28th and July 2nd.

More info very soon !!!

Sunday, May 29 2011

So much things to do, so little time

Things are going in the right direction, but each completed part reveals unforeseen problems.

Moving...

If moves, yes, but the latency of the Linux OS is just horrible, and it slows down the communications by a factor up to 100... hence the shaky movements. I will put the problem under the rug by just configuring the servos so that they don't send a response to write operations.

Rolling!

Driving... slowly. But it has potential to be up to 50 times quicker. Haven't tried it yet. Before that, the PID coefficients of the motor control need fine tuning.

Half-broken obstacle avoidance

Avoiding obstacles using only the Neato LDS. All thresholds and weights in the computation needs tuning too. The algorithms have lots of room for improvement too (I already have a better behavior than what can be seen here).

A really big problem right now is that the legs tend to spread when moving around. To correct this, I would need to ask the servos their positions, compute the actual position of the tip of the leg, and use this information to correct it with a PID controller... I'm not sure I can code and test it in the remaining time before the competition. At least not if I want to code all the other perfectly necessary things the robot still misses, like interpretation of what the images returned by the camera.

We'll see. Three days to go.

Sunday, May 1 2011

Poster 2011

The poster has been sent for review! It will be hung (at a 30° angle ^^' ) in the pit during the competition, and is meant as a way to promote communication between teams (even though I have hardly ever seen anybody paying attention to it... >_> ).

Poster

Also, in the past weeks, I've been working on low level programming of the boards that goes on the Dynamixel bus : the Power Distribution Board, which also serves as an interface board (reads buttons, powers the leds,...), the Motor Controller board that just controls the motor of the Neato Laser Distance Sensor, and the board that manages the wheel motor, the encoder, and the mini-servo in each tibia.

All of these are now functional, so I can finally work on higher level stuff: movements!

- page 1 of 3