Skip to main content

Check Your Understanding 13.1.6 Check Your Understanding

1.

The servo’s controller reads a position command out of the pulse train we send it. Which property of that signal carries the command?
  • 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.

2.

The SG90 datasheet’s wiring drawing shows the servo’s three leads. Which lead is which?
  • 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.

3.

Why is the servo’s power lead connected to the regulator board’s 5 V pin rather than to a pin on the Nucleo?
  • 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.

4.

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°?
  • About 0.3 s.
  • 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.

5.

In the feedback diagram in Figure 13.1.2, the error is a difference. A difference of what two quantities?
  • The commanded position and the potentiometer’s measurement of the output position.
  • Correct. Both are voltages inside the servo, and the controller drives the motor until they are equal.
  • The pulse width and the pulse period.
  • Those describe the command signal we send in. The error is formed inside the servo, between the command and the measured position.
  • The motor’s speed and its torque.
  • Speed and torque are what the motor produces on the way to the position. The error is about position, not about either of them.
  • The supply voltage and the motor’s back-EMF.
  • That difference sets the current through a DC motor, from Day 11. The servo’s error compares positions, not voltages across the motor.