I am trying to understand how to read the servo specs and then compute PWM values for it.
For example, the Arduino starter kit came with SM-S2309S servo. Most of the specs for it which I found online told me
Modulation:
Analog
Torque:
4.8V: 13.90 oz-in (1.00 kg-cm)
6.0V: 16.70 oz-in (1.20 kg-cm)
Speed:
4.8V: 0.12 sec/60°
6.0V: 0.10 sec/60°
Weight:
0.32 oz (9.0 g)
Dimensions:
**Length:**0.87 in (22.2 mm)
**Width:**0.46 in (11.6 mm)
**Height:**0.85 in (21.5 mm)
Gear Type:
Plastic
Rotation/Support:
Bushing
Rotational Range:
180°
How can one use this information to compute the PWM?
From trial and error I manage to find the min and max PWM:
const int LED_PIN = 9;
const int PWM_US = 2500; // 500 = one side, 2500 the other side. How to compute this from specs?
const int DELAY_MS = 20; // How to compute this from specs?
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
// Move the servo to one side
digitalWrite(LED_PIN, HIGH);
delayMicroseconds(PWM_US);
digitalWrite(LED_PIN, LOW);
delay(DELAY_MS);
}
To move it continuosly side to side
const int LED_PIN = 9;
const int PWM_US = 15; // How to compute this from specs?
const int DELAY_MS = 20;
void setup() {
pinMode(LED_PIN, OUTPUT);
}
void loop() {
for(int i = 1; i < 180; i++) {
digitalWrite(LED_PIN,HIGH);
delayMicroseconds(PWM_US * i);
digitalWrite(LED_PIN, LOW);
delay(DELAY_MS);
}
delay(2000);
for(int i = 180; i > 1; i--) {
digitalWrite(LED_PIN,HIGH);
delayMicroseconds(PWM_US * i);
digitalWrite(LED_PIN, LOW);
delay(DELAY_MS);
}
delay(2000);
}
You can't compute the PWM signal from the given specification of the servo. Presumably it uses a standard analog servo signal, which would be a pulse with a width of approximately 1000uS to 2000uS, centered on 1500uS, sent 50 times per second (50Hz rate).
That tells you how fast the servo shaft can rotate. With a power supply of 4.8 volts, it takes 120mS to rotate 60 degrees, and with a power supply of 6.0 volts it takes 100mS to move the same amount.
As @david_2018 wrote, standard servos use a common, adjustable pulse train. Here is a simulation using an adjustable pulse train to move a servo... the angle of the servo changes with the values created by the potentiometer. Real values are different from sim values.
Let me put my question directly --
I have 1.5 kg movable mass sitting at 1-cm distance from the rotaton axis of the Servo Motor. I have attached a handle with the rotating shaft of the Servo. Will this Servo (with rated 1.00 kg-cm torque) be able to shift the mass from its present sitting?
I did not work your example numbers, but assuming you did the physics correctly, no.
Torque in a servo is the maximum force available. This means it can hold a position, not necessarily then in addition move it, which would imply, I think, using additional (unavailable) torque.
When the load is not maximal, the excess torque must be large enough to make the arm accelerate and move at whatever rate is needed.
Obvsly you'd ideally want a servo to be loafing when all it was doing was holding position. Most applications of cheap servos are deployed that way by design. Clever mechanical arrangements can reduce the need for holding torque, but the angular momentum of whatever is being turned will always be something to account for.
I think I should be calling the problem overcoming the moment of inertia. S'been a minute.
I have a 10-kg sliding door situated at 5-ft distance from the rotational axis of a Servo. For the Servo to be able to close the door, should the Servo be rated for a torque of 50 kg-cm?