Servo(Unaction)
Hi
I just ran the servo controller code. I can hear a sound in the servo but it does`nt actually spin. I have tried 2 separate servos.
Could it be the code. I tried to change the servo speeds.
Cheers.
import stamp.core.*;
public class ServoControl {
static PWM servo = new PWM(CPU.pin12,173,2304);
public static void main() {
System.out.println("Welcome to Servo Control: ");
System.out.println(" r - right");
System.out.println(" l - left");
System.out.println(" c - center");
while (true) {
switch ( Terminal.getChar() ) {
case 'r':
servo.update(400,5000);
break;
case 'l':
servo.update(400,5000);
break;
case 'c':
servo.update(400,5000);
break;
}
}
}
}
I just ran the servo controller code. I can hear a sound in the servo but it does`nt actually spin. I have tried 2 separate servos.
Could it be the code. I tried to change the servo speeds.
Cheers.
import stamp.core.*;
public class ServoControl {
static PWM servo = new PWM(CPU.pin12,173,2304);
public static void main() {
System.out.println("Welcome to Servo Control: ");
System.out.println(" r - right");
System.out.println(" l - left");
System.out.println(" c - center");
while (true) {
switch ( Terminal.getChar() ) {
case 'r':
servo.update(400,5000);
break;
case 'l':
servo.update(400,5000);
break;
case 'c':
servo.update(400,5000);
break;
}
}
}
}
![lol.gif](http://forums.parallax.com/images/smilies/lol.gif)
Comments
servo.update(x,2304);
with x ranging from 115 (equals left) to 230 (equals right)
and 173 being centre.
The 2304 sets the 20 msec period required for the servos
2304 * 8.68 usec = 20 msec
115 * 8.68usec = 1.0 msec
173 * 8.68usec = 1.5 msec
230 * 8.68usec = 2.0 msec
regards peter
·
When pressing the Left or Center the sound seems to change , but the actual external servo is not in motion.
what could it be?
Cheers.
Servos need 6V power supply. Do not connect them
to the Javelin VDD, but make sure the Javelin GND and servo GND
are connected.
regards peter
in the javelin manual (attached). That page describes
the servo and the program.
regards peter
One last thing, how do I make the servo movement more robust with out Just recieving pulse movements. So for example if I pressed L I would get a full left rotation
instead of a small pulse movement left.
Cheers.