PDA

View Full Version : [Contest Entry] K-9 Autonomous Robot Pet



djsures
10-07-2008, 02:31 PM
http://atomic.speculation.org/robots/banner1.jpg

Hi there!

Last year i built a K-9 Autonomous robot as a pet. It's programming has been ongoing to add more life-like characteristics. You will be surprised with how much expression and life you can bring to a styrene shell ;)

The project goal was to simply have a robot pet. We've all dreamt of that (well, us geeks have anyway)... And we don't want a robot that just drives around and does the same thing over and over. Neither do we want one that gets stuck and requires our supervision. We want to come home from work and be greeted at the door by it... And that is exactly what K-9 is and does...

Parts used:
- 18F4685 8 bit microcontroller
- 20 mhz resonator
- Body made of styrene
- Sharp IR Analog distance sensor
- 2 LEDs for eyes
- 1 LED for status
- 1 Two line blue LCD for status and sensor readings
- 1 EMIC sound module for voice
- 1 Speaker for EMIC
- 1 Speaker for PIC driven bleeps/bloops and 1 bit audio bark
- 2 modified servos for drivetrain
- 2 servos for head movement
- 1 micro servo for tail
- 2 pager motors for ears
- 1 IR detector for following infrared detection
- 2 buttons to activate and navigate through diagnostic menu interface
- 1 switch for power
- 1 lion 7.4V 2400 mh battery

