On Simulation of Simulink
®
Models for Model-Based Design 37-3
2002). Instead, one of the key goals of the chapter is to explain the selection criteria for modeling tech-
niques based on simulation, design, and testing needs. Section 37.2 examines a robotic arm as a case study
and several examples with the goal of understanding different modeling techniques. Section 37.3 dis-
cusses how simulation can be used in control system design. Section 37.4 presents the modeling, spectrum
spanning first-principles modeling from equations, physics-based modeling, and data-driven modeling.
Section 37.5 applies the different modeling approaches to the robotic arm of the case study. Section 37.6
discusses further usages of simulation in control system design. Section 37.7 gives an overview of the use
of testing as a simulation tool in the design of control systems. Section 37.8 presents the conclusions of
this work.
37.2 The Case Study Example
A robotic arm application, shown in Figure 37.1, is used as a case study because it is relatively generic and
so will reduce the need for discussing overwhelming engineering theory. The robotic arm is a commercial
off-the-shelf product.
1
It consists of a turntable base, an “upper arm,” a “forearm,” and a “hand.” Two
revolute joints connect the turntable to the upper arm, and a single revolute joint provides the connection
to each other part. Revolute joints have one degree of rotational motion about a fixed axis, such as a
wheel spinning on an axle. Each joint is connected to a DC motor, which serves as the joint actuator and
a potentiometer, which serves as a position sensor. The motor of a joint moves the bodies connected at
the joint relative to each other. The sensor measures and reports how far the bodies have moved. Each
actuator/sensor pair provides an input/output point, which can be used to manipulate the device through
the use of feedback control (Åström and Wittenmark, 1984; Dorf, 1987).
37.2.1 Feedback Control
Consider the task of moving the upper arm in the robotic arm to a specific position from its current
position. The steps are as follows:
•
The position sensor reports its current position.
•
The position is compared with the desired position and it is decided in which direction the motor
should turn.
•
The motor starts turning in the desired direction.
•
At a regular time interval, for example, every 0.01 s, the sensor value is read and compared with the
desired position.
•
The speed and direction of the motor are then adjusted depending on whether the required position
is being approached or has been passed.
•
These steps are repeated until the required position is reached plus or minus some acceptable
threshold.
In this simple feedback-control algorithm, information is returned regarding the current state of the
robotic arm position, which enables making a decision on what should happen in the next time step.
Feedback control theory and strategies can be arbitrarily complex (Åström and Wittenmark, 1984; Franklin
et al., 2002; Ogata, 2001; Zhou and Doyle, 1997), but the basic process outlined above provides the context
to understand how any feedback-control application can be taken and the algorithm is designed, tested,
and simulated. Figure 37.2 shows the basic feedback-control loop. The plant, the device to be controlled,
is the upper arm with its motor. The sensor is the position sensor. The controller is the algorithm that
adjusts the motor speed and direction on the basis of the difference between desired and actual position.
Now, consider the entire arm. By controlling the motion of each arm segment about the four joints,
the hand can be moved. This is a multiple-input, multiple-output (MIMO) problem of great interest to
1
It can be acquired through Lynxmotion, www.lynxmotion.com.