velopment of the control algorithm using the block
diagram editing and doesn’t have to be worried about
the input/output peripheral handling based on manual
coding.
In this paper, we propose a method to construct a
function block for the dynamic matrix control for use
with RCP system based on Simulink. The presented
block is implemented in C-code and thus has good
computation property. Due to this fact, the resultant
control can be applied to systems with relatively fast
sample rate. The DMC block can also translated into
C-code through the automatic code generation pro-
cess. In this paper, we will use a lab-built RCP en-
vironment for the application of the proposed DMC
block.
The paper is structured as follows: In Section 2,
we give brief introduction to a lab-built RCP system.
In Section 3, we present the method to construct a
DMC block. In Section 4, we summarize the proce-
dures about how to construct a speed control system
for a DC motor using the DMC block. Finally in Sec-
tion 5, we make conclusions on the presented results.
2 INTRODUCTION OF THE DAQ
RCP
Rapid control prototyping (RCP) system is a kind of
development environment that is used for the design,
development, and verification of the controller pro-
totype in an efficient way. Generally RCP systems
consist of a block diagram based modeling program
such as Simulink, library blocks to handle the hard-
ware input/output peripherals, automatic C-code gen-
erator, realtime target computer, and a host computer
communicating with the target computer. The design
and the simulation of the controller are done under
Simulink. If the simulation result is satisfactory, the
controller is constructed by using the input/output
peripheral library blocks. After the code generation
of the controller model, the compiled executable is
downloaded to a realtime target computer and the re-
altime control experiment is performed. While the ex-
periment is being performed, one can monitor signals
using a host computer connected to a target computer.
With the help of the input/output peripheral block li-
brary and code generation tool supported in the RCP
system, the controller designers have only to focus on
the algorithm itself without worrying about the error
prone manual coding.
Several RCP systems are available commer-
cially in the market. Matlab/Simulink is the most
well known and widely used among those sys-
tems. Realtime Workshop (RTW), the add-on prod-
uct of Simulink, generates C-code for the block
diagram-based model constructed by Simulink (Inc.,
2005b). Embedded coder, another add-on product of
Simulink, generates C-code specific to a certain em-
bedded processor and thus reduce the time for the de-
velopment (Inc., 2005a). Matlab/Simulink and RTW
are open architecture and thus several lab-developed
RCP systems for custom-developed hardware have
been proposed in academia (Rebeschieß, ; Hong et al.,
2000; Lee et al., 2004; Hercog and Jezernik, 2005;
Bucher and Balemi, 2006; Lee et al., 2012). Further-
more, several researches related with the application
of RCP system are published (Lin et al., 2006; Ken-
nel, 2006).
In this paper, we use the RCP system proposed in
(Lee et al., 2012). The RCP system proposed in (Lee
et al., 2012) utilizes a DAQ board with high speed
USB communication interface and Matlab/Simulink.
Because it uses a DAQ board with a microcontroller
as a basic component, we will call the system as
the DAQ RCP throughout the paper. The DAQ RCP
system consists of two subsystems as in Figure 1.
The first subsystem is a PC system on which Mat-
lab/Simulink is running and the second subsystem is
a DAQ board with high speed USB interface. The PC
and the DAQ board communicates the data (control
data and sensor data) with each other throughtheUSB
communication. Unlike the conventional RCP system
where the control algorithm is automatically gener-
ated in C-code from the Simulink controller model,
the DAQ RCP system has a feature that the Simulink
controller model acts as a realtime controller without
code generation. Measurement of the sensor data and
the application of the control data to output peripher-
als are taken care of by the DAQ unit with a microcon-
troller. Figure 2 Figure 2 is the flowchart that shows
how the control is performed. Each stage in the flow
chart can be summarized as follows:
S1: The DAQ unit measures all the required sensor
data and sends them to the PC through USB com-
munication.
S2: Simulink running on the PC receives the data
sent from the DAQ unit.
S3: Simulink performs the control computation using
the received sensor data.
S4: Simulink sends the computed control data to the
DAQ unit.
S5: The DAQ unit applies the received control data
from the PC to corresponding output peripherals
(DAC, PWM, etc).
It is noted that all the tasks performed in the DAQ unit
are handled by the microcontroller. As mentioned in