Steven X

Hi I am Steven X I am a modified line follower chassis and serve as a test platform.

Now I will let my builder talk since i do not have any idea what he is doing with me.

Tests are the following:

  1. check distance in front, if distance is < than 20cm stop both motors
  2. execute a sensor sweep left and right and keep the left and the right distance in a variable
  3. compare left and right distance
  4. go to the direction where is more clear space

This is my second project and i used a line follower chassis to mount all the parts i need.

As you see i used the chassis to mount the gear motors, battery and sweep servo.

The leftover of the DVD case (see my Insect Robot) was used to attach the ulra sound sensor to the sweep servo (micro servo...very cheap but have to do the job)

Don't wonder...i will explain the LED's hanging around later ;-)

I put an old DVD (not old but ...let's say not worth to keep) above the motors and the servo to velcro the Arduino on it.

I used two distance pieces and the sweep servo is just mounted with one screw on the base chassis.

Behind the servo is the H bridge for the motors, the space for the Arduino was not enough, but maybe later if I like this little guy I will replace the current Duemilanove with a Nano...but i lost the thread....ok...DVD...

How to attach the DVD on the distance pieces if there is no hole in the top. I will tell you. Burn two holes in the DVD (probably you can not watch it anymore after this action but hey...robots are much cooler than boring movies), pull a cable binder (learned you guys call it cable tie)through the two holes and the one hole on the distance piece...done (see two pics above).

That's it. Nothing else done in terms of mechanics or moving. Right now i am trying to get the programming done. I am a little bit rusty in programming since i did nothing serious in the last couple of years. I could just search for code which is already done by others but that's no fun, i wanna solve this by myself... at least till a certain point.

For testing my code it's not good when this guy is running around, right?

So I put two LED's on the left and the right side to tell me when the motor should run. I am still in the sensor reading and checking the distance left and right after came to an obstacle. Now the sweep servo turns from 90° to 180° then to 0° and then back to 90°

By 180° it's executing a distance measuring and also by 0° Then it compares this two values and will turn to the side with the bigger value of distance. (ok not exactly...right now it just light up the LED on the side where he will go). This is also the reason why no video exists. As soon as he moves the video will follow.

UPDATE April 22 1:18am:

I got the first rough programming done. Steven X is now moving towards until a obstacle is closer than 20cm. If that happens he will do a sensor sweep left and right and compare the values. He will go to the direction where is more clear space ahead.

Please also see the (low quality) video. I built a trap that I can take the video without to chase him through the whole apartment.

Problems:

1. Any smaller angel than 30° to a wall will not let him stop

2. The turns are just 200ms motor power on...will see if i can change this to a smarter solution

Questions:

1. Can i do a continous sensor sweep and check the values in each loop?

2. How to get the turns smarter without wheel decoder encoders?

UPDATE April 25, 10:49am:

After 15 hours in the plane (yeah we was waiting 3 hours to fix a mechanical problem and then for take off clearance in Shanghai. Now 10,000km away from home i will improve the program and post the code in my description.

UPDATE April 25, 11:23am:

Test code is attached now. Please feel free to check it and feedback me if you see that i was totally wrong ;-)

UPDATE May 18, 10:27am:

Did a test run with the Sharp IR sensor and it went well. Now I consider it done and will further use it as a test patform for other sensors, attachments etc.

...oh yeah...about the name...will tell you later ;-)

Ok, now the thing with the name. I got this idea from the DVD i used. It was/ is the movie "Driven to Kill" with Steven Seagal :-) Not a good movie so the DVD did a good job afterwards....

 

 

 

 

 

 

 

 

 

Actually serving as a test platform to get some programming done and check out all the components I got what to do with them. First cntact with a H bridge since I am using gear motors and no servos.

  • CPU: atmega168
  • Operating system: Arduino IDE
  • Power source: 4x 1.2V Eneloop + 1x 9V block battery
  • Programming language: Arduino ide
  • Sensors / input devices: SRF04
  • Target environment: Indoor and Outdoor (not offroad)

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

Good job!

i’m doing my CD-bot too :slight_smile:

Cool

Can not see yours. When will you show us your CD bot?

Interesting solution using

Interesting solution using an old DVD for that. Nice touch!

ill show it soon :slight_smile:

ill show it soon :slight_smile:

First to second person?

I was diggin how the robot was doing its own autobiography. Then you started narrating wth lol My english prof would have your head if she saw that. I like it though. I think I’ll give dictation of the project from the robots perspective next time!

Like the bot. Very curvy. The use of junk as building material appeals to me like you have no idea, well done.

