Actuators & Control · Study deck

Servo Motors: Calibration and Applications

A pan-tilt mount turns two servo angles into a camera view.

Motor Max is your guide for this deck.

servomotors
Motor Max, the module guide, in a scene from this chapter.
iotclass.org

After studying this chapter

Learning objectives

You will be able to:

  • Explain: If a vent linkage needs 0.12 N-m, the ideal margin is only 0.294 / 0.12 = 2.45x before friction, off-axis loading, supply-voltage drop, and gear wear.
  • Explain: If the command corresponds to 90 degrees and the feedback reports 84 degrees, the loop sees a +6 degree error and drives the motor in the direction that shrinks the error.
  • Explain: They replace the hobby servo's potentiometer with an encoder or resolver, use a brushless motor plus a dedicated servo drive, and usually close nested torque-current, velocity, and position loops.
iotclass.org

Major section

Pan-Tilt Camera Mount

A common IoT application is a pan-tilt camera mount.

  • The software clamps protect the intended 0-180 and 0-90 degree ranges; commissioning must still verify that those limits stay clear of the mechanism's physical stops.
  • Limits: each 10-degree step is clamped; TILT_MAX 90 stops backward-looking; attach(pin, 500, 2400) bounds pulse width.
iotclass.org

Major section

Deep Dive: Calibration, Deadband, and Servo Control Loops

A hobby servo command is a position pulse, not a motor-power duty cycle.

  • The 20 ms frame repeats the command; the high-pulse width carries the angle.
  • Sending a 50% duty-cycle signal would hold the line high for 10 ms in each frame, far outside the normal command range.

Key terms

Calibration
Calibration is where a bench demo becomes a reliable mechanism.

Why it matters

A small deadband prevents constant buzzing: with a 5 microsecond deadband and a 0.18 degree-per-microsecond scale, the no-correction window is about 5 x 0.18 = 0.9 degrees.

Servo motor actuator package with PWM command, driver, motor, and potentiometer feedback
Servo motor actuator package with PWM command, driver, motor, and potentiometer feedback
iotclass.org

Major section

Deep Dive: Calibration, Deadband, and Servo Control Loops (continued)

A 1.0 ms pulse in a 20 ms frame is only 5% duty cycle, 1.5 ms is 7.5%, and 2.0 ms is 10%.

  • Calibration is where a bench demo becomes a reliable mechanism.
  • If one servo's safe travel is 1050 microseconds to 1950 microseconds, the usable span is 900 microseconds.
  • Torque and current need the same engineering treatment.
iotclass.org

Major section

Deep Dive: Calibration, Deadband, and Servo Control Loops (continued)

If it overshoots to 92 degrees, the sign changes and the driver corrects back.

  • Mapping that to 0-180 degrees gives 900 / 180 = 5 microseconds per degree, so a 45 degree command is approximately 1050 + 45 x 5 = 1275 microseconds.
  • A 3 kg-cm servo can ideally hold about 3 kg at 1 cm, or 1 kg at 3 cm, before losses.
  • Industrial servos use the same feedback idea at a tighter scale.
iotclass.org

Major section

Deep Dive: Calibration, Deadband, and Servo Control Loops (continued)

In SI units that is roughly 3 x 9.81 N x 0.01 m = 0.294 N-m.

  • If a vent linkage needs 0.12 N-m, the ideal margin is only 0.294 / 0.12 = 2.45x before friction, off-axis loading, supply-voltage drop, and gear wear.
  • Limits: 3 kg-cm is 0.294 N-m: only 2.45x over a 0.12 N-m linkage.
  • If the command corresponds to 90 degrees and the feedback reports 84 degrees, the loop sees a +6 degree error and drives the motor in the direction that shrinks the error.
iotclass.org

Major section

Deep Dive: Calibration, Deadband, and Servo Control Loops (continued)

Too wide a deadband feels sloppy; too narrow a deadband can hunt when the signal is noisy or the linkage is springy.

  • They replace the hobby servo's potentiometer with an encoder or resolver, use a brushless motor plus a dedicated servo drive, and usually close nested torque-current, velocity, and position loops.
  • The current loop controls torque, the velocity loop shapes shaft speed, and the position loop removes final error.
  • The hobby servo hides this behind a three-wire pulse interface; the industrial servo exposes tuning so machine axes can manage stiffness, following error, and response.
