%!target: tex
%!style(xhtmls): media/themes/Clean/style.css
%!postproc(xhtmls): 'NEWPAGE' ''
+%!nested(xhtmls): --libs syntaxhighlighter
%!options(tex): --enum-title --toc --toc-level 5
%!postproc(tex): '\.pdf\.png' '.pdf'
%!postproc(tex): 'NEWPAGE' '\\newpage'
= Introduction =[introduction]
+This document describes the final results of the project ``Code generation for automotive rapid prototyping
+platform using Matlab/Simulink".
-Code generation for automotive rapid prototyping platform using Matlab/Simulink
+The general layout of this document is as follows:
-= Project setup =[project_setup]
+- Project description, objetives and outcome. This section.
+- Software and Hardware setup for development and repository layout.
+- Extensive description for each of the four products delivered.
+- Glossary.
+- References.
+- Appendices.
+== Background ==[background]
-== Development environment ==[development_environment]
+%DONE
+
+Back in the beginning of 2012 a leading automotive company requested the Czech Technical University
+to develop a Engine Control Unit (ECU) for automotive applications. Real-Time Systems group at the
+Department of Control Engineering from the Faculty of Electrical Engineering developed a hardware and
+Software platform to the needs of this industry. The hardware uses Texas Instruments TMS570LS3137 CPU
+and has was built with automotive standards and interfaces in mind. It uses a real-time operating
+system and was directly programmed in C.
+
+Nevertheless, in accordance to company policies the Software developed for the engine control unit must be
+designed in a safe and auditable way. The company has the policy to implement the Software for their
+system using Model-Based Design:
+
+ Model-Based Design (MBD) is a mathematical and visual method of addressing
+ problems associated with designing complex control, signal processing and
+ communication systems. It is used in many motion control, industrial equipment,
+ aerospace, and automotive applications. Model-based design is a methodology
+ applied in designing embedded software.
+
+In order to meet this requirement an interaction layer between the platform and the Software the company
+uses, Matlab/Simulink, must be implemented. This document describes the implementation of this interaction
+system.
+
+NEWPAGE
+
+== Technologies involved ==[technologies_involved]
+
+%DONE
+
++ Matlab/Simulink data flow graphical programming language tool for modeling, simulating and analyzing
+ multidomain dynamic systems.
++ Standard ANSI C programming.
++ FreeRTOS real-time operating system.
++ Texas Instruments TI Code Generation Tools (CGT).
++ RPP in-house automotive hardware board using Texas Instruments TMS570LS3137 CPU.
+
+== Objectives ==[objectives]
+
+%DONE
+
+Main objectives of this project are:
+
++ Allow C code generation from Matlab/Simulink models for custom made hardware platform.
++ Implement model blocks for some of the peripheral units of the board for use in Simulink programming.
+
+
+At the time of this writing the objectives of this project are considered successfully achieved.
+
+== Benefits ==[benefits]
+
+%DONE
+
+Expected benefits of this project are:
+
++ Enabling faster implementation and rapid-prototyping of Software components through the use of model-based
+ programming.
++ Enabling better and clearer visualization of Software implementations for the hardware board through models.
++ Improve auditability of Software system for automotive applications.
+
+
+At the time of this writing the benefits of this project are considered enabled.
+
+== Final outcome ==[final_outcome]
+
+The main products generated for this project are:
+
+- Simulink RPP Target.
+- RPP Library and API.
+- Simulink RPP Block Library.
+- Simulink Demo Library.
+Each of this product is described deeply in the following sections.
+
+= Project setup =[project_setup]
+
+This sections describes the Software and Hardware setup for development. It also describes the layout of the project
+repository.
+
+== Development environment ==[development_environment]
+
+This section describes the Software setup for development.
=== Operating system ===[operating_system]
+This project was developed on a GNU/Linux operating system. For development it is recommended to use a Debian based
+operating system for development as most of the tools are easily available from repositories. Relevant OS information
+is:
+
+- Ubuntu 12.04.2 LTS AMD64.
+- Kernel 3.2.0-48-generic.
+- GCC version 4.6.3.
+
+
+No test for cross-platform interoperability was performed on the code developed. Although care was taken to try to
+provide platform independent code and tools this are the elements that are know to be Linux dependent:
+
+- LCM1 hardware control tool. @@
+ This tool is both GUI and command line capable, the following just affects the GUI part.
+ Command line should be usable under Windows systems. @@
+ __Cause__: Serial port search algorithm is Linux dependent and Gtk 3.0 dynamic Python bindings aren't available on
+ Windows operating systems.
+- TI CGT support file for RPP Simulink Target ````target_tools.mk``". @@
+ __Cause__: Use UNIX path separator ``/``.
+- Simulink RPP Target download script ````rpp_download.m``". @@
+ __Cause__: Use UNIX path separator ``/``.
+- Simulink RPP Target install script ````rpp_setup.m``". @@
+ __Cause__: Use UNIX path separator ``/``.
+- Simulink RPP Block Library block compilation script ````compile_blocks.m``". @@
+ __Cause__: Call Matlab MEX executable with Unix name.
+- All CCS projects under ``<repo>/rpp/lib/apps/``. @@
+ __Cause__: Paths are configure using UNIX path separator ``/``.
+
=== Version Control System ===[version_control_system]
+The version control system used for this project is **git**. The repository of this project
+contains all the files produced during development, including documentation, references, code and
+graphics. Also the GUI application **gitk** was used to easily review changes. To install both
+execute on a terminal:
+{{{ bash
+sudo apt-get install git gitk
+}}}
=== TI Code Composer Studio ===[ti_code_composer_studio]
-
+Code Composer Studio (CCS) is the official integrated development environment for developing applications
+for Texas Instruments embedded processors. CCS is multiplatform Software based on Eclipse Open Source IDE.
=== Matlab/Simulink ===[matlabsimulink]
How to wire the board for testing.
-= Project development =[project_development]
-
-
-
== Repository structure ==[repository_structure]
+The repository is hosted on the server of the Real-Time Systems group at the Department
+of Control Engineering
-== Outcome ==[outcome]
-
-
+= Programming standards =[programming_standards]
-== Programming standards ==[programming_standards]
+== TLC files ==[tlc_files]
-=== TLC files ===[tlc_files]
+== RPP API ==[rpp_api]
-=== RPP API ===[rpp_api]
-
-=== S-Functions ===[s_functions]
+== S-Functions ==[s_functions]
+NEWPAGE
+
= Glossary =[glossary]
: ADC
In this project it is also used as mnemonic to refer to or something related to the CAN
hardware module.
+: CGT
+ //Code Generation Tools.//
+ Name given to the tool set produced by Texas Instruments used to compile, link, optimize,
+ assemble, archive, among others. In this project is normally used as synonym for
+ ``Texas Instruments ARM compiler and linker."
+
: DAC
//Digital to Analog Converter.//
Hardware circuitry that converts a digital (usually binary) code to an analog signal
//Digital Input.//
Mnemonic to refer to or something related to the digital input hardware module.
+: ECU
+ //Engine Control Unit.//
+ A type of electronic control unit that controls a series of actuators on an internal combustion
+ engine to ensure the optimum running.
+
: ETH
//Ethernet.//
Mnemonic to refer to or something related to the Ethernet hardware module.
Mnemonic to refer to or something related to the 10A, PWM, with current sensing, high-power
output hardware module.
+: IDE
+ //Integrated Development Environment.//
+ An IDE is a Software application that provides comprehensive facilities to computer programmers
+ for software development.
+
: LIN
//Local Interconnect Network.//
The LIN is a serial network protocol used for communication between components in vehicles.
Mnemonic to refer to or something related to the digital output hardware module.
It is logic output (100mA), as opposed to power outputs (2A, 10A).
+: MBD
+ //Model-Based Design.//
+ Model-Based Design (MBD) is a mathematical and visual method of addressing problems associated
+ with designing complex control, signal processing and communication systems.
+
: MEX
//Matlab Executable.//
Type of binary executable that can be called within Matlab. In this document the common term
NEWPAGE
-
= References =[references]
- Horn, M. (2013). //Software obsluhující periferie a flexray na automobilové rídicí jednotce//.
(Unpublished master's thesis, Czech Technical University in Prague, Prague, Czech Republic).
+- //Model-based design//. (n.d.). In Wikipedia.
+ Retrieved March 10, 2013, from http://en.wikipedia.org/wiki/Model-based_design
+
NEWPAGE