Showing posts with label indoor. Show all posts
Showing posts with label indoor. Show all posts

Friday, 6 July 2012

Auto Tank - Ver 2

As I have planned before, finally I got some time to work with the tank and it looks much better now. See the video below. And yes I managed to break the tread!

My first plan was to make alternate left and right turn. But I after making a program for that I have realised turning left and right alternately will only get the tank stuck in some corner failing to get out of the trap. So I had to adopt a different strategy for fixed IR sensor control. I am just writing the logic below.
  1. Power on
  2. Move forward crazy(full speed).
    1. speed depends the distance to the obstacle
    2. speed reduces to zero as it reaches towards the obstacle
  3. Once the gap in front has reduced to 8 cm(approx), stop and have a think about which way to turn
  4. Turn left or right - Turning right has a probability of 9/10 and turn left has a probability of 1/10.
  5. Once the decision has made on which direction to turn  keep turning until the gap in front increases more than 8cm(approx).
  6. move forward
  7. got to step 2
The decision making with the more probability to turn right has been done using a random function as shown in below pseudo code.


        int t=random(1,11);   // randomly gets a value between 1 and 10, random() is an Arduino function
        if(t==1)  
        {
         Turn right
         }
        else
        {
        Turn left
         }

And from the previous version I have removed all the pause timings to make it more smooth-smooth. previously the minimum gap to brake was less than 8 cm. Increasing this minimum gap reduced the tank running into things and made the sensor more safe from collisions.

Now, these are my future improvement plans for this.

  1. Move the motor controller from the bread board into a PCB.
  2. Use a common 9V rechargeable battery for both Arduino and the motors. Currently Arduino runs with 9V PP3 battery and the motors on 4.8 V rechargeable battery pack.


Wednesday, 13 June 2012

AutoTank - Ver 1

After few weeks of playing with LEDs, waiting for the parts and a 'massive' man flu I have put things together on the tank and made a tank robot. What this tank does is go forward at full throttle, when it detects some obstacles in front turn left.

AutoTank V1.1 - Parts list

  1. Sharp IR sensor - GP2Y0A41SK0F
  2. 2 x DC motors(came with the tank toy)
  3. 1 motor driver - SN754410 Quadruple half H driver
  4. The brain - Arduino UNO R3
  5. One 9V(PP3) battery to power the Arduino
  6. 4 x NiMH cells to give 4.8V - for the motor driver power
  7. An SPDT switch (SPST was enough for this application but I didn't have any!)
  8. And lots of insulation tape to keep things together - proper engineering
AutoTank on test run
Yes, as I said before this turns in only one direction and there is no bump sensor. IR sensor is a range sensor so it is used to control the speed depending on the distance from the obstacle(not to a great deal) with dead stop distance.

Planned improvements for next version
  1. Make alternate left and right turn
  2. Protect the front IR sensor from colliding into things
  3. Use a bigger range of speed control on straight control
There are a lot of hardware improvements required(software too) but I don't want to try to do too much in one go and I got to wait for the hardware parts anyway(not even ordered yet).