Tankah – remote controlled tank

Since I’ve started messing with robotics that I wanted to build a tank, and finally that moment arrived when two Tamiya thread kits and a Twin Motor Gearbox arrived.

Everything started with a sketch:

And as soon as I decided what I wanted, the assemble process has begun.
I have some plastic sheets laying around and I thought they would be perfect to hold all the hardware.

The chassis:

Meanwhile the replacement motors from Pololu arrived and I soldered the caps to remove motor noise.
The ones that came with the twin gear box are very noisy (electrically speaking)

This is the design in an almost final phase:

Later I replaced the plastic things for wood, and I used polymorph for the first time, it´s the best material I have seen in the last decades.

The brains (Xbee, Arduino and my custom motor driver with L293D):

When all the things got in place it was time for a test drive through some obstacles..
I figured that it needs some kind of stabilizer.. otherwise it won´t climb more difficult obstacles, OR it may flip around… (I think i´m just having an idea for another bot)

and… this was the solution I came up with  :D

I placed an “arm” on the back, it stops the tank from flipping over when its climbing stuff.

It works like a charm  :-)

It´s a lot of fun to drive this thing!! :-)   still editing the video…

bigbro

After completing the new motor driver board, now I feel ready to continue with the development of this bot..

For now it´s just remote controlled, but it will have some intelligence soon.
I will try to add microphones and use them as sound sensors. If I add for example 4 microphones, one on each side of the bot I could detect where does the sound come from and make it move in that direction, then add a couple of distance sensors to avoid obstacles..

My living room seems to be too small to drive this bot..

see it on MAKE :]

Control your motors with L293D

After long research and trial and error,  I´ve came up to a new walkthrough regarding this nice chip, the L293D.
Each project is one project and each one has its own unique power configurations, so you must be aware of the best battery choice and how to distribute voltage through your robot.

I strongly advice you to read the following articles:

Picking Batteries for your Robot
Once you’ve decided on batteries, how do you regulate the voltage

************************************************

L293D gives you the possibility to control two motors in both directions – datasheet

************************************************

The L293D Circuit:

Basic Implementation:

This is the most basic implementation of the chip.

As you can see, a 5V Voltage Regulator is between the battery and pins 1, 9, 16.

Pin 8 gets power before the VReg, if your motor needs for example 6V you should put 6V directly in this pin, all the other pins should not get more than 5V.

This will work with no problem at all, but if you want to do the right implementation take a look at the next example:

This is the correct Implementation (with the capacitors), and note that pin 8 is feeded by unregulated voltage. This means that if your motors need more than 5V, you should power this pin with that amount of voltage, and the rest of the circuit with 5V.


The capacitors stabilize the current.

The same circuit on a breadboard:

Soldered on a pcb and ready to go:


This is the back of the circuit, click for high resolution photo.


// Use this code to test your motor with the Arduino board:

// if you need PWM, just use the PWM outputs on the Arduino
// and instead of digitalWrite, you should use the analogWrite command

// —————————————————————————  Motors
int motor_left[] = {2, 3};
int motor_right[] = {7, 8};

// ————————————————————————— Setup
void setup() {
Serial.begin(9600);

// Setup motors
int i;
for(i = 0; i < 2; i++){
pinMode(motor_left[i], OUTPUT);
pinMode(motor_right[i], OUTPUT);
}

}

// ————————————————————————— Loop
void loop() {

drive_forward();
delay(1000);
motor_stop();
Serial.println(”1");

drive_backward();
delay(1000);
motor_stop();
Serial.println(”2");

turn_left();
delay(1000);
motor_stop();
Serial.println(”3");

turn_right();
delay(1000);
motor_stop();
Serial.println(”4");

motor_stop();
delay(1000);
motor_stop();
Serial.println(”5?);
}

// ————————————————————————— Drive

void motor_stop(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], LOW);
delay(25);
}

void drive_forward(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
}

void drive_backward(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
}

void turn_left(){
digitalWrite(motor_left[0], LOW);
digitalWrite(motor_left[1], HIGH);

digitalWrite(motor_right[0], HIGH);
digitalWrite(motor_right[1], LOW);
}

void turn_right(){
digitalWrite(motor_left[0], HIGH);
digitalWrite(motor_left[1], LOW);

digitalWrite(motor_right[0], LOW);
digitalWrite(motor_right[1], HIGH);
}

***********************************************************************************************
update 26/4/09
***********************************************************************************************

My 1st instructable  :)


Control your motors with L293D and ArduinoMore DIY How To Projects