Arduino Forum

Topics => Robotics => Topic started by: hoff70 on Jun 15, 2012, 03:07 am

Title: My first robot
Post by: hoff70 on Jun 15, 2012, 03:07 am
I wasn't planning on getting into robots with the Arduino but I saw this at the dollar store for five bucks:

(http://i711.photobucket.com/albums/ww112/jhoff/SANY0012-1.jpg)

A few hours later it was this:

(http://i711.photobucket.com/albums/ww112/jhoff/SANY0013-1.jpg)


Pretty neat little dude  :)  I "neutered" a couple of servos and rigged them up to drive it. I have a couple of sr04 ping sensors so I guess I'll build an obstacle avoiding robot. I just ran the servos directly off the pins (Not good, I know) but I have a motor shield.

I want to build a bot with the ping sensor mounted to a servo or either 2 sensors. Any advise?
Title: Re: My first robot
Post by: Ufoguy on Jun 15, 2012, 01:44 pm
Here is a link that I found useful. http://www.akeric.com/blog/?p=1590 (http://www.akeric.com/blog/?p=1590)
Also try searching Google for " ping scan robot ".
Title: Re: My first robot
Post by: oric_dan on Jun 16, 2012, 01:09 am
Best thing is to use a separate battery to power the servos. I use
4-6 rechargeable NiMH AA-cells in series to power all of my robots.
Those cells have 2000-2500 mA-hr of energy and can run your robot
for several hours.

Also, in the Files -> Examples section of the Arduino IDE, there are
example sketches for controlling servos and PIng sonars, etc.
Title: Re: My first robot
Post by: DuaneB on Jun 16, 2012, 11:39 am
Hi,
   I am seriously jealous of your chassis ! I built a paper shell for my robot thinking the kids might like it but there were completely dismissive of it. If I had had that chassis I would never get the thing back from them.

As for advice, if you have kids, try and mount the electronics underneath so that you can keep the original design on top.

Duane B

rcarduino.blogspot.com (http://rcarduino.blogspot.com)
Title: Re: My first robot
Post by: hoff70 on Jun 16, 2012, 07:10 pm
Well, here he is now:

(http://i711.photobucket.com/albums/ww112/jhoff/temporary-181.jpg)

There's room for 8 AA's and a small breadboard.

Thanks for the input guys!

Now to get him working  :) I have an Arduino motor shield and my sensor is an SR04 so the code is going to be different from a regular PING.
Title: Re: My first robot
Post by: hoff70 on Jun 16, 2012, 11:14 pm
Code: [Select]
//"Arduino Garage Tennis Ball."  A distance sensor with LED Stoplights for people with multiple vehicles going into a limited space.
#include <Servo.h> // includes library

Servo servoLeft;
Servo servoRight;

const int triggerPin = 8;
const int echoPin = 9;
int redPin=13;
int yellowPin=12;
int greenPin=11;
long duration;
long distance;

void setup(){
  servoLeft.attach(10);
  servoRight.attach(7);
 
 
  pinMode (13, OUTPUT);
  pinMode (12, OUTPUT);
  pinMode (11, OUTPUT);
  Serial.begin(9600);
}

void loop()
{
  servoLeft.write(0);
  servoRight.write(180);
 
  int stopDistance=6;//object distance in inches from sensor that you want to trigger the Red LED.
  int warnDistance=60;//object distance in inches from sensor that you want to trigger the Yellow LED.
  pinMode(triggerPin, OUTPUT);
  digitalWrite(triggerPin, LOW);
  delayMicroseconds(2);
  digitalWrite(triggerPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(triggerPin, LOW);
  pinMode(echoPin, INPUT);
  duration = pulseIn(echoPin, HIGH);
  distance = duration / 72 / 2;//determines distance in inches of object from sensor by microseconds to inches formula.
  if (distance >= warnDistance){
    digitalWrite (redPin, LOW);
    digitalWrite (yellowPin, LOW);
    digitalWrite (greenPin, HIGH);
  }
  else if((distance>stopDistance) && (distance<warnDistance)){
    digitalWrite (redPin, LOW);
    digitalWrite (yellowPin, HIGH);
    digitalWrite (greenPin, LOW);
  }
  else{
    digitalWrite (redPin, HIGH);
    servoLeft.write (0);
    delay (2000);
    servoRight.write (0);
    delay (2000);
   
    digitalWrite (yellowPin, LOW);
    digitalWrite (greenPin, LOW);
  }
  Serial.println (distance);
}


Here's what it does:

http://www.youtube.com/watch?v=WO_lZbVlgPM&feature=youtu.be

Any help on what I'm missing?
Title: Re: My first robot
Post by: JimboZA on Jun 17, 2012, 06:00 am

I built a paper shell for my robot


How do you mean, paper, Duane? Like paper mache?

Title: Re: My first robot
Post by: hoff70 on Jun 17, 2012, 06:27 am
Code: [Select]
/*MAEP 2.0 Navigation
by Noah Moroze, aka GeneralGeek
This code has been released under a Attribution-NonCommercial-ShareAlike license, more info at http://creativecommons.org/licenses/
PING))) code by David A. Mellis and Tom Igoe http://www.arduino.cc/en/Tutorial/Ping
*/

#include <Servo.h> //include Servo library

const int RForward = 0;
const int RBackward = 180;
const int LForward = RBackward;
const int LBackward = RForward;
const int RNeutral = 90;
const int LNeutral = 90; //constants for motor speed

//////
const int triggerPin = 8;
const int echoPin = 9;  //Sharp infrared sensor pin

/////
const int dangerThresh = 10; //threshold for obstacles (in cm)
int leftDistance, rightDistance; //distances on either side
Servo panMotor;  
Servo leftMotor;
Servo rightMotor; //declare motors
long duration; //time it takes to recieve PING))) signal

//////
long distance;

/////
void setup()
{
 rightMotor.attach(11);
 leftMotor.attach(10);
 panMotor.attach(6); //attach motors to proper pins
 panMotor.write(90); //set PING))) pan to center
 Serial.begin(9600);
}

void loop()
{
 int distanceFwd = ping();
 if (distanceFwd>dangerThresh) //if path is clear
 {
   leftMotor.write(LForward);
   rightMotor.write(RForward); //move forward
 }
 else //if path is blocked
 {
   leftMotor.write(LNeutral);
   rightMotor.write(RNeutral);
   panMotor.write(0);
   delay(500);
   rightDistance = ping(); //scan to the right
   delay(500);
   panMotor.write(180);
   delay(700);
   leftDistance = ping(); //scan to the left
   delay(500);
   panMotor.write(90); //return to center
   delay(100);
   compareDistance();
 }
}
 
void compareDistance()
{
 if (leftDistance>rightDistance) //if left is less obstructed
 {
   leftMotor.write(LBackward);
   rightMotor.write(RForward); //turn left
   delay(500);
 }
 else if (rightDistance>leftDistance) //if right is less obstructed
 {
   leftMotor.write(LForward);
   rightMotor.write(RBackward); //turn right
   delay(500);
 }
  else //if they are equally obstructed
 {
   leftMotor.write(LForward);
   rightMotor.write(RBackward); //turn 180 degrees
   delay(1000);
 }
}

long ping()
{
 // Send out PING))) signal pulse
 pinMode(triggerPin, OUTPUT);
 digitalWrite(triggerPin, LOW);
 delayMicroseconds(2);
 digitalWrite(triggerPin, HIGH);
 delayMicroseconds(5);
 digitalWrite(triggerPin, LOW);
 
 //Get duration it takes to receive echo
 pinMode(echoPin, INPUT);
 duration = pulseIn(echoPin, HIGH);
 
 
 //Convert duration into distance
 return duration / 29 / 2;

{
 
 
 Serial.println (distance);
}}


I'm trying to get serial output of what the sensor is seeing. It works with the first sketch I posted but I'm not having any luck with this...

This prints to the monitor when something gets close to the threshold:

Code: [Select]
/*MAEP 2.0 Navigation
by Noah Moroze, aka GeneralGeek
This code has been released under a Attribution-NonCommercial-ShareAlike license, more info at http://creativecommons.org/licenses/
PING))) code by David A. Mellis and Tom Igoe http://www.arduino.cc/en/Tutorial/Ping
*/

#include <Servo.h> //include Servo library

Servo servoLeft;
Servo servoRight;
Servo servoScan;

//////
const int triggerPin = 8;
const int echoPin = 9;  //Sharp infrared sensor pin

/////
///const int dangerThresh = 10; //threshold for obstacles (in cm)
int leftDistance, rightDistance; //distances on either side

long duration; //time it takes to recieve PING))) signal

//////
long distance;

/////
void setup()
{
  servoLeft.attach(11);
  servoRight.attach(10);
  servoScan.attach(6); //attach motors to proper pins
  servoScan.write(90); //set PING))) pan to center
  Serial.begin(9600);
}

void loop()
{
  int dangerThresh = 10;
 
 
  ///int distanceFwd = ping();
 
   pinMode(triggerPin, OUTPUT);
  digitalWrite(triggerPin, LOW);
  delayMicroseconds(2);
  digitalWrite(triggerPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(triggerPin, LOW);
  pinMode(echoPin, INPUT);
  duration = pulseIn(echoPin, HIGH);
  distance = duration / 72 / 2;
 
 
  if (distance>dangerThresh) //if path is clear
  {
    servoLeft.write(180);
    servoRight.write(0); //move forward
  }
  else //if path is blocked
  {
    servoLeft.write(90);
    servoRight.write(90);
    servoScan.write(0);
    delay(500);
    rightDistance = ping(); //scan to the right
    delay(500);
    servoScan.write(180);
    delay(700);
    leftDistance = ping(); //scan to the left
    delay(500);
    servoScan.write(90); //return to center
    delay(100);
    compareDistance();
  }
}
 
void compareDistance()
{
  if (leftDistance>rightDistance) //if left is less obstructed
  {
    servoLeft.write(180);
    servoRight.write(180); //turn left
    delay(500);
  }
  else if (rightDistance>leftDistance) //if right is less obstructed
  {
    servoLeft.write(0);
    servoRight.write(0); //turn right
    delay(500);
  }
   else //if they are equally obstructed
  {
    servoLeft.write(0);
    servoRight.write(0); //turn 180 degrees
    delay(1000);
  }
}

long ping()
{
  // Send out PING))) signal pulse
  pinMode(triggerPin, OUTPUT);
  digitalWrite(triggerPin, LOW);
  delayMicroseconds(2);
  digitalWrite(triggerPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(triggerPin, LOW);
 
  //Get duration it takes to receive echo
  pinMode(echoPin, INPUT);
  duration = pulseIn(echoPin, HIGH);
 
 
  //Convert duration into distance
 
  ////return duration / 29 / 2;
 
  distance = duration / 72 / 2;

{
   
 
  Serial.println (distance);
}}


It's getting closer but he's still pretty spastic  :P
Title: Re: My first robot
Post by: cyclegadget on Jun 17, 2012, 07:10 am
In this sketch, I think you need something like this:
Code: [Select]
distance =  ping();
Serial.println (distance);

I say this because I do not see where you are getting the latest value for distance. You define the variable distance before the set-up but, you never change it's value.

Currently, you are using the function ping() to = int distanceFwd .


In your previous sketch you did work with the variable distance:
Code: [Select]
distance = duration / 72 / 2;//determines distance in inches of object from sensor by microseconds to inches formula.
Title: Re: My first robot
Post by: hoff70 on Jun 17, 2012, 07:38 am
Thanks! I edited my last post with some updated code. I'm slowly working my way through the different parts of the sketch to try and understand what is doing what.

Here's the original code:

Code: [Select]
/*MAEP 2.0 Navigation
by Noah Moroze, aka GeneralGeek
This code has been released under a Attribution-NonCommercial-ShareAlike license, more info at http://creativecommons.org/licenses/
PING))) code by David A. Mellis and Tom Igoe http://www.arduino.cc/en/Tutorial/Ping
*/

#include <Servo.h> //include Servo library

const int RForward = 0;
const int RBackward = 180;
const int LForward = RBackward;
const int LBackward = RForward;
const int RNeutral = 90;
const int LNeutral = 90; //constants for motor speed
const int pingPin = 7;
const int irPin = 0;  //Sharp infrared sensor pin
const int dangerThresh = 10; //threshold for obstacles (in cm)
int leftDistance, rightDistance; //distances on either side
Servo panMotor; 
Servo leftMotor;
Servo rightMotor; //declare motors
long duration; //time it takes to recieve PING))) signal

void setup()
{
  rightMotor.attach(11);
  leftMotor.attach(10);
  panMotor.attach(6); //attach motors to proper pins
  panMotor.write(90); //set PING))) pan to center
}

void loop()
{
  int distanceFwd = ping();
  if (distanceFwd>dangerThresh) //if path is clear
  {
    leftMotor.write(LForward);
    rightMotor.write(RForward); //move forward
  }
  else //if path is blocked
  {
    leftMotor.write(LNeutral);
    rightMotor.write(RNeutral);
    panMotor.write(0);
    delay(500);
    rightDistance = ping(); //scan to the right
    delay(500);
    panMotor.write(180);
    delay(700);
    leftDistance = ping(); //scan to the left
    delay(500);
    panMotor.write(90); //return to center
    delay(100);
    compareDistance();
  }
}
 
void compareDistance()
{
  if (leftDistance>rightDistance) //if left is less obstructed
  {
    leftMotor.write(LBackward);
    rightMotor.write(RForward); //turn left
    delay(500);
  }
  else if (rightDistance>leftDistance) //if right is less obstructed
  {
    leftMotor.write(LForward);
    rightMotor.write(RBackward); //turn right
    delay(500);
  }
   else //if they are equally obstructed
  {
    leftMotor.write(LForward);
    rightMotor.write(RBackward); //turn 180 degrees
    delay(1000);
  }
}

long ping()
{
  // Send out PING))) signal pulse
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
 
  //Get duration it takes to receive echo
  pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);
 
  //Convert duration into distance
  return duration / 29 / 2;
}
 


Along with the project link: http://www.instructables.com/id/How-To-Make-an-Obstacle-Avoiding-Arduino-Robot/

Title: Re: My first robot
Post by: DuaneB on Jun 17, 2012, 08:10 am
Hi,

Regarding the paper body shell, I made a few paper templates and ran them for a while before cutting a final version from plastic card. The plastic card version is reinforced in the joins using epoxy putty. It works well as a quick way to build a body.

Two other ideas I have seen are paper craft, these are printed nets that you can download, cut out and fold to get cars, tanks, planes, robots etc.

Another nice idea I have seen is cutting bodyshells from aluminium baking trays, same idea as paper nets, but these are easy to weather and dent for a post apocalyptic look.

Off topic - (only a little bit, why shouldn't our robots have decent bodyshells ?)

An example of some not quite post apocalyptic weathering on a plastic bodyshell of mine -

(http://2.bp.blogspot.com/-gE6OJXJBCY8/TxFEUX7n3xI/AAAAAAAAAMI/f3D_a5gTBUA/s320/heap_r10.jpg)

More here -

http://rcarduino.blogspot.com/p/cars.html

Duane B

rcarduino.blogspot.com (http://rcarduino.blogspot.com)
Title: Re: My first robot
Post by: JimboZA on Jun 17, 2012, 08:51 am
I do like the Baja Bug...

I found some paper nets- so far only London buses but Google will find more when I search properly. Thanks for that idea.

Edit...There are some nice nets here at Papertoys (http://www.papertoys.com/)

Seems I need to pop down to the China Mall or whatever it's called today for a look around at toys. Basically an aircraft hangar sized mall with individual shops all selling cheap junk... might find a toy or two to use.
Title: Re: My first robot
Post by: hoff70 on Jun 17, 2012, 07:30 pm
Nice work on the baja!  I like the weathered look, in fact I thought I was looking at a real car  8)

I decided to give the copy/paste a rest. It's really confusing and I'm learning more by "writing" code than just tinkering with other peoples.

I'm just starting over here:

Code: [Select]
#include <Servo.h>

Servo servoLeft;          // Define left servo
Servo servoRight;         // Define right servo
Servo servoScan;          // Define US scan servo

void setup() {
 servoLeft.attach(10);  // Set left servo to digital pin 10
 servoRight.attach(9);  // Set right servo to pin 9
 servoScan.attach(11);  // Set scan servo to digital pin 11
}

void loop() {            // Loop through motion tests
 forward();             // Example: move forward
 delay(2000);           // Wait 2000 milliseconds (2 seconds)
 reverse();
 delay(2000);
 turnRight();
 delay(2000);
 turnLeft();
 delay(2000);
 stopRobot();
 delay(5000);
 servoScan.write(90);
 
 ///scan

 
}

// Motion routines for forward, reverse, turns, and stop
void forward() {
 servoLeft.write(0);
 servoRight.write(180);
}

void reverse() {
 servoLeft.write(180);
 servoRight.write(0);
}

void turnRight() {
 servoLeft.write(180);
 servoRight.write(180);
}
void turnLeft() {
 servoLeft.write(0);
 servoRight.write(0);
}

void stopRobot() {
 servoLeft.write(90);
 servoRight.write(97);
 //////
 
 if (stopRobot) {
   servoScan.write(0);
   delay(1000);
   servoScan.write(180);
   delay(1000);
   servoScan.write(90);
   
 }
   
   /////
 {
 }}


I need to get the "scan" servo code more in line with the rest of the sketch and work on "if" "else" but I understand a lot more about what's happening now. I also had to regroup some on the hardware because 90 wasn't stopping one of my servo's. Weird that it took a value of 97... but it now stops. That was causing me some grief.

I added a longer delay for the STOP, plus 1 sec delays on the scanning servo but it seems like there is some kind of accumulation because it stops for 7 seconds. I'm guessing that the scan + motor delay is doing this?

I plan on just working towards:

Forward until obstacle- stop- scan R & L- print values- reverse.  Then work from there.

I have all the puzzle pieces, I just need to fit them together.

I'm a hobby machinist/weldor so I hope to take what I'm learning and scale it up to some type of yard rover.

Here he is:

http://www.youtube.com/watch?v=RyPL9w83QXs&feature=youtu.be
Title: Re: My first robot
Post by: hoff70 on Jun 25, 2012, 10:08 pm
Well, here he is:

http://www.youtube.com/watch?v=Sit6Zq13QN4&feature=youtu.be

Code: [Select]
/*MAEP 2.0 Navigation
by Noah Moroze, aka GeneralGeek
This code has been released under a Attribution-NonCommercial-ShareAlike license, more info at http://creativecommons.org/licenses/
PING))) code by David A. Mellis and Tom Igoe http://www.arduino.cc/en/Tutorial/Ping
*/

#include <Servo.h> //include Servo library

const int RForward = 0;
const int RBackward = 180;
const int LForward = RBackward;
const int LBackward = RForward;
const int RNeutral = 97;
const int LNeutral = 90; //constants for motor speed
const int pingPin = 12;
const int irPin = 13;  //Sharp infrared sensor pin
const int dangerThresh = 10; //threshold for obstacles (in cm)
int leftDistance, rightDistance; //distances on either side
Servo panMotor; 
Servo leftMotor;
Servo rightMotor; //declare motors
long duration; //time it takes to recieve PING))) signal

void setup()
{
  rightMotor.attach(11);
  leftMotor.attach(10);
  panMotor.attach(6); //attach motors to proper pins
  panMotor.write(90); //set PING))) pan to center
}

void loop()
{
  int distanceFwd = ping();
  if (distanceFwd>dangerThresh) //if path is clear
  {
    leftMotor.write(LForward);
    rightMotor.write(RForward); //move forward
  }
  else //if path is blocked
  {
    leftMotor.write(LNeutral);
    rightMotor.write(RNeutral);
    panMotor.write(0);
    delay(500);
    rightDistance = ping(); //scan to the right
    delay(500);
    panMotor.write(180);
    delay(700);
    leftDistance = ping(); //scan to the left
    delay(500);
    panMotor.write(90); //return to center
    delay(100);
    compareDistance();
  }
}
 
void compareDistance()
{
  if (leftDistance>rightDistance) //if left is less obstructed
  {
    leftMotor.write(LBackward);
    rightMotor.write(RForward); //turn left
    delay(500);
  }
  else if (rightDistance>leftDistance) //if right is less obstructed
  {
    leftMotor.write(LForward);
    rightMotor.write(RBackward); //turn right
    delay(500);
  }
   else //if they are equally obstructed
  {
    leftMotor.write(LForward);
    rightMotor.write(RBackward); //turn 180 degrees
    delay(1000);
  }
}

long ping()
{
  // Send out PING))) signal pulse
  pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
 
  //Get duration it takes to receive echo
  pinMode(irPin, INPUT);
  duration = pulseIn(irPin, HIGH);
 
  //Convert duration into distance
  return duration / 29 / 2;
}


The right motor is pin 11
The left motor is pin 10
the scanning servo is pin 6

the trig is pin 12
the echo is pin 13

I just powered the servo motors with a 5V regulator with a heat sink and the SR04 off the Arduino.

I guess I'll take him apart now. I really need several boards for tinkering...
Title: Re: My first robot
Post by: cyclegadget on Jun 25, 2012, 11:08 pm

Nice job! It looks like the object avoidance is working. It might work a little quicker if it turned when backing-up. I have a similar Tamiya track set-up and I want it to work similar to yours someday.

Keep it up!
Title: Re: My first robot
Post by: hoff70 on Jun 26, 2012, 02:25 am
Thanks!  His vision is a little narrow and the he tends to lose his tracks  XD The toy I built him from wasn't really designed to have power running to the wheels.  It was a fun little project though!
Title: Re: My first robot
Post by: cyclegadget on Jun 26, 2012, 02:53 am

The Tamiya track platform I built has the same problem of loosing it's tracks. The only answer for me was to only do slow or partial turns. On a slick floor it is not bad but, put it on carpet and the first 90 degree turn will pull the track off.

Tracks are fun but, I think I am going to a wheeled project next.
Title: Re: My first robot
Post by: DuaneB on Jun 26, 2012, 07:01 am
Hi,

Same here, the Tamiya tracks work well on tiled floors but are hopless on stone/concrete/tarmac/carpet etc.

Here is a more off road orientated Tamiya of mine -

(http://2.bp.blogspot.com/-XEWDhTelluk/TxByajear2I/AAAAAAAAAKc/WpZGz7Y5Iy0/s1600/pb151510.jpg)

Its a rock crawler so slow enough to convert to autonomous operation, its also supports front and rear steering. I image that the turning circle of wheeled vehicles would be a bit frustrating without this front/rear steering capability to tighten the turn radius.

It also supports crab steering so you could sort of 'side step' obstacles - might add another dimension to a project, when to turn and when to crab steer.

Duane B

rcarduino.blogspot.com (http://rcarduino.blogspot.com)
Title: Re: My first robot
Post by: cyclegadget on Jun 26, 2012, 03:08 pm

Cool jeep DuaneB!

I have the running gear of a 1/10th scale Tamiya Clod Buster. I am considering using it. I need to get a reversing speed control though, one that would be real cheap.
Title: Re: My first robot
Post by: hunter2379 on Jun 28, 2012, 09:53 pm
Good Job! Looks good. There are momentary switches you could try to add to it. They can help guide the robot. I think someone already mentioned the PING Sensor.
Title: Re: My first robot
Post by: perennial on Jun 29, 2012, 07:53 am
i see your instrument photo for build robot projects.
i am also interest build user friendly robots.

Generator on rent (http://powerrental.co.in/index.php)
Title: Re: My first robot
Post by: hoff70 on Jul 01, 2012, 08:27 am
Good to know the tamiya also throws it's tracks. I was considering one but I would have been disappointed. I wonder if the dagu rover 5 has the same problem?
Title: Re: My first robot
Post by: cyclegadget on Jul 01, 2012, 03:31 pm

This is the third page of a thread about the Dagu, Nick Gammon says his tracks tend to come off. http://arduino.cc/forum/index.php/topic,82618.30.html

Interesting bot, the thread has videos.
Title: Re: My first robot
Post by: keeper63 on Jul 01, 2012, 07:02 pm
Do operators of tanks/other tracked vehicles often "turn in place"? In videos of operation of such vehicles, I don't think I've ever seen this. If it isn't done often, perhaps the reason why is to prevent the throwing of the track due to the huge side-loading?

Even so, it can be seen that the kit was not really designed to be used the way the hoff70 is using it - with driven tracks. What you might do is get another one of those kits (if you haven't already - if it were me, and I saw that, I'd buy out every last one), and add extra wheels in between the end wheels. Try two extra, first, then four. You'd have to redesign your chassis, of course, to handle this.

Another thing to try would be to lower the speed of the servos (if possible) when turning. Finally, you could just avoid 90 degree turns...
Title: Re: My first robot
Post by: hoff70 on Jul 01, 2012, 07:24 pm
You may be right cr0sh. At first I noticed that it threw the track when I turned using 1 motor. It was better with 2 running opposite but still not great.  Since other tracked bots have the same problem the side loading must be the issue.

Kind of a bummer because I want to do a better tracked bot in the future.

And yea, they only had 1 of the bulldozer kits but I picked up a few more kits that had wheels. Not as cool as the dozer though  :P
Title: Re: My first robot
Post by: cyclegadget on Jul 02, 2012, 12:21 am

Because the chassis has no suspension, the load is not even across all of the wheels. Depending on weight placement, some wheels will only barely touch the track. On a modern tank, they seem to use air ride and each wheel has some force on it all of the time.

After running it stock out of the box, I modified my track chassis, I got a plank of wood similar to the original but longer. I have the motors hanging off the back instead of in the middle of the chassis. I used all of the track that came with the track chassis kit. So, wheel base is about 1 inch longer and I have the small idler wheels spread out towards the ends with one in the middle of the track run.

I have not yet tested my lengthened version yet so, I don't know if it will help or not.
Title: Re: My first robot
Post by: zoomkat on Jul 02, 2012, 06:52 am
Quote
Do operators of tanks/other tracked vehicles often "turn in place"? In videos of operation of such vehicles, I don't think I've ever seen this. If it isn't done often, perhaps the reason why is to prevent the throwing of the track due to the huge side-loading?


Real tracked equipment have tracks with raised splines and split bogie wheels to prevent side slippage of the tracks under the bogies. Most big equipment have somewhat smooth tracks to allow some slippage on the surface they are on when turning. The exception are the bulldozers that have cleated tracks. In my young days I got to operate both a large tracked front end loader and a bulldozer on a construction project. The front end loader skidded around easily on smooth surfaces. The bulldozer was a different animal. The cleats lock it to the ground and turning it was somewhat like tightly turning a 4 wheel drive manual transmission vehicle on pavement (aka, gear train lockup). When a bulldozer is spun around, the engine loads down and what ever is under it gets totally ground up (that includes pavement!).

http://www.youtube.com/watch?v=7uRxnw0bKCY
Title: Re: My first robot
Post by: oric_dan on Jul 04, 2012, 01:09 am
With the Tamiya tracks, you have to mount them using a little more tension
than you might be comfortable with, and make the turns [on carpet] by
driving the treads in opposite directions, and usually not use max speed.
If you try to turn by driving only one track, it'll likely come right off.
Title: Re: My first robot
Post by: hoff70 on Jul 13, 2012, 09:09 pm
Well, he looked so sad sitting there with no brains or batteries that I decided to work on him some more. I didn't want to use another Arduino to run him so I figured I'd attempt to use a stand alone chip. Here's a thread on that project:

http://arduino.cc/forum/index.php/topic,114057.0.html

Now that I have a little 8 pin arduino (I call it the retarduino, after it's creator  :P) I can, hopefully, get my bot working. And a little more permanent.

When I had him breadboarded I used the Arduino to run 5 pins which ran the 3 servos and the US sensor. For servo power I just had a 5V regulator supplying voltage to the servos and an 8XAA battery pack. I noticed that the heat sink on the regulator got pretty hot so I'd like some input on that. Maybe use fewer batteries so the regulator doesn't have to deal with so much voltage?

I noticed that the servo plugs would line up with the ground and 5V side of the regulator so I did this little pinout:

(http://i711.photobucket.com/albums/ww112/jhoff/temporary-192.jpg)

The 2 servo power wires (From the 3 servos) will go straight to the regulator and the 3rd pin will be the signal from the retarduino. Does anyone see any problems with this?  I was also planning on putting a power LED on it and maybe a capacitor across the battery leads.

Here's another mockup:

(http://i711.photobucket.com/albums/ww112/jhoff/temporary-193.jpg)

I think the heatsink looks pretty cool  8) Like an engine exhaust or something.

I still need to do some more breadboard testing and I may redoux the chassis because I found another dozer kit  8) I'll move on to that when/if I get the electronics sorted.

Any input, advise?  I'm just making this up as I go so any help would be welcome!
Title: Re: My first robot
Post by: cyclegadget on Jul 14, 2012, 12:33 am

Nice work! Good idea moving to a breadboard is a cool way to go!

If you are using alkaline batteries, each on puts out 1.5volts. You need at least 7 volts for a 7805 regulator to operate properly. Therefore, you need 5 cells to produce 7.5 volts which will be plenty.
Title: Re: My first robot
Post by: hoff70 on Jul 14, 2012, 02:06 am
Thanks! I still have some work to do on the little controller board. I want to add a switch and a power LED on the bottom board plus break out the programming pins and the 3 unused pins in case I want to upgrade the sketch in the future. Maybe add some lights or make him talk  :P The red LED is a power indicator for the retarduino and the green is hooked to pin 13 which is also the echo input.

I'm also a little stuck on bringing the power from the battery pack to the board. I'm not sure if I want to just solder the leads in place or use a barrel jack or 9V adapter or something... I haven't tested it with the bot sketch yet but all the pins work with "blink" so I hope it's OK.
Title: Re: My first robot
Post by: cyclegadget on Jul 14, 2012, 03:26 am

Sounds like a good plan. If you have screw terminals available, they would work well for temporary wiring like your battery pack.
Title: Re: My first robot
Post by: hoff70 on Jul 18, 2012, 03:06 am
I finally went with a 9V battery adapter plugged into the 8XAA holder I had. I tried using a 4XAA but it didn't work. I know, you told me so  :P It lit the LED's but the chip wasn't working.

I'm hoping this is the final version:

(http://i711.photobucket.com/albums/ww112/jhoff/IMG_0014.jpg)

The header plug is off some old computer cables I had around and they are connected to the pins needed to program the chip, I also added main power led and a switch.

Here's my little programming deal hooked up:

(http://i711.photobucket.com/albums/ww112/jhoff/IMG_0015.jpg)

In the pic the chip is in the Arduino but I have to remove it in order to program the bot.

I have 10 pins broken out and the way the bot is now I only need 5 so I can maybe add some functions in the future.

If all the electronics check out OK I'm going to redo the chassis and give him a shorter wheel base. I'm hoping that will help the tread throwing problems by (hopefully) reducing the side loading on the tracks when turning.