iotclass.org

Major section

Smart Vent Zone-Heat Design

This also reduces noise.

  • The system should integrate with a smart thermostat via Wi-Fi and run on mains power (USB adapter at each vent).
  • A large metal-gear servo is overkill (11 kg-cm vs 3 kg-cm needed) and exceeds the local USB power limit.
  • This keeps cable runs under 3 meters for PWM signal integrity and avoids putting 8 separate devices on Wi-Fi.

Numbers to remember

11 kgA large metal-gear servo is overkill (11 kg-cm vs 3 kg-cm needed)
3 kgA large metal-gear servo is overkill (11 kg-cm vs 3 kg-cm needed)
iotclass.org

Deck summary

Key takeaways

A common IoT application is a pan-tilt camera mount.

  • A hobby servo command is a position pulse, not a motor-power duty cycle.
  • A 1.0 ms pulse in a 20 ms frame is only 5% duty cycle, 1.5 ms is 7.5%, and 2.0 ms is 10%.
  • If it overshoots to 92 degrees, the sign changes and the driver corrects back.
  • In SI units that is roughly 3 x 9.81 N x 0.01 m = 0.294 N-m.
iotclass.org

Retrieval practice

Recall check 1 of 4

Motor Max says: answer from memory, then check your reasoning.

Q1A standard hobby servo receives a 1.5ms pulse at 50 Hz. What position will the servo move to?

A0 degrees (minimum position)
B90 degrees (center position)
C180 degrees (maximum position)
DThe servo will not move because 1.5ms is outside the valid range
Show answer

Answer: B Answer: B) 90 degrees (center position).

Q2A high-torque servo has a stall current of 2.5A. If you are building a 3-servo robotic arm, what minimum power supply current rating do you need?

A2.5A
B5A
C7.5A
D1A
Show answer

Answer: C

iotclass.org

Retrieval practice

Recall check 2 of 4

Motor Max says: answer from memory, then check your reasoning.

Q3A maker sends a hobby servo a steady 1.5 ms pulse every 20 ms and it holds mid-position, resisting a gentle push. What is the control mechanism, and how does an industrial servo differ?

AFeedback cancels position error
BDuty cycle holds mid-speed
CUnpowered detent torque locks center
DThe 20 ms period is the angle
Show answer

Answer: A A hobby servo encodes target angle in the high-pulse width, compares it with internal position feedback, and drives the motor to reduce error.

iotclass.org

Retrieval practice

Recall check 3 of 4

Motor Max says: answer from memory, then check your reasoning.

Q4A smart vent system uses a standard hobby servo (0-180 degrees) to adjust airflow. The design requires 270 degrees of rotation to fully open and close the damper. What is the best solution?

ASend PWM values outside the normal 1-2ms range to force the servo beyond its limits
BMechanically modify the servo by removing the internal position stop
CUse a gear reduction mechanism
DUse two 180-degree servos connected in series to achieve 360 degrees total
Show answer

Answer: C A gear reduction mechanism is the correct engineering solution.

iotclass.org

Retrieval practice

Recall check 4 of 4

Motor Max says: answer from memory, then check your reasoning.

Q5Three high-torque servos (2.5A stall each) are powered from the ESP32's 5V pin (500mA max). The servos jitter and the ESP32 randomly resets. What's wrong?

AThe servos need 6V, not 5V
BThe PWM frequency is incorrect
CServo current causes brownouts
DServo signal wires are too long
Show answer

Answer: C This is a classic beginner mistake.

Q6Complete the code to control a servo motor position:

Aservo = PWM(Pin(18), freq=50)
Bservo = PWM(Pin(18), freq=5000)
Cservo = Pin(18, Pin.OUT)
Dservo = PWM(Pin(18), freq=1000)
Show answer

Answer: A Servos use 50 Hz PWM.

iotclass.org

Print reference

Answers

Answer key.

  1. B · Answer: B) 90 degrees (center position).
  2. C
  3. A · A hobby servo encodes target angle in the high-pulse width, compares it with internal position feedback, and drives the motor to reduce error.
  4. C · A gear reduction mechanism is the correct engineering solution.
  5. C · This is a classic beginner mistake.
  6. A · Servos use 50 Hz PWM.
iotclass.org