
Embedded Robotics (Thomas Braunl, 2 ed, 2006)
.pdf
A. . .CTUATORS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . |
|
3 |
|
|
|
.. . . . . . . . |
|
There are many different ways that robotic actuators can be built. Most prominently these are electrical motors or pneumatic actuators with valves. In this chapter we will deal with electrical actuators using direct current (DC) power. These are standard DC motors, stepper motors, and
servos, which are DC motors with encapsulated positioning hardware and are not to be confused with servo motors.
3.1 DC Motors
Electrical motors can be:
AC motors DC motors Stepper motors Servos
DC electric motors are arguably the most commonly used method for locomotion in mobile robots. DC motors are clean, quiet, and can produce sufficient power for a variety of tasks. They are much easier to control than pneumatic actuators, which are mainly used if very high torques are required and umbilical cords for external pressure pumps are available – so usually not an option for mobile robots.
Standard DC motors revolve freely, unlike for example stepper motors (see Section 3.4). Motor control therefore requires a feedback mechanism using shaft encoders (see Figure 3.1 and Section 2.4).
|
|
Enc1 |
|
Vcc |
M |
Enc2 |
|
Gnd |
Vcc |
||
|
|||
|
|
Gnd |
Figure 3.1: Motor–encoder combination
4141

3 Actuators
The first step when building robot hardware is to select the appropriate motor system. The best choice is an encapsulated motor combination comprising a:
•DC motor
•Gearbox
•Optical or magnetic encoder
(dual phase-shifted encoders for detection of speed and direction)
Using encapsulated motor systems has the advantage that the solution is much smaller than that using separate modules, plus the system is dust-proof and shielded against stray light (required for optical encoders). The disadvantage of using a fixed assembly like this is that the gear ratio may only be changed with difficulty, or not at all. In the worst case, a new motor/gearbox/ encoder combination has to be used.
A magnetic encoder comprises a disk equipped with a number of magnets and one or two Hall-effect sensors. An optical encoder has a disk with black and white sectors, an LED, and a reflective or transmissive light sensor. If two sensors are positioned with a phase shift, it is possible to detect which one is triggered first (using a magnet for magnetic encoders or a bright sector for optical encoders). This information can be used to determine whether the motor shaft is being turned clockwise or counterclockwise.
A number of companies offer small, powerful precision motors with encapsulated gearboxes and encoders:
• Faulhaber http://www.faulhaber.de
• Minimotor http://www.minimotor.ch
• MicroMotor http://www.micromo.com
They all have a variety of motor and gearbox combinations available, so it is important to do some power-requirement calculations first, in order to select the right motor and gearbox for a new robotics project. For example, there is a Faulhaber motor series with a power range from 2W to 4W, with gear ratios available from approximately 3:1 to 1,000,000:1.
+ |
|
Wmotor |
+ |
|
|
|
|
|
R |
L |
|
Va |
Vemf |
J |
_ |
_ |
Wapplied |
|
Kf
Figure 3.2: Motor model
42

