The width of the HIGH pulse, between 1 ms and 2 ms.
Correct. The controller measures how long the signal stays HIGH in each period and converts that width into its command voltage. The width is the command, and the pulses have to keep coming.
The duty cycle, the fraction of each period the signal is HIGH.
That is what set the motor’s speed in the motor chapter. A 1 ms pulse every 20 ms is a 5% duty cycle, but the servo reads the 1 ms, not the 5%: at a different period the same duty cycle would be a different width and a different position.
The frequency of the pulses.
The frequency is fixed at about 50 Hz and is the same for every position. It carries no command.
The voltage level of the pulse.
The pulse is a logic level, 3.3 V from our pin, and it is the same for every position. The command is in the pulse’s width.
The center lead is power, the brown lead is ground, and the orange lead is the signal.
Correct. The center lead is power on every hobby servo, the darker outer lead is ground, and the other outer lead carries the pulse.
The center lead is the signal, and the two outer leads are power and ground.
The center lead is power. Wiring the pulse pin to it puts a 3.3 V logic output on the servo’s supply rail, and ties the 5 V supply to the signal lead instead.
The red lead is the signal, because red marks the pin the microcontroller drives.
Red is power on the datasheet’s drawing, as it is on most hobby servos. The signal lead is orange.
The brown lead is power, because it is the darkest.
The darker outer lead is ground, not power. Power is the center lead.
The servo draws about 250 mA while moving and much more when stalled, which is more than the Nucleo’s supply should be asked for.
Correct. The regulator board supplies the servo’s current from the wall adapter, and only the signal lead goes to the STM32C031C6.
The servo needs a 5 V signal on its pulse lead, and the Nucleo’s pins are 3.3 V.
The pulse from PA7 is 3.3 V and the servo reads it fine. The reason is the current on the power lead, not the voltage on the signal lead.
Powered from 3.3 V the servo would turn in the wrong direction.
The direction the servo turns is decided by its controller from the pulse width. The supply voltage sets how much current the servo can draw and how hard it can push, not which way.
The Nucleo cannot produce a 50 Hz signal.
It can, and TIM14 will produce it. The signal comes from the Nucleo; only the servo’s power comes from the regulator board.
The SG92R datasheet gives the operating speed as 0.1 s per 60° at 4.8 V. About how long does the servo take to swing from one end of its travel to the other, its nominal 180°?
Correct. 180° is three times 60°, so three times 0.1 s. This is the number that matters when a program has to wait for the arm to arrive before it takes its next reading.
About 0.1 s.
0.1 s is the time for 60°, a third of the travel.
About 3 s.
That is ten times too long. The datasheet’s 0.1 s per 60° gives 0.3 s for 180°.
It depends on the pulse width we send.
The pulse width sets where the arm goes, not how fast it gets there. The speed is a property of the servo, and the datasheet gives it.