Codename Peek-E

Codename Peek-E is my first robot, well that I built anyway. I own a lot of robots but this is the first time I tried to build one. Peek-E is based off of the "Start Here" robot. I orignally wanted to build a YDM, but after reading all about it, I decided that it is too advanced for me (for now).

That is where this robot comes in. My ultimate goal for this robot is simply to teach me, so that I can build better robots.

It has taught me a lot so far. The biggest thing it has taught me is that things rarely go according to plan.

Although Peek-E started out not knowing what to make of his world, he and I are starting to understand more or it! (The code I am currently using is just a simple rewrite of the "Start Here" code.)

I would like to thank everyone that has helped me thus far.

-Jinn-

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 

Just a picture of the Picaxe all connected :)

 

Peek-E chilling on the desk!

 

Here you can see the access point to the Picaxe. The Battery box on the rear swivels to allow for access.

 


Update:(11-13-09)

I'm an idiot! No seriuosly, I am.

My robot would always turn toward the object in his way, thus not chosing the best path. I couldn't figure out why. That is until I realized that my lturn and rturn are reversed, duh!

In my code:

' Decide which is the better way:
if b1<b2 then
gosub body_lturn
else
gosub body_rturn
end if
return

I just changed it to:

' Decide which is the better way:
if b1<b2 then
gosub body_rturn
else
gosub body_lturn
end if
return

And now Peek-E is smart. Lol.

I know I could (should) have changed the actual numbers coresponding to wheel movement, but this was much simpler.


Peek-E: Now with more bumper sticker, HA.

 

Autonomously explores its world.

  • Actuators / output devices: (2) GM9's
  • CPU: Picaxe 28x1
  • Power source: 3 AA Batteries
  • Programming language: Picaxe basic
  • Sensors / input devices: Sharp IR
  • Target environment: Indoors is best

This is a companion discussion topic for the original entry at https://community.robotshop.com/robots/show/codename-peek-e

you should post the code. I

you should post the code. I would like to see the problem. You should have it always driving until it senses something.

Hi
The code is the one from the “Start Here” robot, which leads me to believe that it isn’t a code problem. I think by writing and testing my own code I will be able to see what the problem is.

Nice clean body style
Did you make it or was it a kit.

Umm… like this could ever

Umm… like this could ever be good enough for a kit, lol.

I got the black bases from here.

The Sharp sensor is mounted in a small project box like this. The bigger box in the back is just another slightly larger project box.

And then a inch and a half metal standoffs (x10) to join the two.

 

Sharp IR sensors
The “Start Here” robot uses a Sharp GP2D120, which has a valid detection distance of 4 to 30 cm, or 1.5" to 11.8"

Have you tested just the sensor output by itself, with a meter or a simple program?

Your robot seems to always detect an ADC value higher than “70” which would correspond with a reading greater than 1.37 volts from the sensor. The GP2D120 would deliver up to 3 volts when something is at the 4 cm distance, going down as the object is moved away.

Have you tested just the sensor output by itself, with a meter or a simple program?

Hello

I tested it using the debug method discussed in the “Start Here” instructions. As far as testing it some other way, I wouldn’t know how.

I just tried it again using this code:

main:

readadc 1, b1 ’ takes the voltage returned to analogue pin 1, and puts it into variable b1
debug ’ this draws out all variables to the editor.

goto main

It seems that the lowest number b1 will report is 65, however it usually is around 71. This is with nothing in front of the sensor.

If I put my hand in front of the sensor and slowly move it forward, b1 will report around 192.

So that means that this part of the code needs to be changed to a lower higher number?:

Symbol dangerlevel = 70 ’ how far away should thing be, before we react?

 

 

try readadc10 1, b1 and see

try readadc10 1, b1 and see if that makes a difference. It basically makes the numbers go a lot higher.

 

EDIT: never mind its been a long day ignore my post. I finally read the rest of your post.

Sensor

Tell me Jinnarin

Are you using thee GP2D120 or the GP2D12

Your robot is making almost the same mistakes as Mine and I am using the GP2D12

GP2D120 I think. The top
GP2D120 I think. The top (bottom?) of the sensor says: SHARP 2D120X F 93

Success and Failure!

Yay!! It is working.

Design is flawed maybe? The base is to wide so Peek-E will run into things even when turning away from them.

I think a simple change in the code will fix this though!

Video is on the way!!

Ok I get it now :slight_smile: The

Ok I get it now :slight_smile: The number is distance in MM to the nearest object. What Fritz’s code does is say 70mm is the closest the robot should get before it needs to stop and turn away. So:

readadc 1, b1
If b1 < dangerlevel then
TURN DANGER!!! MOVE AWAY
endif

I think Fritz agnowledged the mistake in his code. He just never fixed the code he posted. His code says if b1 < dangerlevel then no danger. It needs to be if b1 < dangerlevel then DANGER WILL ROBINSON DANGER!

See above Fritz code is
See above Fritz code is flawed. The number returned is the distance in millimeters to the nearest object. Low number = object is close, BIG number = object is far away (or EXTREMELY CLOSE ie too close for the sensor to work properly).

New video

Test run 2 0001 shows what Peek-E is up to now.

I really need to turn the t.v. off when I record video, lol.

New Video

Hey man this is not right!!!

How can I be getting more exited about your robo than mine :slight_smile:

Go Jinnarin Go

Hey, nice progress! Keep

Hey, nice progress! Keep working on it. You might try adjusting the left-right sweep of the sensor to be a bit wider, since your bot is sort of wide. And/or adjust how far your bot turns when it tries to avoid an obstacle.

Great to see it progressing. Nice work.

There is nothing wrong with
There is nothing wrong with the Start Here code, and there is no conversion from an ADC number to a millimeter number. The number is directly from the PICAxe “readadc” command which appears to deliver a number from 0 to 254 corresponding with the voltage read at the pin. So a value of 70 would be (70/254)x5 = 1.37 volts.

He’s showing a consistent value of 60s to 70s readings which would indicate something is boosting the sensor output by a volt or so. Possibly a floating ground, or sensor ground not connected to PICAxe ground thought I don’t know how that would happen.

No you didn’t!

Did you just call my robot fat? Just kidding!

Its thanks to everyone at LMR that I have made it this far!!

I probably hav eit confused
I probably hav eit confused with how interactive C handles the IR sensor. It is either interactive C handling the conversion or its done in the sensor hardware. I would need to hook 1 up ti a picaxe and compare values at known measurements. If it isn’t millimeters its pretty close.

Don’t worry,

you’ll get yours going too! If you are having any problem understanding the code, break it down into smaller pieces and play with your bot, that really helped me see how simple it actually is.

Have fun!