DC Motors
T |
Angular position of shaft, rad |
R |
Nominal terminal resistance, : |
Z |
Angular shaft velocity, rad/s |
L |
Rotor inductance, H |
D |
Angular shaft accel., rad/s2 |
J |
Rotor inertia, kg·m2 |
i |
Current through armature, A |
Kf |
Frictional const., N·m·s / rad |
Va |
Applied terminal voltage, V |
Km |
Torque constant, N·m / A |
Ve |
Back emf voltage, V |
Ke |
Back emf constant, V·s / rad |
Wm |
Motor torque, N·m |
Ks |
Speed constant, rad / (V·s) |
Wa |
Applied torque (load), N·m |
Kr |
Regulation constant, (V·s) / rad |
Table 3.1: DC motor variables and constant values
Figure 3.2 illustrates an effective linear model for the DC motor, and Table 3.1 contains a list of all relevant variables and constant values. A voltage Va is applied to the terminals of the motor, which generates a current i in the motor armature. The torque Wm produced by the motor is proportional to the current, and Km is the motor’s torque constant:
Wm Kmi
It is important to select a motor with the right output power for a desired task. The output power Po is defined as the rate of work, which for a rotational DC motor equates to the angular velocity of the shaft Z multiplied by the applied torque Wa (i.e., the torque of the load):
Po WaZ
The input power Pi , supplied to the motor, is equal to the applied voltage multiplied by the current through the motor:
Pi Vai
The motor also generates heat as an effect of the current flowing through the armature. The power lost to thermal effects Pt is equivalent to:
Pt Ri2
The efficiency K of the motor is a measure of how well electrical energy is converted to mechanical energy. This can be defined as the output power produced by the motor divided by the input power required by the motor:
K |
Po |
WaZ |
----- |
-------- |
|
|
Pi |
Vai |
The efficiency is not constant for all speeds, which needs to be kept in mind if the application requires operation at different speed ranges. The electrical system of the motor can be modelled by a resistor-inductor pair in series with a voltage Vemf, which corresponds to the back electromotive force (see Figure 3.2). This voltage is produced because the coils of the motor are moving through a magnetic field, which is the same principle that allows an electric generator to function. The voltage produced can be approximated as a linear function of the shaft velocity; Ke is referred to as the back-emf constant:
43

3 Actuators
Simple motor model
Ve KeZ
In the simplified DC motor model, motor inductance and motor friction are negligible and set to zero, and the rotor inertia is denoted by J. The formulas for current and angular acceleration can therefore be approximated by:
i |
|
|
Ke |
|
1 |
|
|||
|
|
|
|
||||||
---------Z ---V |
a |
||||||||
|
|
|
|
R |
|
R |
|||
GZ |
|
|
Km |
|
|
|
Wa |
|
|
|
|
------- |
i |
|
|
---- |
|
||
Gt |
|
|
J |
|
|
|
J |
|
Figure 3.3 shows the ideal DC motor performance curves. With increasing torque, the motor velocity is reduced linearly, while the current increases linearly. Maximum output power is achieved at a medium torque level, while the highest efficiency is reached for relatively low torque values. For further reading see [Bolton 1995] and [El-Sharkawi 2000].
Velocity [rad/s] |
Current [A] |
Output Power [W] |
Efficiency |
Torque [Nm] |
|
|
Torque [Nm] |
Figure 3.3: Ideal DC motor performance curve
3.2 H-Bridge
H-bridge is needed to run a motor forward and backward
For most applications we want to be able to do two things with a motor:
1.Run it in forward and backward directions.
2.Modify its speed.
An H-bridge is what is needed to enable a motor to run forward/backward. In the next section we will discuss a method called “pulse width modulation” to change the motor speed. Figure 3.4 demonstrates the H-bridge setup, which received its name from its resemblance to the letter “H”. We have a motor with two terminals a and b and the power supply with “+” and “–”. Closing switches 1 and 2 will connect a with “+” and b with “–”: the motor runs forward. In the same way, closing 3 and 4 instead will connect a with “–” and b with “+”: the motor runs backward.
44

H-Bridge
|
1 |
|
3 |
+ |
a |
M |
b |
power supply |
|
|
|
- |
|
|
|
|
4 |
|
2 |
Drive forward: |
|
|
Drive backward: |
|
1 |
|
|
+ |
+ |
M |
- |
power supply |
|
|
|
-
4
3 |
1 |
3 |
+ |
- |
M |
+ |
power supply |
|
|
|
|
|
|
-
2 |
4 |
2 |
Figure 3.4: H-bridge and operation
The way to implement an H-bridge when using a microcontroller is to use a power amplifier chip in combination with the digital output pins of the controller or an additional latch. This is required because the digital outputs of a microcontroller have very severe output power restrictions. They can only be used to drive other logic chips, but never a motor directly. Since a motor can draw a lot of power (for example 1A or more), connecting digital outputs directly to a motor can destroy the microcontroller.
A typical power amplifier chip containing two separate amplifiers is L293D from ST SGS-Thomson. Figure 3.5 demonstrates the schematics. The two inputs x and y are needed to switch the input voltage, so one of them has to be “+”, the other has to be “–”. Since they are electrically decoupled from the motor, x and y can be directly linked to digital outputs of the microcontroller. So the direction of the motor can then be specified by software, for example setting output x to logic 1 and output y to logic 0. Since x and y are always the opposite of each other, they can also be substituted by a single output port and a negator. The rotation speed can be specified by the “speed” input (see the next section on pulse width modulation).
45

