Let's Make Robots!

berginer bot V2

ChuckCrunch's picture
navigate around via ultrasound and IR taking pictures and vidio soon
Cost to build: 
$250
Time to build: 
70 hours
Weight: 
800 grams

this is the up grade.

Parts,

  • Arduino uno
  • PING)))
  • 3 x Sharp IR
  • FlyCamOne v2 by eco
  • 22-1294 1x Press Me message recorder  (NEW! 12/9/2011)
  • Servo
  • 4x 7805cv 5v regulators (New! 29/9/2011)
  • 11.1 LiPo 800mAa
  • Nice new box to keep him contained
  • polymorph servo mount that is some cool/hot stuff

still a basic doge bot but now it can get out of a dead end :) new for me  .

need to implement the Sharp IR in software this is addition to the  Ping increase the chance of detecting an object ,also may need to put something on the 2 fount corners ,its having hang ups and not missing edges, compass is a plain also

found something funky on eBay if it get's hear (msg rec).an attempt an Bass player bot Ar la YDM but medley instead of precision something im going to work on when everything else is working

still got a lot to learn and practice. the little blue light you see when i tern it on is a low battery light ,LMR ROCKS!  Wooooo

the guts, in the top left coner is the motor driver L298 http://www.hvwtech.com/products_view.asp?ProductID=617 for a better look and more info   little bit of overkill :)

2.9.2011

added compass, it works, now to get it to work with the bot a bit better , research is needed , or has someone else done something on compass's . ill get it working better and ill post a video    

http://www.sparkfun.com/products/7915     link to compass

4.9.2011

Jim Winburn  thank you.your course correction code is a lot of help .added some stuff just to fit my program

 

http://letsmakerobots.com/node/28666      link to jim

wile my battery is charging  i had an idea, it happens.

http://www.rcgroups.com/forums/showthread.php?t=1378935

see this i have 1 well the bits that are left after i had a little play and a big crash :) well now i really owned this helly so 2 mini servos with push rods (short) ,2 high speed motors , RC RX/TX 2.4ghz 5 chan ,LiPo battery 11.1V800mAh + holder and chager,and a cool as RC cam FlyCamOne V2 by ECO  total price $230 the price of the helley  you can get them cheaper  

http://www.rc-model-test.com/testbericht-modellflug-modellfliegen-modellflugzeug-flugzeug/elektronik/flycamone-eco/                   link to info on cam

my thoughts on this are the cam need's to go in  don't even need to hack it, Tourist bot , Camrun,. but before that im not happy with tracks they get ripped off turning on carpet Can fix sports tiers and better gear motors and a caster

  

6,9,2011 ba ha ha ha

what was

what is

ok i try to add the compass and it just got to much for the little gray cells i got a few things backwards in programing .so trying to put things right it got messed up .take a few steps back and re wrote a good lump of code.

  • PMW motor speed control
  • i used the difference in the readings of the 2 Sharp IR's to control the speed of the motors .
  • mounted Sharp's above weals . to stop hang ups 
  • increased height of the ping ,too low getting reflections from cracks and mats .may need to go higher again ?
  • set up program for the flycamone . the cam is made to be used with hobby RC powered by your receiver just like a servo and get its commands via the same method. so i sent servo commands to it 0 for off and 180 for on , in the book that came with the cam it had set up instructions for the different modes . using this as a guide i wrote timed on's and off's to set the cam up.1 small issue i need to rotate the picture 180deg to (cockpit view) instead of (mounted under the model view),this could be also set the same way
  • ok i got a cam big deal so when do i take a pic ? well every time you stop to find your way take a photo of the thing that stopped you  .

 

some photos from his first outing, nothing exciting  but it works

it almost need's a real name, now that it has a task, camrun/ camwalk ,cambot ,tourist bot. motophoto  foot shot bot ;) ?/?

my inspiration     http://letsmakerobots.com/node/5027   nice idea Oddbot

some more photos from the bot

8/9/2011

not going to make a new video , until my robot can do most of the filming, i think this is a good thing , some vague idea i have a cam bot to film new projects ? 

placing a beacon on top of the target get the robot to point the cam at the target and stay at a good distance from the target wile filming .not thinking of tilting the cam at this point just to get the bot to adjust it's angle .i think some kind of side project for some servos or steppers ? ..still got things to finish code code and more code kind of stuck trying to get 3 IR rang sensors to work to getter had to go back an rewrite motor driver code again and the Ping avoidance code just to get back to working on the IR code. i think this is the last re-wright of the motor driver code but probably not ,, 

9/9/2011

