]> rtime.felk.cvut.cz Git - jenkicar/rpp-simulink.git/blob - doc/presentation/publish/xhtmls/presentation.html
77248a13aa5ce50b6be1b376c59e05b4d29b49a2
[jenkicar/rpp-simulink.git] / doc / presentation / publish / xhtmls / presentation.html
1 <?xml version="1.0"
2       encoding="UTF-8"
3 ?>
4 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml">
6 <head>
7     <title>Simulink coder target for automotive rapid prototyping platform</title>
8     <meta name="generator" content="http://nestededitor.sourceforge.net/" />
9     <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
10     <link rel="stylesheet" type="text/css" href="media/themes/Clean Presentation/style.css" />
11 <script type="text/javascript" src="media/libraries/jquery/jquery.min.js"></script>
12 <link rel="stylesheet" type="text/css" href="media/themes/Clean Presentation/style.css" />
13 <script type="text/javascript" src="media/themes/Clean Presentation/scripts.js"></script>
14 </head>
15 <body>
16
17 <div class="header" id="header">
18 <h1>Simulink coder target for automotive rapid prototyping platform</h1>
19 <h2>Carlos Jenkins</h2>
20 <h3>June, 2013</h3>
21 </div>
22
23 <div class="body" id="body">
24
25 <div id="section1" class="section">
26 <div style="margin-top: 10%; text-align: center; font-size: 1.3em;">
27 <p>
28 Simulink coder target for automotive rapid prototyping platform
29 </p>
30 </div>
31 <p>
32 <img style="display: block;margin: 0 auto 0 auto;" width="300" src="media/images/logos.png" alt=""/>
33 </p>
34 </div>
35
36 <div id="section2" class="section">
37
38 <h1 id="agenda">Agenda</h1>
39
40 <ul>
41 <li>Background.
42 </li>
43 <li>About Simulink.
44 </li>
45 <li>Things developed.
46  <ul>
47  <li>C Library.
48  </li>
49  <li>Simulink Target.
50  </li>
51  <li>Simulink Block Set.
52  </li>
53  <li>Demos.
54  </li>
55  </ul>
56 </li>
57 <li>Questions.
58 </li>
59 </ul>
60
61 </div>
62
63 <div id="section3" class="section">
64
65 <h1 id="background">Background</h1>
66
67 </div>
68
69 <div id="section4" class="section">
70
71 <h1 id="about_simulink">About Simulink</h1>
72
73 </div>
74
75 <div id="section5" class="section">
76
77 <h1 id="things_developed">Things developed</h1>
78
79 <ul>
80 <li><strong>C Library</strong>: <br />
81   Define the API to communicate with the board. Include drivers and operating system.
82 <p></p>
83 </li>
84 <li><strong>Simulink Target</strong>: <br />
85   Allows Simulink model's code generation, compilation and download to the board.
86 <p></p>
87 </li>
88 <li><strong>Simulink Block Set</strong>: <br />
89   Set of blocks that allows Simulink models to use board IO and communication peripherals.
90 <p></p>
91 </li>
92 <li><strong>Demos</strong>: <br />
93   Just a bunch of examples of control application in form of Simulink models.
94 </li>
95 </ul>
96
97 </div>
98
99 <div id="section6" class="section">
100
101 <h2 id="c_library">C Library</h2>
102
103 <p>
104 Characteristics:
105 </p>
106
107 <ul>
108 <li>Include drivers and operating system (FreeRTOS).
109 </li>
110 <li>Exposes a high-level user-oriented API for controlling the board.
111 </li>
112 <li>Static library, as part of the compilation each Simulink model link against this.
113 </li>
114 </ul>
115
116 </div>
117
118 <div id="section7" class="section">
119
120 <h3 id="library___layers">Library - Layers</h3>
121
122 <p>
123 <img style="display: block;margin: 0 auto 0 auto;" src="media/images/layers.png" alt=""/>
124 </p>
125 </div>
126
127 <div id="section8" class="section">
128
129 <h3 id="library___modules">Library - Modules</h3>
130
131 <p>
132 <img style="display: block;margin: 0 auto 0 auto;" src="media/images/blocks.png" alt=""/>
133 </p>
134 </div>
135
136 <div id="section9" class="section">
137
138 <h3 id="library___modules_implemented">Library - Modules implemented</h3>
139
140 <p>
141 Modules in the scope of this project:
142 </p>
143
144 <ul>
145 <li><strong>DIN</strong> : Digital Input.
146 </li>
147 <li><strong>LOUT</strong>: Digital Output.
148 </li>
149 <li><strong>AIN</strong>: Analog Input.
150 </li>
151 <li><strong>AOUT</strong>: Analog Output.
152 </li>
153 <li><strong>HBR</strong>: H-Bridge.
154 </li>
155 <li><strong>MOUT</strong>: Power outputs (2A).
156 </li>
157 <li><strong>SCI</strong>: SD-RAM logging.
158 </li>
159 <li><strong>SCI</strong>: Serial Communication Interface.
160 </li>
161 </ul>
162
163 </div>
164
165 <div id="section10" class="section">
166
167 <h2 id="simulink_target">Simulink Target</h2>
168
169 <p>
170 Allows Simulink model's code generation, compilation and download to the board.
171 </p>
172 <p>
173 It is composed by:
174 </p>
175
176 <ul>
177 <li>Installation script.
178 </li>
179 <li>Target descriptor.
180 </li>
181 <li>Template to generate a Makefile for source compilation.
182 </li>
183 <li>Template to generate the C <em>main</em> file (entry point).
184 </li>
185 <li>Script to download the compiled model binary to the board.
186 </li>
187 <li>Other minor control and support files.
188 </li>
189 </ul>
190
191 <p>
192 Simulink generates code for almost all the standard blocks. But the model needs a way
193 to output the results or input data so new blocks for board IO needed to be implemented.
194 </p>
195 </div>
196
197 <div id="section11" class="section">
198
199 <h2 id="simulink_block_set">Simulink Block Set</h2>
200
201 <p>
202 <img style="display: block;margin: 0 auto 0 auto;" width="600" src="media/images/block_library.png" alt=""/>
203 </p>
204 </div>
205
206 <div id="section12" class="section">
207
208 <h3 id="simulink_block_set___anatomy">Simulink Block Set - Anatomy</h3>
209
210 <p>
211 Each block is composed by:
212 </p>
213
214 <ul>
215 <li>C-MEX S-Function. Fancy way to say:
216  <ul>
217  <li>C : Implemented in C language. Other options are Fortran and Matlab language itself.
218  </li>
219  <li>MEX: Matlab Executable. Yes, it can be executed in Matlab, that's all. They are compiled by 
220    Matlab GCC wrapper called MEX.
221  </li>
222  <li>S-Function: System Function, as opposed to standard functions, or user functions.
223  <p></p>
224  </li>
225  </ul>
226 </li>
227 <li>TLC (Target Language Compiler) file for code generation for that block.
228 </li>
229 </ul>
230
231 </div>
232
233 <div id="section13" class="section">
234
235 <h3 id="simulink_block_set___c_mex_s_function">Simulink Block Set - C-MEX S-Function</h3>
236
237 <p>
238 C file that uses the S-Function API to describe what the block does:
239 </p>
240
241 <ul>
242 <li>Number of inputs and outputs. Just like a function.
243 </li>
244 <li>Datatype of each input and output. Can be static or dynamic (block context).
245 </li>
246 <li>Arity of each input and output. Scalar (single value), 1-D (array), 2-D (matrix). <br />
247   Matlab supports crazy things as dynamic n-dimensional dynamically typed matrices :O.
248 </li>
249 <li>Number of parameters (different from inputs), used to configure the block.
250 </li>
251 <li>Validation of parameters (things like range and datatype).
252 </li>
253 </ul>
254
255 <p>
256 It can be used also for the block to do something within Simulink. Right now they are just descriptors.
257 </p>
258 </div>
259
260 <div id="section14" class="section">
261
262 <h3 id="simulink_block_set___tlc_file">Simulink Block Set - TLC file</h3>
263
264 <p>
265 File that defines how to generate code for that block (term is <em>inline</em>).
266 </p>
267 <p>
268 Defines template C code and rules that will be used on code generation for:
269 </p>
270
271 <ul>
272 <li>Initialization of the block (required headers, calls to initialization functions, etc).
273 </li>
274 <li>The step function, the one that is called at each step to update the model. <br />
275   "The function that is called in the main loop".
276 </li>
277 <li>Model termination. Like free manually allocated memory. Not used in our context.
278 </li>
279 </ul>
280
281 <p>
282 TLC files can be viewed as wrappers for the C library API.
283 </p>
284 </div>
285
286 <div id="section15" class="section">
287
288 <h3 id="simulink_block_set___process">Simulink Block Set - Process</h3>
289
290 <p>
291 <img style="display: block;margin: 0 auto 0 auto;" src="media/images/tlc_process.png" alt=""/>
292 </p>
293 </div>
294
295 <div id="section16" class="section">
296
297 <h2 id="demos">Demos</h2>
298
299 <p>
300 12 demos for things like:
301 </p>
302
303 <ul>
304 <li>Control analog output using analog input. Same for digital.
305 </li>
306 <li>Control H-Bridge (motor speed and direction) using analog input.
307 </li>
308 <li>Print a message. Echo all bytes received via SCI.
309 </li>
310 <li>Software generate a nice sinewave of analog outputs.
311 </li>
312 <li>Log each second the data read on one analog input.
313 </li>
314 <li>Others.
315 </li>
316 </ul>
317
318 </div>
319
320 <div id="section17" class="section">
321
322 <h2 id="demos___h_bridge_analog_control">Demos - H-Bridge Analog Control</h2>
323
324 <p>
325 <img style="display: block;margin: 0 auto 0 auto;" src="media/images/demo_hbridge_analog_control.png" alt=""/>
326 </p>
327 </div>
328
329 <div id="section18" class="section">
330
331 <h1 id="questions">Questions?</h1>
332
333 <div style="margin-top: 10%; text-align: center; font-size: 1.3em;">
334 <p>
335 Thank you
336 </p>
337 </div>
338 </div>
339 </div>
340 </body></html>