Society of Robots - Robot Forum

General Misc => Misc => Topic started by: Ro-Bot-X on January 27, 2008, 01:06:26 PM

Title: CD-bot
Post by: Ro-Bot-X on January 27, 2008, 01:06:26 PM
I needed a small robot to work with for testing code. I've got part of it done, but had some problems with the bootloader and damaged the Mega8. Now I'm waiting to get a Mega168 to make it work again. But here are some pictures of the robot:

Title: Re: CD-bot
Post by: Ro-Bot-X on January 27, 2008, 01:09:35 PM
Couldn't upload all the pictures, so here are some more:

Title: Re: CD-bot
Post by: HDL_CinC_Dragon on January 27, 2008, 01:11:56 PM
Thats awesome :) I like the encoder wheels... perhaps a tutorial is in order :P
Title: Re: CD-bot
Post by: Ro-Bot-X on January 27, 2008, 01:13:47 PM
Ok, here are the last ones... Someone had to answer fast to this post...
Title: Re: CD-bot
Post by: Trumpkin on January 27, 2008, 01:16:01 PM
I like the design much better than my robot. Please make a tutorial on those encoder wheels.
Title: Re: CD-bot
Post by: HDL_CinC_Dragon on January 27, 2008, 01:24:55 PM
Lol thats pretty sweet man :)

And sorry for the fast reply :P didnt know you were still posting pics ;)
Title: Re: CD-bot
Post by: ed1380 on January 27, 2008, 02:26:47 PM
woaw. looks nice. i like how you put it in the cd case
Title: Re: CD-bot
Post by: bietz on January 27, 2008, 02:40:54 PM
Wow that robot is awesome!!!  :o
I love how you used random stuff to build such a wonderful bot!

I've got so many blank CDs in a box that I haven't opened for 2 years (it's hard to say, but I think CDs are becoming deprecated  :D), and here's a good way to use them!
Title: Re: CD-bot
Post by: Admin on January 27, 2008, 03:55:05 PM
Nice :)

Both the wheel encoders and bucket chassis are neat ideas.

(can't wait for the video)
Title: Re: CD-bot
Post by: airman00 on January 27, 2008, 04:46:35 PM
your robot looks very well designed , very clean and neat job!
Title: Re: CD-bot
Post by: Ro-Bot-X on January 27, 2008, 05:23:14 PM
Thanks for the comments guys!

Right now the robot is a dead stone. Messed up the fuses I gues... Have to wait for another microcontroller to work on the code. I need to test the encoders first, to see how many servo pulses it needs to decelerate to stop at the designated distance (if the sensors are giving good enough signals). Then I'm thinking to use a Tiny26 that I have to be the driving controller. Didn't had time to fiddle with this lately.
Title: Re: CD-bot
Post by: TrickyNekro on January 29, 2008, 04:32:41 PM
Thanks for the comments guys!

Right now the robot is a dead stone. Messed up the fuses I gues... Have to wait for another microcontroller to work on the code. I need to test the encoders first, to see how many servo pulses it needs to decelerate to stop at the designated distance (if the sensors are giving good enough signals). Then I'm thinking to use a Tiny26 that I have to be the driving controller. Didn't had time to fiddle with this lately.

Get an STK from a friend and you might be able to recover it if you have problem with fuses!!! STK helps a lot believe me... It's money you should give to ATMEL!!! (ha despite not getting samples >:()

Anyways have a look at the ATMEGA168... Same layout with the ATMEGA8 but full of interrupts... should help you with encorders!!!

And one question: It's this a 2.4 module or a mobile connection module??? It's well shielded so it must be RF!!! (even GPS?!?!?!?!)

BTW nice robot... but I guess you already know that!!! Cheers 8)