- Complete Specifications of my K-9 (http://atomic.speculation.org/index.html?page=50)

- Pics and Video of Version #1 (http://atomic.speculation.org/Graphics/2007-10-26%20Calgary%20K9%20Robot%20Part%201/)

- Pics and Video of Version #2 (http://atomic.speculation.org/Graphics/2007-10-31%20Calgary%20K9%20Robot%20Part%202/)

- Pics and Video of Version #3 (http://atomic.speculation.org/Graphics/2007-11-04%20Calgary%20K9%20Robot%20Part%203/)

- Pics and Video of Version #4 (http://atomic.speculation.org/Graphics/2007-11-09%20Calgary%20K9%20Robot%20Part%204/)

- Pics and Video of Version #5 (http://atomic.speculation.org/Graphics/2008-09-25%20Calgary%20K-9%20Robot%20New%20Drivetrain/)

Firstly, I started out with a simple tractor base with the sharp sensor mounted to move up down right left. The programming is the heart of his interactivity. He creates a 3-D map of his surroundings. And yes timing was important, so i used servo's to power his treads.

My goal with Version #1 was obsticle avoidance and 2-D mapping. My technique looped through a 2-D array to determine the route. But that wasn't enough....

Recognizing raised or lowered surfaces was a challenge. But with timing and adding a third dimension to the 2-D array, I can now keep track of the floor contours. I do so by scanning the floor in a set time.

Now for his personality, i needed him to recognize human interaction. So to do that, i determined that if an object had moved then it must be a living thing.... So interact with it. By doing that, a global personality variable increases which causes him to be more active. and over time, the personality variable decreases, causing him to make less active decisions.

There are Actions and Modes. Modes define a list of actions. He determines his Mode based on his personality. Then the actions are determined by the 3-D array.

So even if he decides to follow an object that has moved, he will still reference his 3-D array for object avoidance. The same applies to following IR sources.

I don't know what else to write, maybe there are questions? :)

http://atomic.speculation.org/Graphics/2007-10-26%20Calgary%20K9%20Robot%20Part%201/DSC06914.JPG


http://atomic.speculation.org/Graphics/2007-10-31%20Calgary%20K9%20Robot%20Part%202/DSC07015.JPG


http://atomic.speculation.org/Graphics/2007-11-04%20Calgary%20K9%20Robot%20Part%203/DSC07079.JPG


http://atomic.speculation.org/Graphics/2007-11-09%20Calgary%20K9%20Robot%20Part%204/DSC07125.JPG

Matt
10-07-2008, 03:26 PM
Nice! What is he reminding me of? Is there a cartoon doggy like this?

jes1510
10-07-2008, 04:05 PM
That is awesome! I am really curious about the 3D array you use for obstacle avoidance. Are you scanning a line into an array, stepping the servo down, and then scanning another line to create a scan?

Adrenalynn
10-07-2008, 04:09 PM
Nice! What is he reminding me of? Is there a cartoon doggy like this?

K-9 from Doctor Who

Given your age range, you need to go tell Andrew to deduct balance-1 "Geek Cred" from your bank. (you get to keep 1pt for almost recognizing it...) :tongue:

[edit] Link: http://en.wikipedia.org/wiki/K-9_(Doctor_Who)

Adrenalynn
10-07-2008, 04:13 PM
DJSures, this is awesome! Does it have "omniflexible hyperlink facilities" and the ability to teleport, or is it an earlier model? :D

Welcome to the TRC, btw!

darkback2
10-07-2008, 05:36 PM
No no no...not DR who...gottard from jimmy neutron. You silly people.:p

DB

darkback2
10-07-2008, 05:40 PM
No no no...not DR who...gottard from jimmy neutron. You silly people.:p

DB

alright...I'm dumb. but goddard is cooler! Nice robot...seriously.

DresnerRobotics
10-07-2008, 05:40 PM
No no no...not DR who...gottard from jimmy neutron. You silly people.:p

DB

I hope your kidding.

If you're not I'm totally defriending you :p

Adrenalynn
10-07-2008, 05:56 PM
Goddard is a totally different critter. I'm with Tybs on this one!

djsures
10-08-2008, 12:36 AM
Thanx everyone! great community u have here also ... I'm so used to building these things and putting them on my lonely website .. they don't get much attention

maybe they'll be appreciated here lol

4mem8
10-08-2008, 01:16 AM
Thanx everyone! great community u have here also ... I'm so used to building these things and putting them on my lonely website .. they don't get much attention

maybe they'll be appreciated here lol

They sure will djsures, I for one will be keeping a serious eye on you and your projects.:happy:

djsures
10-08-2008, 01:20 PM
They sure will djsures, I for one will be keeping a serious eye on you and your projects.:happy:


Ditto! I need the inspiration lol

I decided last night that i'm going to try a walking robot. I've never "completed" a very successful one.

Have you seen the movie AI?
I'm going to try to build the "Teddy" from it. I'm going to buy a teddy bear. Cut it open and have a zipper put on the back. Then i'm trying the walking mechanism in cad right now. I'll probably use a combination of mechano and servos lol

What i need is a cheap place to buy servos. I found this:
https://www.unitedhobbies.com/UNITEDHOBBIES/store/uh_viewItem.asp?idProduct=3876&Product_Name=Vigor_39g_/_2.5kg_/_.19sec_Standard_Size_Servo

at that price, if they're good... I can surely order a box! never have enough servos lol

DresnerRobotics
10-08-2008, 01:42 PM
Ditto! I need the inspiration lol

I decided last night that i'm going to try a walking robot. I've never "completed" a very successful one.

Have you seen the movie AI?
I'm going to try to build the "Teddy" from it. I'm going to buy a teddy bear. Cut it open and have a zipper put on the back. Then i'm trying the walking mechanism in cad right now. I'll probably use a combination of mechano and servos lol

What i need is a cheap place to buy servos. I found this:
https://www.unitedhobbies.com/UNITEDHOBBIES/store/uh_viewItem.asp?idProduct=3876&Product_Name=Vigor_39g_/_2.5kg_/_.19sec_Standard_Size_Servo

at that price, if they're good... I can surely order a box! never have enough servos lol


You won't make anything walk with a 3.5kg-cm torque servo.

With servos, you truly do get what you pay for. There's no wonder servo that is dirt cheap and works great. The 995MGs are a perfect example of this. You can buy them for as little as $6 a pop, they claim 12kg-cm of torque.... and your robot ends up looking like it has Parkinson's. Horrible gear slop, horrible accuracy, and twitchy as all hell.

If you're building a biped, in my opinion, Hitec HS-645MGs are an absolute minimum.

djsures
10-08-2008, 02:15 PM
You won't make anything walk with a 3.5kg-cm torque servo.

With servos, you truly do get what you pay for. There's no wonder servo that is dirt cheap and works great. The 995MGs are a perfect example of this. You can buy them for as little as $6 a pop, they claim 12kg-cm of torque.... and your robot ends up looking like it has Parkinson's. Horrible gear slop, horrible accuracy, and twitchy as all hell.

If you're building a biped, in my opinion, Hitec HS-645MGs are an absolute minimum.

Great to know! thanx!

4mem8
10-08-2008, 02:20 PM
Good advice from tyberius, I also know you only get what you pay for in this area. buy the best for the money you have, you won't regret this djsures.

darkback2
10-08-2008, 02:51 PM
You could always just build a junkbot (http://forums.trossenrobotics.com/showthread.php?t=2472).:p

DB

ScuD
10-08-2008, 02:55 PM
You could always just build a junkbot (http://forums.trossenrobotics.com/showthread.php?t=2472).:p

DB

Quit haggling for contestants :p

Seriously though, the more the merrier

Adrenalynn
10-08-2008, 03:03 PM
I second [third?] Tyberius' sentiment here. I put a 475HB on my gripper last night (5.5kg/cm) and was terribly disappointed in its performance - I couldn't imagine using even that to try to make something walk, let alone about half that torque.

ScuD
10-08-2008, 03:12 PM
I agree - and I don't.

Depending on the mechanical design of your bot, it is possible to use low torque servo's to build a walking robot.

See, the first bot I built (the quad posted in the nostalgia thread) used 3.3kgcm servo's and walked perfectly. However, the bot is built in such a way that in a standing position, no torque is exerted on the servo's. In fact, it cannot move it's body any closer to the ground, it can only lift the front of it's legs up in the air and rotate the entire leg.

The point is, you're not throwing money away when buying low-end servo's, as long as you're into the hobby.
If it's a specific project though, then I more than heartedly agree with the above - good equipment comes at a price, but it's more than worth it's money.

DresnerRobotics
10-08-2008, 03:25 PM
^ The difference being is yours is a super lightweight quad, where he is looking at building a biped.

Bipeds are an entirely different animal than a quad when it comes to servo requirements.

ScuD
10-08-2008, 03:39 PM
Couldn't agree more, Tyb.

I only meant to point out the importance of mechanics in the entire system.

For example, take the bioloid standard biped.
It's legs are built so that the servo's take a minimal amount of torque with the legs fully stretched in a standing position.
When crouching down halfway, the servo's are taking a beating, even though they're pretty tough to start with.

This is actually why i'm sort of stuck in the design of my mech, I want an inverted knee design but refuse to make due with fully stretched legs.
It can be done, but it'll take either much stronger servo's, or a completely scratch-built design including levers instead of direct drive.


On-topic though, I've been wanting to create 'teddy' since I first saw A.I., unfortunately I have too many projects and too little time..

I can't wait to see your progress!!

DresnerRobotics
10-08-2008, 03:46 PM
Couldn't agree more, Tyb.

I only meant to point out the importance of mechanics in the entire system.

For example, take the bioloid standard biped.
It's legs are built so that the servo's take a minimal amount of torque with the legs fully stretched in a standing position.
When crouching down halfway, the servo's are taking a beating, even though they're pretty tough to start with.

This is actually why i'm sort of stuck in the design of my mech, I want an inverted knee design but refuse to make due with fully stretched legs.
It can be done, but it'll take either much stronger servo's, or a completely scratch-built design including levers instead of direct drive.


On-topic though, I've been wanting to create 'teddy' since I first saw A.I., unfortunately I have too many projects and too little time..

I can't wait to see your progress!!


Which is why Jon Hylands leg design is so ingenious, it's essentially a reverse leg design but without the extreme angle of a single knee servo. With two knee servos creating a double knee joint, each facing a different direction, you don't have nearly as much stress as a single knee reverse leg design. My mech can actually stand without power to the servos as a result.

ScuD
10-08-2008, 04:33 PM
I just saw the pics, it indeed looks magnificent, and I actually had to slap myself over the head going "why didn't i think of that".

I did include a double knee joint, but a different configuration. I'll upload a pic in a minute.

Just knew there was a solution but I just couldn't see it :happy:

djsures
10-08-2008, 04:46 PM
That is awesome! I am really curious about the 3D array you use for obstacle avoidance. Are you scanning a line into an array, stepping the servo down, and then scanning another line to create a scan?


sorry i didn't see this earlier. here is what i do... (this code applies to both k-9 and my wall-e, etc) . i share it amongst my robots..

i have a file called DJSERVOS.C .. It contains the pin definitions and functions for servos. ie moveHead(5, 6) will move the head 5 horizontal and 6 vertical. also, when it gets to it's location, it will take the current ADC value and put it into the array.

The position it puts into the array determines on two things. Each row of the array has an array index (the first column). The size of the array is static .. Here's what it may look like.


10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

^^ that array has not seen any obsticles. If it did, it'd look like this.... perhaps if he was beside a wall....

10, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
9, 55, 0, 33, 0, 22, 0, 0, 0, 66, 0, 0, 0, 0, 0
8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 44, 0, 0, 0
7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 11, 0
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

now everytime i tell the MOVESERVOS to go forward, it increments the array. Everytime the head scans, it increments the array index and moves all values back one. So row 10 becomes a blank row 11 and row 9 becomes row 10's values.

I hope i'm my explanation is making sense lol .. So as he scans, when he reaches his furthest horizontal scan, the rows are moved to make room for his new scan.

When he sees an object that's too close. he stops. looks at his array. and decides which way to turn.

also, when he goes to play in autonomous again after doing something else (sleeping, nodding, barking, etc). he scans to see if what he sees is the same as his last time. if it isn't, then he knows he was moved or someone is there. in which case he interacts with it by either going towards it and finding away around it . or backin away from it, etc...

lots of global variables :)

ScuD
10-08-2008, 05:04 PM
Very nice solution to a well-known problem, Djsures.

And very well explained, to say the least!

Nice work!

jes1510
10-09-2008, 12:49 PM
Wow man thanks for the explanation. That is a very clever idea indeed.

Alex
10-10-2008, 03:42 PM
way cool project djsures! I'm def. a fan of the Doctor:D

I got you entered in this round of the TRC Project Contest (http://www.trossenrobotics.com/contest.aspx)!

djsures
02-02-2009, 06:15 PM
OMG thank you!!!!!!!!

DresnerRobotics
02-02-2009, 06:18 PM
Congratz and well deserved! Your mapping software and ability to bring this critter to life blew us away :)

djsures
02-03-2009, 03:04 AM
Congratz and well deserved! Your mapping software and ability to bring this critter to life blew us away :)

it's taken a long time to perfect and this is a pretty amazing reward for it! it's been a real crazy winter with work and i haven't had any personal time to play with robots or even respond to many emails dealing with robots. for a while i was feeling very seperated from the whole community. it feels great knowing k-9 wasn't forgotten. thanx again. when my current contracts are completed, i hope to free up more time to participate in the community again soon .

DJ

Azinman
03-23-2009, 08:24 PM
I was just checking out random robot websites and i stumbled upon Trossen robotics. Soon enough I discovered K-9! That is and incredible robot!!! I love the 2D mapping array and the personality you infused into this robot! Oh ur site is awesome especially the Wall-e :happy:

Zacattack
03-24-2009, 09:33 PM
hi, i was looking over random stuff and saw this! its so cool! it would be so neat to have a robot pet like that, i think ill build byself a simplified version out of spare parts and see what i can come up with, i think i still have two cheap servos. well great job man, its one of my all tyime favorite bots :) it kicks the doctor who robo dogs butt!