3 Actuators
There are two principal ways of stopping the motor:
•set both x and y to logic 0 (or both to logic 1) or
•set speed to 0
x |
a |
speed |
M |
y |
b |
Figure 3.5: Power amplifier
3.3 Pulse Width Modulation
PWM is digital control
Duty cycle
Pulse width modulation or PWM for short is a smart method for avoiding analog power circuitry by utilizing the fact that mechanical systems have a certain latency. Instead of generating an analog output signal with a voltage proportional to the desired motor speed, it is sufficient to generate digital pulses at the full system voltage level (for example 5V). These pulses are generated at a fixed frequency, for example 20 kHz, so they are beyond the human hearing range.
By varying the pulse width in software (see Figure 3.6, top versus bottom), we also change the equivalent or effective analog motor signal and therefore control the motor speed. One could say that the motor system behaves like an integrator of the digital input impulses over a certain time span. The quotient ton/tperiod is called the “pulse–width ratio” or “duty cycle”.
V |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t low speed |
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
V |
|
|
|
is equivalent to: |
|
||||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
V |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t |
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
V |
|
|
|
is equivalent to: |
|
|
high speed |
t
Figure 3.6: PWM
46

Pulse Width Modulation
The PWM can be generated by software. Many microcontrollers like the M68332 have special modes and output ports to support this operation. The digital output port with the PWM signal is then connected to the speed pin of the power amplifier in Figure 3.5.
Velocity [rad/s] |
Velocity [rad/s] |
time [s] |
PW ratio [%] |
Figure 3.7: Measured motor step response and speed versus PW ratio
Figure 3.7, left, shows the motor speed over time for PWM settings of 10, 20, .., 100. In each case, the velocity builds up at time 5s with some delay, then stays constant, and will slow down with a certain inertia at time 10s. These measurements are called “step response”, since the motor input signal jumps in a step function from zero to the desired PWM value.
Unfortunately, the generated motor speed is normally not a linear function of the PWM signal ratio, as can be seen when comparing the measurement in Figure 3.7, right, to the dashed line. This shows a typical measurement using a Faulhaber 2230 motor. In order to re-establish an approximately linear speed curve when using the MOTORDrive function (for example MOTORDrive(m1,50) should result in half the speed of MOTORDrive(m1,100)), each motor has to be calibrated.
Motor calibration Motor calibration is done by measuring the motor speed at various settings between 0 and 100, and then entering the PW ratio required to achieve the desired actual speed in a motor calibration table of the HDT. The motor’s maximum speed is about 1,300 rad/s at a PW ratio of 100. It reaches 75% of its maximum speed (975 rad/s) at a PW ratio of 20, so the entry for value 75 in the motor calibration HDT should be 20. Values between the 10 measured points can be interpolated (see Section B.3).
Motor calibration is especially important for robots with differential drive (see Section 4.4 and Section 7.2), because in these configurations normally one motor runs forward and one backward, in order to drive the robot. Many DC motors exhibit some differences in speed versus PW ratio between forward and backward direction. This can be eliminated by using motor calibration.
47