PS: I'm sick of you people making robots and me not be able to do so... I would love to participate in the 2nd contest but I terribly lack time!!!
Aaaaaxxxx.... It's only 3 months left.... :'( :'( :'( :'( :'( :'( :'( :'(  ( exams and then SUMMER :P)
Title: Re: CD-bot
Post by: Ro-Bot-X on January 30, 2008, 12:34:34 AM
And one question: It's this a 2.4 module or a mobile connection module??? It's well shielded so it must be RF!!! (even GPS?!?!?!?!)

It's BlueSmirf, from SparkFun. I got this module 2 years ago and never used it. I've got several things I didn't had a chance to use, like a 2 axis accelerometer and 2 axis gyro, a devantech compass... These I bought because I wanted to build a ballancing robot. But my problem is the software, not the hardware.

I have a STK200/300. My mega8 does not give back the right signature. There is one uploader that does not check that and can program the chip anyway, but I fear something more is not right in there. Here is the batch file I used to upload the bootloader that resulted in mega8 not giving back a good signature:

Code: [Select]
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --wr_lock=0xFF
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --wr_fuse_l=0xdf --wr_fuse_h=0xca
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --erase --upload --verify if=ATMegaBOOT.hex
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --wr_lock=0xCF

If I understood correctly, the first line unlocks the fuses, the second line writes the fuses for ext. cristal 16MHz, third line writes the bootloader and verifies it, fourth line locks the fuses so a bootloading reprogram of the chip does not erase the bootloader. The bootloader is from Arduino bootloaders folder, for the mega8 chip. A similar batch file can upload the BlinkingLED hex file, and it works, but the mega8 still does not give back a good signature.

Code: [Select]
uisp -dprog=stk200 -dpart=ATmega8 -dlpt=0x378 --erase --upload --verify if=blink.hex
I have done no further tests after this, because I got angry and needed to take some space from this project before I throw it out the window!
Title: Re: CD-bot
Post by: Admin on January 30, 2008, 10:28:56 AM
But . . . you can still program it despite the bad signature, no?
Title: Re: CD-bot
Post by: Ro-Bot-X on February 03, 2008, 12:24:09 PM
I does not work anymore. But I have ordered a Mega168, it should be in my hands in 2-3 days. I will not play with bootloader anymore, but I need to set the fuses right for 20MHz cristal... Any words of wisdom?
Title: Re: CD-bot
Post by: cooldog on February 03, 2008, 12:42:31 PM
yay

don't mess up :P :D
Title: Re: CD-bot
Post by: Admin on February 03, 2008, 06:09:41 PM
I didn't actually look at the bootloader . . . but perhaps it changed your fuses for the clock, thereby messing it up?

As for setting the fuse to an external crystal:
http://www.societyofrobots.com/robotforum/index.php?topic=2701.0

I did it using AVR Studio, it will be obvious when you look at the fuses. Does your programmer work with AVR Studio (sorry, Im being lazy and not checking)?
Title: Re: CD-bot
Post by: Ro-Bot-X on February 04, 2008, 12:26:58 PM
I have allways messed up the fuses and managed to recover, but this time without a high voltage programmer I guess I can't. Still don't know exactly what I am doing with the fuses, didn't understand all the possibilities in the data sheet. I will proceed with caution and try to do it right the first time. I there an explanation (tutorial) about setting fuses for the AVR? Not using only one sample, but to explain every possibility with samples for each?

By the way, I am celebrating tonight, we just got today our passports back with Canadian immigration visas! We'll be flying there in April...
Title: Re: CD-bot
Post by: cooldog on February 04, 2008, 05:14:21 PM
By the way, I am celebrating tonight, we just got today our passports back with Canadian immigration visas! We'll be flying there in April...

sweet man where are you heading
Title: Re: CD-bot
Post by: gamefreak on February 04, 2008, 09:08:45 PM
By the way, I am celebrating tonight, we just got today our passports back with Canadian immigration visas! We'll be flying there in April...

sweet man where are you heading

maybe they are heading to canadia :P (I spelled it that way on purpose :P)
Title: Re: CD-bot
Post by: HDL_CinC_Dragon on February 04, 2008, 09:15:17 PM
maybe they are heading to canadia :P (I spelled it that way on purpose :P)
I always spell and pronounce it that way hahaha I think it sounds much better :P
Title: Re: CD-bot
Post by: Ro-Bot-X on February 04, 2008, 11:45:08 PM
Vancouver area. Less cold over there... ;)
Title: Re: CD-bot
Post by: Rebelgium on February 05, 2008, 06:51:11 AM
And where do you live now RobotX?
Title: Re: CD-bot
Post by: Ro-Bot-X on February 05, 2008, 09:29:43 AM
And where do you live now RobotX?


I live in Romania, in a city called Sibiu. I lived in the States for 5 years, then applied for the canadian rezidence since I couldn't get the american rezidence.
Title: Re: CD-bot
Post by: gamefreak on February 05, 2008, 10:57:08 AM
lol, most americans wouldnt pass the citizenship test, woot :D
Title: Re: CD-bot
Post by: HDL_CinC_Dragon on February 05, 2008, 11:10:24 AM
lol, most americans wouldnt pass the citizenship test, woot :D
Too true hahaha
Title: Re: CD-bot
Post by: Admin on February 05, 2008, 01:35:48 PM
Quote
I there an explanation (tutorial) about setting fuses for the AVR? Not using only one sample, but to explain every possibility with samples for each?
The datasheet has all the info . . . but its confusing and verbose for probably something simple that you want to do. Google each fuse, you will find tons of info.

And if you aren't sure, just ask us right before you make the change.
Title: Re: CD-bot
Post by: Ro-Bot-X on February 07, 2008, 12:07:22 AM
Last night I got my CDbot working. I set the fuses for the ATmega168 in Bascom (it shows every bit with explanations and it was easier to do it), but this was after intensive reading of the datasheet and SparkFun tutorials.

I have sadly discovered that my Parallax servos are not running as they say on their forum and BoeBot manual. I mean they don't accelerate, just go full speed for any value other than 1.5 ms. I have found a tutorial on how to modify the servo to allow different speeds and I will try to modify them. It is suposed to be easy, add a resistor and replace a capacitor in the feedback loop.

The next step is to check the serial communication directly and through Bluetooth, then add a serial LCD. After the basic motor functions work, I will play with the Sharp distance sensor and see how that works. Then I'll move to mapping and finally to the behaviours. I am not sure if it will be completly ready for the contest deadline, but I'll try.
Title: Re: CD-bot
Post by: TrickyNekro on February 07, 2008, 07:53:11 AM
Code: [Select]
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --wr_lock=0xFF
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --wr_fuse_l=0xdf --wr_fuse_h=0xca
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --erase --upload --verify if=ATMegaBOOT.hex
uisp -dpart=ATmega8 -dprog=stk200 -dlpt=0x378 --wr_lock=0xCF

If I understood correctly, the first line unlocks the fuses, the second line writes the fuses for ext. cristal 16MHz, third line writes the bootloader and verifies it, fourth line locks the fuses so a bootloading reprogram of the chip does not erase the bootloader. The bootloader is from Arduino bootloaders folder, for the mega8 chip. A similar batch file can upload the BlinkingLED hex file, and it works, but the mega8 still does not give back a good signature.

Just try AVRstudio 4 next time for setting fuses... It's so so simple easy and safe...
It will save your day. I have STK500 and although I had my brain fried to get it working with an external board - fuses problem - It works great!!! To tell you the truth if you read wrong signature is hard to tell if the chip is going to survive or not...  :-[

Any how's keep up the good work!!!
Cheers, Lefteris Greece
Title: Re: CD-bot
Post by: Ro-Bot-X on February 21, 2008, 03:07:33 AM
I had to take a break working on this project. I still don't have time to finish before the contest deadline, but I will post whatever I have done so far. Below are the schematic and the PCB. The robot still has the perf board, but I wanted to see if the PCB can be done in the same footprint.