the caster weal im am using is junk need a new 1 .getting a ball caster from littlybird electronics and a bunch of IR remote receivers. the sharps im using are a pain and i don't really need to know how far away an object is just that it's there , besides i have the ping for that kind of thing . so IR proximity is on the cards after the weekend, if my parts arrive . i have been playing with a IR receiver i got out of a DVD player it stays high untill it receves a signal and then gos low pity simple i think much simpler  than dealing with 3 analog readings just for the moment     

12/9/2011

Things from China in the mail

and 60minuits later

well now i own it and my bot has control

(just a basic  hack power and the buttons record and play)

29/9/2011

Tooth ache stopped me thinking,  so that's fixed now i can get back to the bot .

i need to get the weals right, it slips a lot and has no traction  what a pain in the ass, :(

i remade this robot /remaking

all new code, power system up to 6A total , more sensors , new teds , ill post it up as a new robot some time soon when i can finish a few jobs on it . or not i get side tracked and might just build something completely new.,

bit board with toys and the sense of achievement is piss poor at best . been thinking about ROS and the turtle bot thinking mostly. skimmed a few web sites n stuff . i need to broaden my horizons . i would like my robots to be useful and help people not just toys to amuse myself, because that's getting old and point less

chuck crunch           

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
The Unknown's picture

That is a really nice robot. Chuck I like ur ideas of making robots! You are really talented!

 

ChuckCrunch's picture

but i think i reached the limit of my "talent" need something to push it to a new level , maybe get some real training or a new skill well something to get the creative thinking going again (robot block)

thanks again for the kind words  

ChuckCrunch's picture

i remade this robot /remaking

all new code, power system up to 6A total , more sensors , new teds , ill post it up as a new robot some time soon when i can finish a few jobs on it . or not i get side tracked and might just build something completely new.,

bit board with toys and the sense of achievement is piss poor at best . been thinking about ROS and the turtle bot thinking mostly. skimmed a few web sites n stuff . i need to broaden my horizons . i would like my robots to be useful and help people not just toys to amuse myself, because that's getting old and point less

chuck crunch            

Stephen P's picture

I like it in the tank configuration all it needs now is a cutting blade to do the edges and lawn 

 

Geir Andersen's picture

Sorry to be a pain Chuck, but I still don’t understand this code.

void loop()
{
  for(pos = 0; pos < 50; pos += 2)  // point servo fwords
    {                                 
      myservo.write(90);              
      delay(15); 
    }
  OVOID();
  }

Still there is a loop that isn’t doing anything. As you set the server positon to 90 each time it seems rather pointless. Then you could probably just have written;

void loop()
{
  myservo.write(90);              
  delay(375); 
  OVOID();
 }


What you probably is after is a smooth movement of the servo from 0-50. Then the code should look like this;


void loop()
{
  for(pos = 0; pos < 50; pos += 2)  // point servo fwords
    {                                 
      myservo.write(pos);              
      delay(15); 
    }
  OVOID();
  }

It will slam back to 0 the next time the main loop is executed, but at least you get a smooth movement from 0 - 50

ChuckCrunch's picture

 improved the over all performance of my code much faster , 

ChuckCrunch's picture

i need to move it to 90deg position at the start to take the first reading of the Ping .. your first example look's like it a better choice for my needs ,

Im new to the Aeduino and your help is appreciated i will add this in the needed places thank you,

Chuck

ChuckCrunch's picture

/*
 this coad put to gether by Charlie Watson
 thank you to Geir Andersen servo code help
 joe the maker of homer
 */
 #include <Servo.h>
 Servo myservo; 
 Servo cam;
int leftspeed = 0;
int rightspeed = 0;
const int maxspeed = 255;
int pos = 0;    // variable to store the servo position
const int IRdis = 200; // inferred bufferzone
 const int pingPin = 5; // constant for PING pin
int val = 0;    //  UNUSED
int val2 = 0;   //left value,check,ping
int val3 = 0;  //right value,check, ping
int val4 = 0;  //used for ping
int val5 = 0; //IR 0
int val6 =0; //IR 1
void setup() 
{
  myservo.attach(4);    //servo on pin4
  cam.attach(10);       // flycamone v2 pin10
  pinMode(5,INPUT);     //Ping Ultrasonick  pin5
  pinMode(7,OUTPUT);    // enable pin
  pinMode(8,OUTPUT);    //left REV
  pinMode(3, OUTPUT);   //enable pin
  pinMode(12, OUTPUT);   //left Fwd
  pinMode(13, OUTPUT);   //right rev
  pinMode(11, OUTPUT);   //right fwd
  Serial.begin(9600);
  cam.write(0);           //set up for taking pohtos with a flycam1 v2 i read the manual
  delay(5000);             // let cam power up
  cam.write(180);          //set cam to cockpit view flip 180deg
   delay(10000);           // hold at 180 for  10seconds this will set the flip
   cam.write(0);            //0 posion for off
   delay(5000);              //wate to see red ,red, green from flycam1 v2 LED
  
   cam.write(180);           //the flycan1 v2 defult startup mode is video  set mode to serial picturs >(photo every 2 seconds) from video
delay(3000);                 //hold on (180deg)for 3seconds switchs from vidio to serial pictures
cam.write(0);                // off for a second
delay(1000);                 //wate the second
cam.write(180);              //set to next mode (photo)
delay(3000);                 //hold on (180deg) for 3seconds, switch's from serial picturs to photo(1 photo on comand )                  
cam.write(0);                // off and go to the main
}
//MAIN LOOP TRY TO KEEP SIMPLE
void loop(){
                               
    myservo.write(90);              
    delay(375); 
  OVOID();
  }

 void PING()                     //from the arduino exampls
 {
    long duration, inches, cm;
    pinMode(pingPin, OUTPUT);
  digitalWrite(pingPin, LOW);
  delayMicroseconds(2);
  digitalWrite(pingPin, HIGH);
  delayMicroseconds(5);
  digitalWrite(pingPin, LOW);
    pinMode(pingPin, INPUT);
  duration = pulseIn(pingPin, HIGH);

  // convert the time into a distance
  cm = microsecondsToCentimeters(duration);
  val4 = cm;
 }
  
long microsecondsToCentimeters(long microseconds)
{
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}

void YELD_LR()

  analogWrite(3,0);analogWrite(11,0);//stop all motors
  takepick();     // take a photo
}

