Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: manut on December 04, 2009, 09:15:50 PM

Title: opposite rotations of my 50$ robot servos
Post by: manut on December 04, 2009, 09:15:50 PM
hi, I have a little problem with my 50$ robot: the servos turns in opposite directions, does anybody knows what I did wrong..I guess I just inverted something, but don't know what.. (I used photoresistors of different values, could come from that?)
thanx
manu
Title: Re: opposite rotations of my 50$ robot servos
Post by: Joker94 on December 05, 2009, 02:37:57 AM
It could be the photo resistors, or it could be that if you swap the pins the servos are plugged into it will work.

Have you got it all mounted yet
Title: Re: opposite rotations of my 50$ robot servos
Post by: ozbot on December 05, 2009, 06:21:01 AM
It depends how you mount your servo's, once you are happy with construction, alter you code to account for this.  In the code you should have 3 PWM values (assuming you are using the photovore zip file).  One is one direction, the middle value should be stop and the other is the opposite direction.  Try reversing one set to see the difference.

Code: [Select]
{
//go straight
servo_left(25);
servo_right(44);
}

See, if I swapped both around, it would go backward, see?
Title: Re: opposite rotations of my 50$ robot servos
Post by: manut on December 05, 2009, 08:12:03 AM
thanks guys,
I will try to modify the code, but first I'd like to be sure that this problem doesn't comme from electronic...because I mounted the servos exactly like in the tutorial, ...but both turn in the clockwork sense in the light and opposite sense in the dark.
Title: Re: opposite rotations of my 50$ robot servos
Post by: Soeren on December 05, 2009, 08:20:01 AM
Hi,

It's because you mount the servos back to back, sort of speaking, so one will go opposite the other if both get either a short or a long pulse (relative to 1.5ms). Either mod the code as suggested or swap the leads on the motor inside one of the servos, whatever you find easier.
Title: Re: opposite rotations of my 50$ robot servos
Post by: manut on December 05, 2009, 09:11:33 AM
hi,
by swapping the leads inside the motor, you mean I've to swap the negative and the positive? I used the 2.2Kohm resistor method to modify the servos.
thanx
manu
Title: Re: opposite rotations of my 50$ robot servos
Post by: Soeren on December 06, 2009, 08:33:13 AM
Hi,

I mean to swap the leads soldered to the motor _inside_ the servo - the terminals on the motor itself.
There might be from 1 to 3 caps mounted there (for electric noise removal) and you don't need to swap them, just the leads.

You SHOULD NOT swap the leads going outside, as that would most likely render the servo seriously dead.
Title: Re: opposite rotations of my 50$ robot servos
Post by: manut on December 06, 2009, 04:27:27 PM
thanx guys! :) 'M going to work on that....I let you know..
Title: Re: opposite rotations of my 50$ robot servos
Post by: blackbeard on December 06, 2009, 06:11:25 PM
put them on backwards?
Title: Re: opposite rotations of my 50$ robot servos
Post by: manut on December 06, 2009, 07:36:43 PM
hmmm...that's an idea but I'd like to keep them in symetry..
Title: Re: opposite rotations of my 50$ robot servos
Post by: ozbot on December 07, 2009, 05:48:47 AM
It be a lot easier and safer to just edit your code.  If you cannot change the directions of your servo's with code, you will need to learn sooner or later.
Title: Re: opposite rotations of my 50$ robot servos
Post by: manut on December 07, 2009, 08:20:56 AM
I read a few things about it, and you're right, modifying the code seems to be the easiest way to make the modif..