Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: soldierman59 on August 15, 2009, 04:03:37 PM

Title: Sharp ir help
Post by: soldierman59 on August 15, 2009, 04:03:37 PM
I figured out the source code admin posted up and it works ok with some minor adjustements but my scanning servo never goes to the left it mostly goes right to scan and i can see it picking up the object and looking for it but if the object goes away its like it stays hard locked to the right i guess "looking for it lol" but it just stays from the actions that it exhibits im thinking that somehow its calibrated that "somenumber" is straight but that number is wrong no matter which one of the values i play with for the servo commmands it doesnt change just makes it worse or slightly better to original default. thanks for any help you can give ive been stumbling through but making my way most people have soldering problems right now i would kill for one of those.
Title: Re: Sharp ir help
Post by: Conscripted on August 16, 2009, 06:13:40 PM
Hello.

I had a bit of trouble getting my sharp ir working properly. First I had it wired incorrectly. After I fixed that it still didn't behave as it should. I uncommented this else line and it helped me with the troubleshooting. I found that my servo wasn't scanning through it's entire range. After I adjusted the scan angles it worked great.
Code: [Select]
}
else //object not detected
{
if (scan_angle<=max_scan_angle) //maximum servo angle
scan_angle+=2; //scan left
// else //if scanned all the way, this forces it to start over
// scan_angle=10 ;

Conscripted
Title: Re: Sharp ir help
Post by: soldierman59 on August 16, 2009, 08:08:15 PM
thanks for your suggestion thats what i was trying to figure out I knew it wasnt going full rotations but didnt know where in the code to change it thanks now totally unrelated but its going crazy servos just tick everytjhing moves extra slow motion check board rock solid i think its my homemade prog lol maybe a rebuild might help I'll repost if this doesnt help but if you have any suggestions on that thanks in advance.
Title: Re: Sharp ir help
Post by: Truckstop on August 17, 2009, 05:10:42 AM
if you cant get it figured out in software, try checking the pot inside your servo, it tells the servo board where the horn is pointed, iv had them go bad before and its a pain to figure out..

i dunno what type of servo your using so i cant give you any values, but take the pot and remove it, hook it up to a multimeter and spin it very slowly from left to right. the curve should be smooth. iv had pots that jump all over the place. bad pot...

Good luck

Truckstop
Title: Re: Sharp ir help
Post by: soldierman59 on August 17, 2009, 10:30:53 PM
oh i fixed the servo jitter problem starting thinking and thinking then i knew it was the programmer cable because i knew my board was solid and i thought the only way that it would jitter like that is if the programming had a very small short and that was the problem cold solder joint apparently and somehow i missed a wire hanging from my cable laughing to myslef maybe thats why its not working. now just working with the ir very daunting task it see's stuff but when following it has a m,ind of its own just wants to go straight any ideas?????