3 Actuators
Open loop control We are now able to achieve the two goals we set earlier: we can drive a motor forward or backward and we can change its speed. However, we have no way of telling at what speed the motor is actually running. Note that the actual motor speed does depend not only on the PWM signal supplied, but also on external factors such as the load applied (for example the weight of a vehicle or the steepness of its driving area). What we have achieved so far is called open loop control. With the help of feedback sensors, we will achieve closed loop control (often simply called “control”), which is essential to run a motor at a desired speed under varying load (see Chapter 4).
3.4 Stepper Motors
There are two motor designs which are significantly different from standard DC motors. These are stepper motors discussed in this section and servos, introduced in the following section.
Stepper motors differ from standard DC motors in such a way that they have two independent coils which can be independently controlled. As a result, stepper motors can be moved by impulses to proceed exactly a single step forward or backward, instead of a smooth continuous motion in a standard DC motor. A typical number of steps per revolution is 200, resulting in a step size of 1.8°. Some stepper motors allow half steps, resulting in an even finer step size. There is also a maximum number of steps per second, depending on load, which limits a stepper motor’s speed.
Figure 3.8 demonstrates the stepper motor schematics. Two coils are independently controlled by two H-bridges (here marked A, A and B, B). Each four-step cycle advances the motor’s rotor by a single step if executed in order 1..4. Executing the sequence in reverse order will move the rotor one step back. Note that the switching sequence pattern resembles a gray code. For details on stepper motors and interfacing see [Harman, 1991].
|
|
|
|
|
|
|
|
|
Switching Sequence: |
||
|
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
Step A B |
||
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
1 |
1 |
1 |
|
|
|
|
|
|
|
|
|
2 |
1 |
0 |
|
|
|
|
|
|
|
|
|
||||
A |
|
|
B |
|
|
|
3 |
0 |
0 |
||
A |
|
B |
|
4 |
0 |
1 |
Figure 3.8: Stepper motor schematics
Stepper motors seem to be a simple choice for building mobile robots, considering the effort required for velocity control and position control of standard DC motors. However, stepper motors are very rarely used for driving mobile robots, since they lack any feedback on load and actual speed (for example a missed step execution). In addition to requiring double the power electronics, stepper motors also have a worse weight/performance ratio than DC motors.
48

Servos
3.5 Servos
Servos are not servo motors!
DC motors are sometimes also referred to as “servo motors”. This is not what we mean by the term “servo”. A servo motor is a high-quality DC motor that qualifies to be used in a “servoing application”, i.e. in a closed control loop. Such a motor must be able to handle fast changes in position, speed, and acceleration, and must be rated for high intermittent torque.
Figure 3.9: Servo
A servo, on the contrary, is a DC motor with encapsulated electronics for PW control and is mainly used for hobbyist purposes, as in model airplanes, cars, or ships (see Figure 3.9).
A servo has three wires: VCC, ground, and the PW input control signal. Unlike PWM for DC motors, the input pulse signal for servos is not transformed into a velocity. Instead, it is an analog control input to specify the desired position of the servo’s rotating disk head. A servo’s disk cannot perform a continuous rotation like a DC motor. It only has a range of about ±120° from its middle position. Internally, a servo combines a DC motor with a simple feedback circuit, often using a potentiometer sensing the servo head’s current position.
The PW signal used for servos always has a frequency of 50Hz, so pulses are generated every 20ms. The width of each pulse now specifies the desired position of the servo’s disk (Figure 3.10). For example, a width of 0.7ms will rotate the disk to the leftmost position (–120°), and a width of 1.7ms will rotate the disk to the rightmost position (+120°). Exact values of pulse duration and angle depend on the servo brand and model.
Like stepper motors, servos seem to be a good and simple solution for robotics tasks. However, servos have the same drawback as stepper motors: they do not provide any feedback to the outside. When applying a certain PW signal to a servo, we do not know when the servo will reach the desired position or whether it will reach it at all, for example because of too high a load or because of an obstruction.
49

3 Actuators
V
t
V
t
V
t
Figure 3.10: Servo control
3.6 References
BOLTON, W. Mechatronics – Electronic Control Systems in Mechanical Engineering, Addison Wesley Longman, Harlow UK, 1995
EL-SHARKAWI, M. Fundamentals of Electric Drives, Brooks/Cole Thomson Learning, Pacific Grove CA, 2000
HARMAN, T. The Motorola MC68332 Microcontroller - Product Design, Assembly Language Programming, and Interfacing, Prentice Hall, Englewood Cliffs NJ, 1991
50