Hope this is the correct place to post this query. It's either Electronics or Software. I tend to think its an electronics issue, but...

For a bit of background I'm trying to build the $50 robot. However there are a couple of changes to the basics. I'm using an ATmega168 and Hitec HS-425BB servos. This is mainly due to the fact that both were cheaper to purchase here in Australia than the ATmega8 and the HS-311 (go figure!). I'm programming the 168 with the AVRISPII.

while{ servo_left(60); delay_cycle(20);}I then had to recharge my batteries (6V 4 pack Alkaline). When I went back to the system The servos started rotating in an anti-clockwise direction. I wanted to change the Speed value to change the direction, but to no avail. The servos still only rotate in an anti-clockwise direction.

My question is: is this to do with the charge of the batteries, the microcontroller clock, or the servos, either because they're not actually centred correctly, or they're rated differently to the HS-311?

As far as I can tell the ATmega168 runs at the same speed as the ATmega8, and I was told there was no real difference between the HS-311 and the HS-425BB.

Sorry about the long post, but any help would be appreciated. Ultimately I will fork out for the correct microcontroller and servos for the project if I have to, but I hope it doesn't come to that.

Cheers

Lycus

Logged

There are 10 people in the world,Those that understand Binary,And those that don't.

oh yeah on my $50 robot I multiplied all the values by 8 when running at 8MHz.

The default MCU in that tutorial is the ATmega8, which runs at 1MHz by default, and you can change it to 8MHz if you want. The ATmega168 runs at 8MHz by default, so in the source code you need to prepare for that by multiplying values for your servos and timers. (anything that needs a pulse)