Regarding your sensor question, I don’t see why not. I don’t have any experience with ATMegas but if you have DC motors and not servos then you can sweep your area after you activate your motors. I do that with my Crumbot to some degree. It’s mostly a SHR with a side to side scan every second or so. I use it to catch things that are just off center (they’d catch the corner of the bot) that aren’t caught by the Sharp sensor looking straight ahead.

Not sure about smarter turning. Everything I know says you’re stuck with encoders :</p>

English?

Yeah I got your point and changed the confusing prologue :wink:

About the junk material, i like to use what I have when i am doing some functional models. They do not have to be pretty…but hey, for me he is pretty :slight_smile:

The sensor sweep should run all the time and i will use the data to let Steven X avoid the obstacles during he is curving around and not just check the distance in driving direction but also a bit left and right.

Yeah, encoders would be smart but i will fix this with programming only. doing a sweep continuously and turn to the opposite direction when distance is < 20cm. As soon the distance is > 25cm then go forward again. (not sure if you got my idea) that should be doable.

Hey nice robot my friend, I

Hey nice robot my friend, I like the CD or DVDs idea too. Thanks for posting :slight_smile:

Atmega 328 instead of Atmega 128?

I think you meant an Atmega 328 instead of a Atmega 328. There are no Arduinos that use an Atmega 328. Besides that I suggest you to use “Arduino Uno” at “uses a” instead of “Atmega 328” because it does not uses a standalone Atmega micro.

 

Besides all that, good work, looks very nice. Keep it up,

 

Superpelican

Nice robot

and fast too !!

any chance you could share the code ?

thanks

Smarter turning/scanning

If you plan to sweep and scan your sensor and store the distance data, you can probably work out some smarter turning, even without encoders.

Try defining several turn types like: full turn, half turn, quarter turn, etc. Depending on the results you get from your sensor sweep, you might try to execute different turns to get you closest to the direction you want to go.

 

???

Your post confused me a bit…haha, do not get your point… are you sure you posted at the right page?

 

code

sure, but it’s high experimental now and not much comments. I am not at home at the moment but will attach the code with some comments later today.

 

Store sensor data

thanks for your help. i just want to store the data for one loop to determine which direction he has to go.

e.g.

- go forward - sweep - if distance left/right/in front is <20cm - then turn to opposite direction until dictance is >30cm - loop

the idea with defining the turns is good, will try this in the process.

 

code

OK thanks for that.

OK. So each sweep will check

OK. So each sweep will check left/right/front, as opposed to trying to map a data point every few degrees. That is easier than I thought you were going for.

Your current code is doing the range checks while stopped (like the start here robot). Is your goal to take measurements as you move and react without stopping unless something is right in front of you?

Some commentsj/suggestions to your posted code:

  • Set an initial position for your servo during the setup (e.g., myservo.write(90); to center the servo)
  • Your code seems to turn towards the shorter distance. This may work fine if your motors are hooked up backwards, but you should probably correct it.

If you want to continue moving while measuring, restructure your main loop. Define a new variable like ‘danger’ that sets a distance to stop if you are too close.

if (distance > 20) {   // if nothing is in the way, just go
     motorGo();
}
else if (distance < danger)  {   // if something is really close stop and back up a bit
     motorStop();
    motorBack();
    delay(500);
}
else {
… // all the rest of your code where you test, but delete the motorStop(); bit so you will test while moving

You may need to play with the distances you set in the if block above to get the behavior you like.

Have fun. It’s looking good.

Great looking first robot my

Great looking first robot my friend. Nice video on how to start too. Keep up :slight_smile:

Hi Lumi, Thanks for visiting

Hi Lumi, Thanks for visiting my project. Sorry if I didn’t answer sooner…the reason is I forgot to check if anyone added a new comment.Better later than nothing :slight_smile: I’m also very busy reading others projects,which are very interesting and I’m also learning from you guys.

Thanks for your kind comment. I updated this robot by adding a green led forward and a red led reverse. Also added a piezo that make sound when the robot reverse or when too close from an objet that makes it go reverse. I also added a Sharp IR sensor for edges detecting when it’s on a table or near a stair,but I disconnected it because the robot was acting weird with it. I didn’t update my project yet because I figured that is was minor add-ons…but I will.

I’m also busy trying to learn C arduino language and trying to compare both boards and their features.I already have the Arduino Duemilanove,so I’m learning right now. Will keep up :slight_smile:

great

Thanks for your input. This makes sense and I will try as soon as i have time. I am in vacation now and barely have time to keep my conversations up to date :wink: But i got Steven X in my bag and the IDE is already installed :wink:

good spirit

yeah, i am learning alkso from the guys here. this is a really good community.