void REVERS()
{
  digitalWrite(8,LOW);
  digitalWrite(7,HIGH);
   digitalWrite(13,HIGH);
  digitalWrite(12,LOW);
  analogWrite(11,leftspeed);
  analogWrite(3,rightspeed);
   CHECK();
   if(val2  && val3 < 30 ){REVERS();}
   IRLR();
   if (val5 && val6 > IRdis  ){REVERS();}
}

void FWARD()
{
  IRLR();
  digitalWrite(7,LOW);
  digitalWrite(8,HIGH);
   digitalWrite(12,HIGH);
  digitalWrite(13,LOW);
  analogWrite(11,rightspeed);
  analogWrite(3,leftspeed);
}

void CHECK(){                                // in steps of 1 degree
  myservo.write(0);              // tell servo to go to position in variable 'pos'
  delay(375);     
  PING();
 val2 = val4; //left value                              
  myservo.write(180);              //
  delay(700);                       //   
PING();
val3 = val4;                              
    myservo.write(90);              //
    delay(375);                       //right value
}

void IRLR(){
val5 = analogRead(0);
val6 = analogRead(1);
if(val5 && val6 > IRdis){REVERS();}
if (val6 - val5 >0){leftspeed = maxspeed -(val6 - val5) * leftspeed / 3.14;rightspeed = maxspeed; }
else if(val6 - val5 <0){rightspeed = maxspeed - (val5 - val6) * rightspeed / 3.14 ;leftspeed = maxspeed;}
else if(val6 - val5 ==0){leftspeed = maxspeed; rightspeed = maxspeed;}
}

void RIGHT_1()
{
  digitalWrite(7,HIGH);
  digitalWrite(8,LOW);
   digitalWrite(12,HIGH);
  digitalWrite(13,LOW);
  analogWrite(11,rightspeed);
  analogWrite(3,leftspeed);
}

void LEFT_1()
{
 
  digitalWrite(7,LOW);
  digitalWrite(8,HIGH);
   digitalWrite(12,LOW);
  digitalWrite(13,HIGH);
  analogWrite(11,rightspeed);
  analogWrite(3,leftspeed);
}

void OVOID(){                          
 PING();
   if (val4 <= 30 ){
   YELD_LR();CHECK();
        if (val2 > val3){LEFT_1();}
            else {
                 if (val3 > val2){RIGHT_1();}else{if(val2 < 15 && val3 < 15 ){REVERS();}}}
                  
   }else{FWARD();}}
 
 void takepick(){       // this is were i triger the flycam1 v2
   cam.write(180);     // no (180deg)
   delay(200);         // small hold to short the cam will not triger 
   cam.write(0);      // and off again
 }
 

GroG's picture

Nice container... is it an AT or ATX PSU box?

ChuckCrunch's picture

it just something picked up at jaycar . same length not quite as wide, i do have 2 empty PSU boxes hear they are just a bit big for the tamiya twin gear box but thay would look good for a bot with all the vents cut into the side , some thing for another day :)