Monday, February 25, 2013

Arduino autonomous tracked robot build Part 2


On to the actual construction of the tank.
Basically it is made from Tamiya kits, the tracks and gearbox one kit and the platform and diverse small parts in another. I bought them from a local hobby shop and that cost me a lot more than expected but that is my problem. It should be fairly cheap if you source the parts from the source and not third party vendors like I did.
Arduino autonomous tracked rebot
This is the final version of the robot but there were several iterations until I got to this and unfortunately I don't have photos of those but I can still share my experience.

Arduino autonomous tracked robot build Part 1
Arduino autonomous tracked robot build Part 2
Arduino autonomous tracked robot build Part 3
Arduino autonomous tracked robot (visual post)

My first build of the platform was way too long, it was spanning double supporting boards (the white/transparent base you see in the picture) and was very high. I also had two dual gearboxes, I bought that separately and one was not a perfect fit on the board (strange since that is from the same company) but has the same gear ratio. I managed to make everything work (and they did work in harmony I might add). It had a lot of power and could actually climb a vertical surface (like that coffee table the picture is taken on) and it would flip over without problems. The thing was that it did not corner (sounds like an american car); on my carpet, it would loose the treads and stop moving.

After more modifications I got to this form factor. It still has it faults but it is stable. Because of the way the Ultrasonic sensor hangs out, the whole tank is tipping a bit towards the front but it still works (I try to counter this with the position of the battery). The only problem is when it decelerates, the Ping sensor will be aimed downwards and it will register an obstacle, sometimes.

Next up is the basic components.
As you can see the platform has a dual gearbox with two 3V motors in them. As they came from the kit there are naked, meaning just wires connected to them. The motors, in my opinion need to have some capacitors to ease the problem of back currents and spikes. So I added a 0.5 uF to each motor.
Capacitors added to the gearbox of the Arduino tracked robot
I know this helps, even if you don't notice it, and even if it does not help, for a few cents they are worth it.

Since I'm on the subject of locomotion I will tell you what is actually providing power to the motors.
Let me start with the bad first. I bought an Arduino motor from RadioShack (a bit expensive) but I hoped it worked.
Arduino motor shield
Arduino motor shield back

When testing this bit everything seems to work fine; my test were a couple of seconds long, just to figure how to write the sketch to move the robot. In my first major test I had the whole platform together and let it move forward, back ,left, right for a minute or so. I then noticed that the chip on the shield was getting very hot. By the way, I am powering this with a 11.7V 3 cell lipo battery from my RC helicopter. The shield takes from 12 to 5 V as input and also powers the Arduino. I do need to mention that the first tests were ran with two dual gearboxes in parallel meaning that there were a total of 6 volts going to each track and that it was not even set to half throttle.
I tried to see if using only one dual gearbox will make a difference but it didn't, the chip (this version of it, the L298P) requires a heatsink addon and I didn't want to mess with the shield so I looked for a different one.
In comes the SeeedStudio motor shield.
SeeedStudio Arduino Motor Shield
Back of SeeedStudio Arduino Motor Shield

SeeedStudio Arduino Motor Shield
As you ca see from these photos this shield uses the L298N chip with a huge heatsink attached. Ironically it says "hot surface" but in my tests you could only say it got warm to the touch. This shield came in with a problem of it's own: the connectors on it are non-standard, non-commercially available plugs or adapters, not even in a huge $200 case kit (in which I looked in details at RadioShack)  with different parts from the same Seeedstudio company. Not to mention that the code I written until then had to be redone.

The software problem is not that bad, as an SDE I am faced with rewriting and redesigning programs a lot so that was just a setback but the hardware problem got me for a while. I wanted to solder wires directly and bypass the whole stupid connectors but is would have been a pain to do so, I kept looking for solutions.

I found something similar but not enough so at Vetco. I bought those and started to shave them off bit by bit to make them work. In the end that did the trick, shaving the latch mechanism and a bit from the front part of the connector made them thin enough to fit in there. So I started making wires and connectors to things. Also to note that the way the shield provides these connectors are in 4 wires pair. All of them have a +5V a GND and 2 pins directly related to the Arduino (be it analog or digital pins and are clearly marked on the shield).

That's about it for the traction of the platform, on to the sensors.
Since my DIY sensor didn't go as expected, I needed a way for the robot to see and navigate and since I didn't want to pay for a Paralax Ping sensor from Radio Shack I ended up with a HC-SR04 Ultrasonic sensor for a third of the price. Now this was my first time using one so I don't know if it's my setup or me not knowing how to use it properly but the sensor does give some false readings sometimes (I don't know if the Paralax one would not give me false readings) and I ended up taking care of this in the code.

Now that I sorted out the readings and had myself some eyes I mounted them to a servo so that they can look around. My IR sensor bites me in the ass again: using the IR library still screws with the IOs and makes it impossible to use the Servo library. After more reading and frustrations I stumbled upon the Software Servo library that fixes my problem. Good thing I am using only one servo. To note that for this library to actually work, some rewriting of the code was needed again because of the necessity of fast loops (I was using fairly big delays in the loop as measurements of how much it should travel).
So this is sorted out and  the eyes are ready.
Left side of the HC-SR04 ultrasonic sensor
Right side of the HC-SR04 ultrasonic sensor

Front of the HC-SR04 ultrasonic sensor
Underside of the HC-SR04 ultrasonic sensor

As you can see, everything is kept together with hot glue and it actually feels quite sturdy. If you look closely you will see that I also glued the wires after I soldered them on to the ultrasonic sensor. I did this because after just a few minutes of looking around two of the wires came loose. I do recommend putting a dab of glue on that to alleviate the stress from the solder joint to the upper portion of the wires.

So this concludes the build of my autonomous tracked robot platform. Next up is the easy part of the monster, the brains.
Continue to Part 3

1 comment:

  1. I have the exact same Seeedstudio motorshield in my tracked robot. I wanted to pass along my solution to the grove sensor connections. After unsuccessfully trying to source a good cheap site for the grove connectors I gave up and ended up ordering the standard male to female jumper cables. I don't know if your site allows URL links, so you can find them on amazon by searching for Phantom Yoyo cable. They work perfectly for that shield and the bonus is they are also incredibly useful for sensors, boards, and other things that have male pins exposed that you need to stretch to the Arduino, such as the ultrasonic sensor, so that you can prototype before you solder wires. I know this comment is pretty late, but maybe you might find it helpful. Thanks for sharing your robot, believe it or not it is incredibly helpful to those of us doing the same builds!

    Rory

    ReplyDelete