combination with a simulation of the controlled sys-
tem.
As illustrated in Figure 1, a Computer Aided Engi-
neering (CAE) tool chain is used throughout the entire
RCP process. The combination of Matlab / Simulink
and dSPACE is often used in the industry. It sup-
ports the process by several tools. Since high costs
are associated with the acquisition and maintenance,
the low-cost alternative LoRra was developed as part
of several research projects at Ostfalia (Jacobitz and
Liu-Henke, 2020). LoRra is based on low-cost soft-
ware and hardware and is suitable for the develop-
ment of functions in a wide variety of domains due to
its modular, flexible structure.
Version Datum Verwendung Quelle Titel
1.4en 10.07.2019 diverses {Liu-Henke
2015 #77}
Konzept LoRra
Low-Cost
Scilab/Xcos
Xcos-Coder
Xcos specific code
Microcontroller
Gap in the process:
Need for action!
Gap in the process:
Need for action!
Gap in the process:
Need for action!
Modelling
Automatic C-Code
generation
Automatic
implementation
Target Hardware
RCP step
Online experiment
with HMI
RCP development platform
Analysis and Synthesis
High-Cost
Matlab / Simulink
expensive
Simulink Coder
expensive Toolbox
e.g. Scalexio system
expensive
Real-Time Interface
expensive
ControlDesk
expensive
Model libraries
expensive
Modelling
Automatic C-Code
generation
Automatic
implementation
Target Hardware
RCP step
Online experiment
with HMI
RCP development platform
Analysis and Synthesis
LoRra-iGES
For online measurement
and calibration
LoRra-RTI
executable program file
LoRra approach
Scilab/Xcos
LoRra-Code-generator
efficient and adaptable code
Microcontroller
LoRra model libraries
Figure 1: RCP development process with high-cost solution
and LoRra approach (Jacobitz and Liu-Henke, 2020).
The open source tool Scilab / Xcos is used as
the central CAE environment, which is suitable for
simulating hybrid systems from a wide variety of
domains (Nikoukhah, 2006). With the help of the
model library, various continuous-time and discrete-
time model components can be reused and parame-
terized. Through the LoRra code generator, efficient
C code, executable on low-cost target hardware such
as a microcontroller, is generated. Using the LoRra
Real-Time Interface (RTI) (Jacobitz and Liu-Henke,
2019), this code is then automatically implemented
into a run time environment and linked to the inter-
faces of the target hardware. A microcontroller is then
used to run the real-time simulation and to carry out
the online experiments. The measurement and cali-
bration tasks during these experiments are supported
by the human-machine interface iGES.
3 STATE OF KNOWLEDGE
Automatic code generation is an essential part of the
RCP process. It leads to reproducible results as well
as a fast implementation of the function designed
and tested in the simulation model. Moreover, it
avoids random errors and can generate highly effi-
cient code due to special hardware-related optimiza-
tions (Toeppe et al., 1999). The basis for automatic
code generation is the model-to-text transformation of
the function model, which is usually given by a block
diagram model.
In the automotive industry, automatic code gen-
erators have become standard development tools for
ECU functions (Franco et al., 2016). Even in the
aerospace industry, functions are frequently devel-
oped with the help of automatic code generators. The
market offers a correspondingly large selection of dif-
ferent solutions and systems.
The CAE tool Matlab/Simulink is widely used
in industry. With the extensions Simulink Coder
and Embedded Coder, Simulink models can be trans-
formed into universally usable or target hardware-
specific optimized code (Lambersk
´
y et al., 2014).
Many additional extensions are also available, e.g.
for linking hardware peripherals. With TargetLink,
dSPACE also offers a powerful production code gen-
erator that generates highly efficient code while tak-
ing target hardware-specific optimization criteria into
account (Hanselmann et al., 1999).
The open-source CAE tool Scilab / Xcos, succes-
sor of Scicos developed within the Metalau project,
has an integrated code generator. This generates C
code for independent system simulation (so-called
standalone simulation), which is intended for use with
a functional mock-up interface, for example (Bucher
and Balemi, 2005). For execution on a microcon-
troller under real-time conditions without manual ad-
justments, this is not suitable due to the program and
memory structure.
Extensions such as X2C (Grabmair et al., 2014),
developed at the Linz Center of Mechatronics, can
also be used to generate efficient code from Xcos
models that can be executed on microcontrollers.
However, these extensions do not have the necessary
interfaces for integration in the LoRra RCP process.
To realize a seamless low-cost RCP development plat-
form, the LoRra code generator, which is the core of
this paper, was therefore designed and realized.
4 CONCEPTION OF THE LoRra
CODE GENERATOR
The basis for consistent use in the cost-effective RCP
development platform LoRra is the efficient and at
the same time flexible transformation of Xcos mod-
els into microcontroller-suitable C code. Basics of
modelling and simulation using Xcos, as well as the
Automatic Code Generation for a Seamless Low-cost Development Platform
295