Skip to content

Commit b03de4e

Browse files
authored
Servo frequency should be 50 Hz
See references verifying Servos should be at 50 hz - https://dronebotworkshop.com/servo-motors-with-arduino/ - "In a conventional analog servo motor a PWM signal with a period of 20 ms is used to control the motors. A signal of 20 ms has a frequency of 50 Hz." - https://en.wikipedia.org/wiki/Servo_control#Pulse_duration - The period of 20 ms (50 Hz) comes from the days where the signal was encoded in PPM (pulse position modulation) - Typical RC servo frequency is 50 Hz - see sg90 datasheet http://www.ee.ic.ac.uk/pcheung/teaching/DE1_EE/stores/sg90_datasheet.pdf
1 parent 6552bd0 commit b03de4e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/servo/servo.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
3535
#define SERVOMAX 600 // This is the 'maximum' pulse length count (out of 4096)
3636
#define USMIN 600 // This is the rounded 'minimum' microsecond length based on the minimum pulse of 150
3737
#define USMAX 2400 // This is the rounded 'maximum' microsecond length based on the maximum pulse of 600
38-
#define SERVO_FREQ 60 // Analog servos run at ~60 Hz updates
38+
#define SERVO_FREQ 50 // Analog servos run at ~50 Hz updates
3939

4040
// our servo # counter
4141
uint8_t servonum = 0;
@@ -99,4 +99,4 @@ void loop() {
9999

100100
servonum++;
101101
if (servonum > 7) servonum = 0; // Testing the first 8 servo channels
102-
}
102+
}

0 commit comments

Comments
 (0)