Original title:
Využití nástroje MATLAB Coder pro automatické generování C kódu pro mikrokontroléry dsPIC
Translated title:
Application of MATLAB Coder for automatic generation of C code for dsPIC microcontrollers
Authors:
Mácha, Tomáš ; Křivánek, Václav (referee) ; Grepl, Robert (advisor) Document type: Master’s theses
Year:
2019
Language:
cze Publisher:
Vysoké učení technické v Brně. Fakulta strojního inženýrství Abstract:
[cze][eng]
Generování kódu C z MATLABu může představovat mocný nástroj u široké škály inženýrských problémů. Zejména pak u operací ve kterých MATLAB vyniká, zahrnujících operace s maticemi a některé z vestavěných funkcí, může převod kódu představovat výrazné urychlení vývoje jejich aplikací. Cílem této diplomové práce je prozkoumat možnosti generování kódu C pomocí balíku MATLAB Coder. Jelikož byla dokumentace k MATLAB Coderu shledána jako nedostatečná, byl do práce začleněn také teoretický základ pro použití tohoto balíku a to spolu s jednoduchými ukázkami možných aplikací. Dále byl navržen a popsán nástroj pro automatcké generování kódu pro řízení laboratorního modelu DC motoru využívající mikrokontrolér dsPIC. Jednotlivé kroky byly popsány a doplňují tak stávající dokumentaci. Závěrem práce je testováno generování kódu také pro vybrané funkce. Díky tomu mohou být nastíněna jistá omezení a obecně také vhodnost jak vytvořeného nástroje, tak také balíku MATLAB Coder.
Generating C code from MATLAB can be a powerful tool for a wide range of engineering problems. Especially in cases where MATLAB excels, including matrix operations and some of the built-in functions, code conversion may represent a significant assistance in their development. The aim of this master's thesis is to explore the possibilities of generating C code using MATLAB Coder App. As the documentation for MATLAB Coder was not found sufficient a theoretical basis for the use of this tool was introduced along with simple examples of possible applications. Next, code generation for controlling a laboratory DC motor using a microcontroller dsPIC was made automatic and controlled directly from a single MATLAB script. Individual steps were described to supplement existing documentation and to allow for an easy use. Finally, selected functions were tested for code generation. As a result, certain limitations can be outlined, as well as suitability of both the created tool and the MATLAB Coder App.
Keywords:
Arduino.; Command Line; Double drive; dsPIC33FJ128MC804; MATLAB; MATLAB Coder App; MPLAB Device Blocks for Simulink; Arduino.; Double drive; dsPIC33FJ128MC804; MATLAB; MATLAB Coder App; MPLAB Device Blocks for Simulink; Příkazová řádka
Institution: Brno University of Technology
(web)
Document availability information: Fulltext is available in the Brno University of Technology Digital Library. Original record: http://hdl.handle.net/11012/179090