Pages: 1 [2] 3   Go Down
Author Topic: Vending machine / robot project advice  (Read 3432 times)
0 Members and 1 Guest are viewing this topic.
U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

It has been  a while as I have been waiting for parts etc., but I have now made a start at building a robot.......

I have now built a basic 3 wheeled robot - at the moment there are no sensors on it so it is just obeying basic turn motor on for 3 seconds type commands
but so far so good :-)
« Last Edit: May 15, 2012, 02:14:26 pm by alanesq » Logged


U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Been experimenting much of the weekend:

It looks like the plan to use an optical mouse is a no go - it is just not giving accurate enough data to be of any use

The ultrasound sensors are very good but I am getting a lot of places in the room where it doesn't work (I guess reflections from furniture etc.) so I can't rely on these for navigation (at least not on their own)

so any more ideas on what I can try before resorting back to the line following plan?
Logged


Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The ultrasound sensors are very good but I am getting a lot of places in the room where it doesn't work (I guess reflections from furniture etc.) so I can't rely on these for navigation (at least not on their own)
Hi, What are the ultrasonics doing that is causing you problems?
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, What are the ultrasonics doing that is causing you problems?

It works great when pointed straight at a decent flat surface, but if I try to send the robot through a gap (e.g. out the door) or at an angle through the room etc. it soon starts receiving data of 0 or 256 which I am guessing means poor signal?

Logged


Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

0 I would have thought means the pulsein() timed out without receiving an echo from your sensor, which potentially means your wall deflected the ultrasonic ping at an angle that didn't get captured by the sensor on its return...or the wall is too far away but that's unlikely from what you're saying.  Is it a HC-SR04 you're using?
« Last Edit: May 13, 2012, 09:32:19 am by strykeroz » Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, that is the one I am using

I may do some experimenting seeing if I can just carry on a while ignoring the blank replies and carry on blind until it picks up a reading again?
but I would like to be able to measure movement along the floor somehow (and turn) so any ideas on how to do this would be much appreciated?
I am new to robots so there may be something obvious way that I do not know about....
Logged


Offline Offline
Full Member
***
Karma: 0
Posts: 204
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering how you plan on dealing with power. Won't it require mains voltage to run the machine?

Cool progress!
Logged

U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was wondering how you plan on dealing with power. Won't it require mains voltage to run the machine?
Cool progress!

I am using a cordless drill battery at the moment, but it is not a very good one - so battery is on the list of problems to solve ;-)
maybe eventually get the robot to dock into a charging station of some kind?

The drinks machine uses mains but the robot just has to put the cup into the right place (how to accurately line it up is another problem yet to be solved ;-)
Logged


U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Progress update

I have 3 ultrasound sensors on it and am navigating round just using this
it is a bit hit and miss but progress is being made

(see later video at bottom of this page)
« Last Edit: May 16, 2012, 11:33:36 am by alanesq » Logged


Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That really is an impressive leap forward you've made there!
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That really is an impressive leap forward you've made there!

Thanks :-)
I must admit, it is actually starting to fall into place quiet well now...

There is no intelligence in the code, it is just following simple instructions like move back until front sensor reading at 30cm, turn right until right sensor at 10cm etc. etc.

i.e.
  // command format = mode , direction to move , setting , sensor to use
  //     modes
  //     1 = set time
  //     2 = find a distance (moving towards)
  //     3 = find a distance (moving away from)
  //     4 = until distance greater than
  //     5 = until distance less than
 
    warning_sound(2);
    move_robot( 2 , "reverse" , 75 , "front" );
    move_robot( 1 , "left" , 1500 , "" );
    move_robot( 2 , "left" , 72 , "right" );
    move_robot( 2 , "forward" , 65 , "front" );
    move_robot( 1 , "right" , 1500 , "" );
    move_robot( 2 , "right" , 55 , "left" );     // left towards vending machine
    move_robot( 1 , "forward" , 4500 , "" );
    move_robot( 1 , "left" , 500 , "" );
    move_robot( 1 , "forward" , 4000 , "" );
    move_robot( 1 , "right" , 300 , "" );
    move_robot( 2 , "forward" , 40 , "front" );
    move_robot( 1 , "left" , 1600 , "" );
    move_robot( 2 , "left" , 27 , "right" );
    move_robot( 1 , "forward" , 9400 , "" );
    move_robot( 2 , "forward" , 45 , "front" );   // out of library door
    move_robot( 1 , "right" , 1500 , "" );
    move_robot( 2 , "right" , 33 , "left" ); 
    move_robot( 3 , "forward" , 35 , "right" );   // forward until right is less than 35   (get fix at door frame)


in areas where there is poor returns coming from the sensors I tell it to run a set length of time then pick up a wall when it is close enough to get a good fix or say run until right sensor reading less ten 30cm etc. etc.
- this works surprisingly well as when it starts to drift off line then next measurement will tend to bring it back in line

there is a lot more work to do on the code but here it is so far for what it is worth:
http://homepage.ntlworld.com/alan.blackham/arduino/robot%20code%201.txt
« Last Edit: May 16, 2012, 02:41:33 am by alanesq » Logged


U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Update 3:

lol - I need to give it a rest for a while, I may be getting obsessed ;-)

anyway, I have just done a proof of concept with a full cup of coffee
it is definitely feasible  (much to my own surprise, never mind anyone else)


« Last Edit: May 22, 2012, 01:49:50 am by alanesq » Logged


Brisbane, Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 1122
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's actually quite stable isn't it.  From the fire extinguishers nearby I take it you had a somewhat pessimistic outlook prior this experiement?   smiley-eek
Logged

"There is no problem so bad you can't make it worse"
- retired astronaut Chris Hadfield

U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

That's actually quite stable isn't it.  From the fire extinguishers nearby I take it you had a somewhat pessimistic outlook prior this experiement?   smiley-eek

Yes, it couldn't have worked out better really, surprising not only because it is a first attempt but because this robot was actually just supposed to be a cheap and cheerful training testbed for getting myself some experience of what would be needed !

I nearly needed the fire extinguishers yesterday ;-)
I connected my battery to my bench power supply to put some charge in it and got the wires the wrong way round - completely toasted a diode in the power supply with lots of smoke.........

Logged


U.K.
Offline Offline
Newbie
*
Karma: 0
Posts: 39
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Just another update on progress !

I have spent many, many hours; working on the code, rewriting, experimenting etc. etc,
I decided to have another look at the PS2 optical mouse as there are many situations where ultrasound wont work or it is not enough - I have got this mounted underneath the robot and it is now proving helpful
btw - I think when I tried it before I wasn't sampling the data from the mouse fast enough, it is still not 100 percent reliable, but good enough to help

I am finding (as is probably already well known in the world of robots) that the concept of navigating round with a few sensors is very easy but the reality in the real world is a whole different thing, there are so many things can go wrong or give false signals.........

but, progress is still being made (if more slowly now)
here is the latest video which shows it doing a complete one way journey from th vending machine to where I sit
it is still not totally reliable but it has now done this journey three times in a row

http://youtu.be/9szP-elx84Q

btw - I have created a "blog" of the project here:   http://www.alanesq.com/robot.htm
« Last Edit: May 22, 2012, 01:50:53 am by alanesq » Logged


Pages: 1 [2] 3   Go Up
Jump to: