Home

RT-MaG ToolBox User's guide

image

Contents

1. File Edit View Help 0 Enter search term is Library RT MaG ToolBox COM Search Results none Most Frequently Used Blocks E Wi DSP System Toolbox EDA Simulator Link DisplaySample de E inodd 3 me ih Embedded Coder veCol Fuzzy Logic Toolbox y Ihe COM lib Instrument Control Toolbox e ra ry Model Predictive Control Neural Network Toolb bl k ocks QUARC Applications ae gt ToS nd 2 int16 7 Fr J te BUS Tr ToReceive 2 int16 P Emission Out_to_Serial_1 ToSend 16 float32 UDP Emission Out to UDP ToReceive 2 float32 b ToReceive 2iptt6 b Sy UDP RS232 Reception Reception In_from_UDP In_from_Serial PWM_9 Refresh rate 0 33333 Hz E e RT MaG ToolBox HOST a Toolbox T h e H O S T SimRF RO library blocks Simulink Coder SERVO Mode PWM PWM_10 PWM Frequency 333 Hz Emission Showing RT MaG ToolBox COM Out to PWM Out to l2C Figure 5 How to configure your Simulink Figure 6 The inputs and Outputs block of the RT MaG toolbox model in the Configuration Parameters SPI I2C File logging PWM RS232 UDP classic Simulink I O blocks You just have to respect the limitation of each I Os e g a emission and reception RS232 block need to use the same baudrate if they use the same device The limitations of each blocks are described on the RT MaG website in the T
2. RT MaG Generating Outputs attribution for Sample Time 0 001 s RT MaG Generating I O initialization RT MaG Generating specific main s argument processing RT MaG Generating defines file defines_verdex h RI MaG Generating shell script file genere_RT_COM_InOut_Full_MultiTask_Clock l RTI MaG Generating complete build directory ToBuild_ COM_InOut_Full_MultiTask_Clock Lubrary 2 Geer library_LOG c library_PWM c librar oak haces Hbrary rs232 Cn ER ra y udp oeo time tools c Copying Copying Copying Copying Copying Copying Copying Copying library 12C h Copying library_LOG h Copying libraryPWM h Copying library_SPI h Copying library rs232 h Copying library_udp h Copying time_tools h Copying COM_InOut_Full_MultiTask_Clock c Copying COM_InOut_Full_MultiTask_Clock_data c Copying main_COM_InOut_Full_MultiTask_Clock c Copying rtGetInf c Copying rtGetNaN c Copying rt_nonfinite c Copying COM_InOut_Full_MultiTask_Clock h Copying COM_InOut_Full_MultiTask_Clock_private h Copying COM_InOut_Full_MultiTask_Clock_types h Copying defines_verdex h Copying rtGetInf h Copying rtGetNaN h Copying rt_nonfinite h Copying rtwtypes h RT MaG Echo Processing for VERDEX sources printf OFF fprintf OFF execution time printf OFF execution time fprintf OFF RT MaG Generating complete archive COM _InOut_Full_MultiTask_Clock_sources zip RTI MaG Cop
3. e ECHO_PRINTF_TIME to activate the timing debug mode in a console e ECHO_FPRINTF_TIME to activate the timing debug mode in a file 3 2 The synchronization protocols For the RS232 connection you can choose to activate or not a synchronization protocol As it is not possible in a RS232 bus to separate frame you can choose to activate a synchronization protocol This protocol consists in a simple stream send at the beginning of the program allowing to say to the remote device that the program begins This synchronization protocol consists in a Start stream which is send to the remote device and the program starts when the remote device sends the same start stream in response Remark 4 If a synchronization protocol fails the program will not begin and you can see what fail For example which start stream was received back A synchronization protocol fail often occur if the baudrate of your RS232 device and the remote device are not the same 12 WW Block Parameters Gumstix Configuration RS232 Synchronization Protocol SendStart gt WaitStar WaitStart gt SendStart SendStart gt WaitStart RS232 Start Stream Waiting Ti 100 RS232 Synchronization Message START Look J cancel J Help Jl App OM VERBOSE Time Scheduler Gumstix Configurstion 13
4. off _ox_ Cancel Help Apply Block Parameters Gumstix Configuration Subsystem mask TimeScheduler Input Ouput Verbose Timing Debug Synchro Protocol z RS232 Synchronization Protocol None Cancel Apply Figure 7 The COM configuration block of RT MaG Each Simulink model destined to be run on a COM needs this block There can have only one configuration block per model You have to choose carefully all the options of this block because it manage how the application will be executed The I Os and timing debug modes are really useful to detect a misconfiguration but keep in mind they can slow down your application 2 4 Generate the Standalone application To generate the two models Embedded and Host you just built you just have to run the following Matlab commands gt gt GenereHost ModelName HostSampleTime gt gt GenereCOM ModelName ComSampleTime As you can see these two functions need you to specify a sample time which corresponds to the minimum sample time of your model The sample time you will pass as argument will be then assigned in your Matlab workspace as HostMinSampleTime and ComMinSampleTime for the host and the COM respectively This is the variable given to the Simulink Configuration Parameters as the solver fixed step sample time fundamental sample time As a consequence if you use
5. Emission O PortData dev ttyO2 2 115200 As you can see these structures summarize all the I O informations useful to generate the archive The GenereCOM function will also generate a lot of different files an directories Some files and directories are generated by Embedded Coder itself and the other are generated by RT MaG toolbox Here you can find a rapid description of the main generated files and directories and their signification e directories e files 4h MATLAB R2011b slprj is a directory generated by Simulink which contains some files used during the code generation This folder is not useful after and can be deleted COM_ModelName_ert_rtw is a directory generated by Embedded Coder it contains all the c files needed to declare the Simulink variables an realizes the model functions Some of theses files were used by RT MaG toolbox during the generation but you can delete this folder if you want To_Build COM_ModelName is the directory generated by RT MaG toolbox It contains all the files needed to generate the standalone application on your COM included the main part of the Embedded Coder files contained in the folder COM_ModelName ert_rtw For a sake of simplicity an archive of this folder is available into it and was also copied on your FTP server COM_ModelName_sources zip In the folder COM_ModelName_ert_rtw their is ert_main c which is a simple example provided by Embedded Coder of
6. and then to play it During the execution of the model you will be able to modify all the parameter you want in the host model If you send this parameter to your COM model via UDP you will be able to tune your controller parameters running on the COM model This is the ideal way to achieve rapid prototyping of controllers in real time 11 To run this model you need first to load it on the real time target which will execute this model in real time To do this just click on Connect to target as described by the figure 11 Once the target is connected you can BH QUARC_MonitorAttitude File Edit View Simulation Format Tools QUARC Help Di ee amp ac Bit Bdema J Seer Fae ee ee Connect To Target SSS I Figure 11 The connect to target step for loading the model on the real time target before running it run the model by simply click on Start real time code as described by figure 12 Then during the simulation W OUARC MonitorAttitude File Edit View Simulation Format Tools QUARC Help De a inf Extema _ _ Start real time code ll Figure 12 The start real time code step for running a real time Simulink model on the host computer you can change every parameters you want and it will take effect immediately 3 Advanced functionalities 3 1 The debug modes You can activate in the configuration block described
7. complete archive COM InOut Full MultiTask Clock sources zip run D TOOLBOX RT MaG Prc RT MaG Copying shell script in ToBuild COM InOut Full MultiTask Clock run D TOOLBOX RT MaGXPrc COM InOut Full MultiTask Clock mdl N COM InOut_Full_MultiTask_Clock zip init_COM_InOut_Full_MultiTask_Clock m Copying library rs232 h COM _InOut_Full_MultiTask_Clock_ert_rtw ida ar asc Com M l n Sam pleTi me HH ComMinSampleTime 1 0000e 03 Copying time tools h Gumstix ToBuild COM InOut Full MultiTask Clock ed Viso ee o S E 10_2 Process The minimum sample time A AA ComMinSampleTime The structures Gumstix iminy Kees s lt Copying rt_nonfinite c a n d IO Copying COM InOut Full MultiTask Clock h al Copying COM InOut Full MultiTask Clock private h opying defines verdex h Copying rtGetNaN h Copying rt_nonfinite h Command History Mm ax Cle J amp 18 03 2014 00 57 Copying rtwtypes h RI MaG Echo Processing for VERDEX sources RT MaG Copying Archive and shell script on FIP directory G tix UDP RT MaG GENERATION OF CODES COMPLETED SUCCESSFULLY E EE ye O O O O RT MaGf You can build this model using UpToDateCOM InOut Full MultiTask Clock on your COM Gumstix UDP Reception Details Select a file to view details v RT MaG Then you can run this model using RunModelCOM InOut Full MultiTask Clock d lt durat run D TOOLBOX RT_MaG Pr
8. errors e test programs both in Processor In the Loop PIL and RunTime mode The toolbox will configure automatically the COM and you can be concentrated only on the control of your robot 1 1 Application structure WRN NN EN NN UN NN LU LU a EU EU j i b a PIL mode ifb RunTime mode mue a a a Consol Application i Host Computer Linux Commands Consol m LE root gumstix gee TH Task monitoring Task monitoring root gumstix Jua Real Time High level SetPoints parameters High level SetPoints EHO Embedded Simulink SetPoints Model High level SetPoints parameters Monitoring Robot Model __ pica a a Sensors values lt AM E A ontrol inputs Figure 1 a The Processor In the Loop mode allows to validate and test the robotic application in real time on the COM without damaging the robot Here the PIL was used to validate the controllers of the X4 MaG Quadrotor The host computer could be used to emulate the RS232 connection of a low level controller and to simulate the robot behaviour b The RunTime mode i e when the robot is running This application has the same interfaces than in the PIL mode As it could be seen the application of the COM remains the same which avoid new bug to appear a Estimates control inputs accelerate design Oua
9. solver discrete or ode1 E 3 ile Accelerator Start time 0 0 Stop time inf Rapid Accelerator Embedded Code ert tlc caer een I COM MonitorAttithde pS Processor in the Loop PIL Type Fixed step y Solver discrete no continuous states y File Edt Mia format Daai OL Ne hain External F E Sa Configuration Payameters COM_MonitorAttitude QUARC Target for Verdex Configuration Active gt a6 ES Dj Fixed step size fundamental sample time ComMinSampleTime Select Target selection In_from_UDP H Tasking and sample time options i Solver System target file ert tlc Data Import Export FF SS Periodic sample time constraint Unconstrained Optimization Language e y N Di i Tasking mode for periodic sample times Auto i ingenios Description Embedded Coder a Les 4 Hardware Tmplementa Y ToReceive 1154pt16 E Automatically handle rate transition for data transfer Be PWM 7 Model Referencing N aa Z Simulation Target E sida 2 Y Higher priority value indicates higher task priority tate 200 Hz Tara Reception Ey Code Generation 4 In_from_Serial eguency 333 Hz Report Makefile configuration el Target File E Comments E Generate makefile pags BUDD IP O Data Type Replace S
10. MultiTask Clock c HH Writing header file COM _InOut_Full_MultiTask_Clock_private h HH Writing source file COM_InOut_Full_MultiTask_Clock_data c HH Writing source file ert main c HHH TLC code generation complete HH Creating project marker file rtw_proj tmw HH Evaluating PostCodeGenCommand specified in the model HHH Successful completion of code generation for model COM InOut Full MultiTask_ Clock RT MaG Begin to genere code for the StandAlone application using ACOM InOut Full MultiTask_ Clock ert rtw RI MaG Generating main file main_ COM_InOut_Full_MultiTask_Clock c RT MaG Generating headers includes RT MaG Generating global variables RT MaG Generating I O proper termination RT MaG Generating Inputs attribution for Sample Time 0 1 s RT MaG Generating Outputs attribution for Sample Time 0 1 fs RT MaG Generating Inputs attribution for Sample Time 0 01 fs RT MaG Generating Outputs attribution for Sample Time 0 01 s RT MaG Generating Inputs attribution for Sample Time 0 005 s RT MaG Generating Outputs attribution for Sample Time 0 005 fs RT MaG Generating Inputs attribution for Sample Time 0 003 fs RT MaG Generating Outputs attribution for Sample Time 0 003 fs RT MaG Generating Inputs attribution for Sample Time 0 002 s RT MaG Generating Outputs attribution for Sample Time 0 002 s RT MaG Generating Inputs attribution for Sample Time 0 001 s
11. RT MaG ToolBox User s guide Augustin Manecy March 21 2014 Contents 1 Description 11 Application StrUChUTS 2 424 bbe eww Eee ERR GR RO EEE UR O EE OR OB 1 2 Toolbors Gor GW gw ew Bw we Ge seassa SE OEE ERE BRR EDR EEEE SEK EES 2 Starter guide l ii a co AB ES A A oO ERR ea ee a 22 RI MaG tools for your COM sc been RR ER ERE RAE EU HR REU EER RD od 2 2 1 Development computer tools IG GG GG GG GG GG GL 2 u P2u2 Yu Y Y2 uYhu uu Y II AA o IEEE 2 3 Create a model IE 2 3 1 Simulink configuration parameters ooo a e e III GG GG GG GG I o The Orbo se he Behe Oe REESE AEE DO YE UD AUU EEE SG pan COM conicuration DOCK gt s Re Kw ERE HOD AKA ERD EHR SDS 2 4 Generate the Standalone application PG GG GG GG G9 G2 u Yu uY YG YG G2 uYPYuYuY a 241 GENEDL OU vee kh kee eG dy Rd A A bM taa DAU GO TU LAWS AC a e Bl dt oh Bn dn EG A hk ae RRR EE CES CEN CE NN NAW ANN 2o HU your Ap pues sora RG ER GR DW RE RR Sd DR DER o RARE EEE DG AA a a ee eee Re eee eG DD ee ee Oe a Bw ow eS ee eG Vite FUG Oe kk ke ee eee CRA wet babe tee eh bo SS 3 Advanced functionalities 3 1 The debug modes l a aa oe The synchronization protocols lt s s s essas essare E a a bh e a 1 Description This toolbox consists of a rapid prototyping tool chain for autonomous robotic applications using Matlab Simulink This toolbox allows to program and monitor directly a Computer On Module COM through Matlab Simulink RT MaG tool
12. ailable for your COM 2 2 RT MaG tools for your COM 2 2 1 Development computer tools Here you can find a description of what is present in the toolbox archive Once the archive of the toolbox was inflated and installed you can explorer the different directories e README txt a file with some basic instructions to install RT MaG and a description of the current version e Install RT_MaG_ToolBox the installation files of the toolbox To install the toolbox run Matlab with administrator privileges and execute Install RT_MaG_ToolBox m e RT_MaG_ToolBox all the files of the toolbox containing all the functions library blocks etc e Projects COM A directory containing all the demonstration models You can find here Test_Gumstix A directory containing al lot of different models to validate that the toolbox is correctly installed You can generate all these model for your COM by running the TEST COM IO_ BLOCKs m Test_HIL An example of an PIL project containing the host and the COM model You can generate these two model for execution by running init COM _Test_HIL m and init OU ARC _Test_HIL m Test_RunTime Test_HIL An example of RunTime project containing the host and the COM model You can generate these two model for execution by running init COM Test RunTime m and init OU ARC _Test_RunTime m Remark 1 Note that all the Matlab functions and scripts of the toolbox provide an help menu To access to the he
13. box frees the users from writing low level language code RI MaG toolbox gives direct access to the I Os through intuitive masked Simulink blocks Finally the user just needs to design its Simulink model with the wished I Os as done for example with dSPACE or MPLAB 16 Bit Device Blocks for Simulink Then a simple call to a function allows to generate the complete standalone real time application of this Simulink model To summarize the RTMAG toolbox allows to e automatically generate a multi rate real time application from a Simulink model for a real time embedded Linux environment e make the developments really easy fast and bug free e develop the Gumstix Simulink model directly in 32 bits floating point e monitor log and plot data sent by the COM in real time via a Serial or a Wifi connection e design applications fully compatible with all Simulink blocks embedded matlab function s function matlab data structure e send in real time high level set points for the controllers embedded on the COM e tune in real time controller s gains and parameters thanks to a Simulink host computer s application e have the possibility to start and stop the application at any time thanks to the wireless connection e monitor continuously the CPU load overruns and the execution time of each task e have an access to a debug mode detailed execution time of each task time of I Os access and a clear message for I Os
14. ca tion all these steps are done almost automatically Figure 2 describes the different steps performed by the toolbox to obtain a real time application When the Simulink model of the COM is completed the toolbox generates automatically an archive containing all the files which are reguired to be compiled The host real time application is also generated as an external application which could be tuned and monitor in real time thanks to QUARC Once the application have been generated their is two different part e An archive zip containing all the files needed to build the standalone application on the COM This archive was automatically copied to the FTP server before to be downloaded by the COM to be build e A windows real time Simulink application rt win64 which will be executed by an external real time target QUARC connected to the Simulink model In this Simulink model it is possible to visualize in real time the signals received from the COM by an UDP connection and to send parameters to the COM This model could be used to simulate a robot behaviour in a PIL context 2 Starter guide 2 1 Requirements To follow this tutorial you have to prepare your COM to run RT MaG programs Please refer to the download page of our website to flash your COM with one of Linux images if your COM is supported Or refer to RT MaG_ToolBox_Prepare_your_ COM pdf guide to make your COM ready to run RT MaG programs if their is no images av
15. e Se gt gt i run D TOOLBOX RT_MaG Pre 4 5 gt 4 m r Figure 8 The folders and the workspace variables obtain after a COM generation Here is an example of the COM s model generation for the test model InOut_Full_MultiTask_Clock RT MaG RT MaG RT MaG RT MaG RT MaG RT MaG Remove previous build directories Try to remove COM _InOut_Full_MultiTask_Clock_ert_rtw Done Try to remove ToBuild COM InOut Full MultiTask Clock Done Generation of code for COM using Embedded Coder COM InOut Full MultiTask Clock HH Starting build procedure for model COM InOut Full MultiTask Clock HH Generating code into build folder D TOOLBOX RT_MaG Projects_COMA Test_Gumstix COM_InOut_Full_MultiTask_Clock_ert_rtw HF Invoking Target Language Compiler on COM _InOut_Full_MultiTask_Clock rtw HH Using System Target File C Program Files MATLAB R2011b rtw c ert ert tle HH Loading TLC function libraries HH Initial pass through model to cache user defined code HH Caching model source code HH Writing header file COM_InOut_Full_MultiTask_Clock h HH Writing header file COM_InOut_Full_MultiTask_Clock_types h HH Writing header file rtwtypes h HH Writing header file rtGetInf h HH Writing source file rtGetInf c HHH Writing header file rtGetNaN h HH Writing source file rtGetNaN c HH Writing header file rt_nonfinite h HHH Writing source file rt_nonfinite c HH Writing source file COM InOut Full
16. how to use and call the generated function in a standalone application As you can see the I Os attribution the interrupts etc are not done in this file and that why the RT MaG toolbox exists COM_ModelName zip is an archive generated by Embedded Coder containing a lot of file but you does not need this This file can be deleted In the folder To_Build_COM_ModelName their is a file main_COM_ModelName c This file is the main file of the RT MaG application In the folder To_Build_COM_ModelName their is a file genere RT_COM_ModelName This shell script allows to build the model on the COM and will be used by the shell script UpToDate see section 2 5 File Edit View Graphics Debug Parallel Desktop Window Help Dalk tA Ad E Current Folder D TOOLBOX RT_MaG Projects_COM Test_Gumstix Nouveau dossier M us B Shortcuts 7 Howto Add 2 What s New Current Folder O a X Command Window apga x Wo Copying library PWM n a UG z al z i lt Nowveou dossier Fej amp Copying library SPI h The minimum sample time T pf El da BR O Select datato Name slor a a Th e structures G um Stix COM InOut Full MultiTask Clock types h and lO 2 P rocess Copying rtGetInf h The minimum sample time err NN fprintf OFF mU 18 03 2014 09 28 ComMinSampleTime execution time printf OFF run D TOOLBOX RT_MaG Pre execution time fprintf OFF edit GenereCOM RT MaG Generating
17. in section 2 3 3 different debug modes These different mode allow to detect eventual I O failure due to misconfiguration hardware failure or missing remote device You have three kind of debug modes e Input Output Verbose When activated this mode reports all the Inputs and Outputs results i e the number of received data their values and the eventual failure unavailable resource etc The results can be plotted in real time in the console or just written in a debug file e Timing Debug When activated this mode reports the execution time of each task i e the duration of each I O access the duration of each task The results can be plotted in real time in the console or just written in a debug file e Time Logger When activated this mode reports the execution time of each task in a file The only difference between the previous debug mode is it reports the time of a complete task Inputs of the task the task Outputs of the task Remark 3 You can also activate these debug mode by defining macros during the compilation of the application on your COM This is an interesting thing because you are not obliged to generate the archive again At the question Do you want define macro for the compilation respond y and the define one or several of this macro separated buy a space e ECHO_PRINTF to activate the inputs outputs verbose mode in a console e ECHO_FPRINTEF to activate the verbose mode in a file
18. les to rotation matrix conversion Euler2RotMat2 Euler angles to rotation matrix conversion InvQuaternion Computes the inverse of a unit quaternion Quaternion Construct a unit quaternion from an angle and an axis Quaternion2AngleAxis Conversion of a rotation from quaternion formalism to Quaternion2Euler Ouaternion to Euler angles conversion Quaternion2RotMat Quaternion to Rotation matrix conversion QuaternionNorm Computes the norm of a quaternion QuaternionProduct Multiply unit quaternion by unit quaternion QuaternionVectorProduct Quaternion rotation RotMat2Euler Quaternion to Euler angles conversion RotMat2Quaternion Rotation matrix to quaternion conversion Test Quaternion ABI UnitQuaternion Normalize a quaternion Xrotation matrix representation of a X axis rotation Yrotation Matrix representation of a Y axis rotation Zrotation Matrix representation of a Z axis rotation iskew Determines the vector associated to a Skew Symetric matrix skew Determines the Skew Symetric matrix associated to a vector Figure 3 The list of the functions of the rotation tools provided by the RT MaG toolbox 2 3 1 Simulink configuration parameters As the c code of the Simulink model will be generated by Embedded coder you need first configure the code generator 4 Choose here the Scheele A compiler optimization level lom taraet 1 Choose a fixed step ED WM PED a ys o arge
19. lp you can just type gt gt help FunctionName in your Matlab command window 2 2 2 COM tools The RT MaG toolbox offers to you some shell scripts allowing to automatize different step of the application generation You can find here a small description of each script e UpToDateModel lt ModelName gt This script downloads the model called lt ModelName gt and build it auto matically in your COM e RunModel lt ModelName gt d lt Duration gt This script executes the model lt ModelName gt on your COM for a duration of lt Duration gt e CompileTestModel This script downloads automatically and compile all the test models available in the folder your_RT MaG_Folder Projects COM Test_Gumstix You just have to generate the archives before in your development computer e PutFTP A simple script to put a file from your COM to the FTP server available on your development computer 2 2 3 Other tools The RT MaG toolbox provides also set of functions to compute different representation of rotations Euler angles rotation matrix guaternion You can obtain a list of the available functions as their description help menu like this 2 3 Create a model In this part you can find how to build rapidly a model step by step with a lot of customization First you have to create a new blank Simulink model gt gt help rotation Contents of Rotation Euler2Quaternion Euler angles to quaternion conversion Euler2RotMat Euler ang
20. n the Simulink model Finally the archive is inflated and the program is compiled Then the real time application could be executed with the command ep PuTTY inactive o r gt op PuTTY inactive GS 68 137 2 COM Monitor Recover the archive from FTP server Attitud Initialization of the different I Os 3 943 Termination and statistics about execution time Figure 10 Results of the RunModel command for a duration of 5 seconds Figure 9 Results of the UpToDateModel command rootQovero RunModel ModelName d MyDuration where MyDuration is the time during which the application has to be executed You can find an example of a program execution in figure After the inputs and outputs initialization the synchronization protocols are executed on the RS232 device to check that the remote device is ready optional Then the program begins and the CPU load is plotted each second In addition if overruns occur for some task their are plotted immediately When the program finishes it displays some statistics about execution times and eventual overruns and it frees the devices used by the program Remark 2 During an execution you can type CTRL C to quit immediately and properly the program i e the program will free all the resources and quit 2 5 2 Host part Once the ModelName rt win64 was generated for your host model you just have to load it on the real time Quarc target
21. nc FR m r 2 A IIA The RT MaG applications are composed of two parts e areal time embedded application which executes in real time a Simulink model on a Computer On Module COM to control a robot e a real time host application which executes in real time a Simulink model on a host computer The host computer is used not only to send high level setpoints and parameters to the embedded application but also to monitor all the signals the users want to check The COM application could be monitored by two ways e assh connection via a console application e g PUTTY to monitor the CPU load the eventual overruns I Os error etc e the host Simulink application to monitor the computations 1 2 Toolbox s workflow RT MaG generates then the two real time applications the steps are described by the figure 2 HOST COMPUTER ce lel be C Code C Code Generation Generation Microsoft R CO Visual Studio Encapsulation for Real Time Execution Compilation for Real Time Win64 Archive 7 Generation Ouanc accelerate design EN a a FS EAN ee o CE o S o od O S G gt E YN pun o dy o 1 ha y o compilation gcc Figure 2 WorkFlow to generate the real time appli
22. these two variables HostMinSampleTime and ComMinSampleTime in your model you can easily generate the application for different sample time 2 4 1 GenereCOM As said previously the generation of the sources needed to build the COM application is done by the command gt gt GenereCOM ModelName ComSampleTime The GenereC0M function evaluates all the mask of the different I Os blocks present in your Simlink model and generates two structures in the workspace These structures allow to check automatically that each I O block are correctly used and they can work with the other I O blocks If their exist incompatibilities between different blocks error messages will appear in the Matlab command window You can display these two structure in the Matlab command window like this gt gt DispStruct Gumstix UDP 1 Emission 1 Name Out_to_UDP NbData 69 DataType float32 IPaddress 192 168 137 2 Port 2012 Interface wlan0 SampleTime 0 005 Es232 10 Reception 1 Name In_from Serial NbData 11 DataType intl6 PortIndex 2 Port dev ttyO2 BaudRate 115200 SampleTime 0 005 BlockingReception 1 Configuration 1 TimeScheduler RS232 Reception ConsoleVerbose off FileVerbose off TimeLogger on TimingDebug off FileTimingDebug off SynchroRS232 1 Type Send Wait TimeOut 100 Message START TaskingMode Multi Tasking gt gt DispStruct IO_2_Process UDP Reception O Emission 1 me Reception 1
23. utorials amp Documentations section 2 3 3 COM configuration block VERBOSE Time Scheduler Gumstix Configuration Block Parameters Gumstix Configuration Subsystem mask TimeScheduler Input Ouput Verbose Timing Debug Synchro Protocol Time Scheduler Internal Clock Tasking Mode Multi Tasking Cancel Help Apply EE To configure properly your real time application the RT MaG Ml Bock eaer Gumstix Conta toolbox provides a configuration block allowing to choose in a Subsystem mask large wide of options TimeScheduler Input Ouput Verbose Timing Debug Synchro Protocol e Time scheduler choice timer or I O interrupt Verbose mode activated in the Gumstix console off Verbose mode logged in a file onto Gumstix off e tasking mode multi task or single task application Time logger mode activated log time exec of each task lon E e I O debug modes via the console or via a file e Timing debug modes via the console or via a file WE Block Parameters Gumstix Configuration Subsyst k ubsystem mask e Synchronization protocol TimeScheduler Input Ouput Verbose Timing Debug Execution time plotted in the Gumstix console off A detailed description of this block is given here on our website Execution time logged in a file onto Gumstix
24. ying shell script in ToBuild_COM_InOut_Full_MultiTask_Clock RI MaG Copying Archive and shell script on FIP directory RI MaGf GENERATION OF CODES COMPLETED SUCCESSFULLY RI MaG You can build this model using UpToDateCOM_InOut_Full_MultiTask_Clock on your COM RI MaG Then you can run this model using RunModelCOM InOut Full MultiTask_ Clock d lt duration gt on your COM 2 4 2 GenereHost As said previously the generation of the real time Simulink model for the host application is done by the command gt gt GenereHost ModelName HostSampleTime This command creates a ModelName rt win64 application which will be used by the Ouarc real time target Take a look to the section 2 5 2 to know how to use and run this model in real time 2 5 Run your application 2 5 1 COM part Now you just need to download and compile the archive generated in the subsection 2 4 1 So turn on your COM log on and go to the RT MaG directory to build your application If you use one of our RT MaG Linux image you can proceed as follow login root rootQovero cd RT MaG Toolbox RT MaG_ Program Then the archive can be automatically downloaded and compiled on the COM using the Linux command rootQovero UpToDateModel ModelName You will obtain something like the figure 9 for the compilation The archive is downloaded then you can choose to define some macros to activate some debug mode even if their are not activated o
25. ymbols z Memory Sections i Custom Code Make command z J Debug Template makefile Interface ana 3 i SIL and PIL Verifica ert_shrlib tlc Embedded Coder host bas F Cancel l Help Apply Code Style Data specification override grt tlc Generic Real Time Target Templates E Ignore custom storage classes E Ignore test point signals Sree ee Create Visual C C 303m Cade Placement grt_malloc tlc Generic Real Time Target Data Type Replace 3 grt_malloc tlc Create Visual C C Solw Memory Sections Code Generation Advisor A idetink_ert tic IDE Link ERT Prioritized objectives Unspecified Set objectives E grt tlc IDE Link GRT M 4 m i Show the active configuration parameters dialog FixedStepDiscrete Check model before generating code off y _ check model Full Name C Program Files MATLAB R2011b rtw c ert ert tlc 2 E 2 2 Eic os Template Makefile ert_default_tmf ERES Make Command make_rtw Ex Apply 2 U C Mins ai b se COMMINoampie LIME as m fundamental sample time Ready 127 FixedStepDiscrete Figure 4 How to configure your Simulink model in the Configuration Parameters 2 3 2 The I Os blocks If the RT MaG tooblox has been correctly installed the RT MaG toolbox you can find all the I Os block available in your Simulink browser You just have to add the I Os blocks you need for your application as rra 7 Inputs Blocks Outputs Blocks

Download Pdf Manuals

image

Related Search

Related Contents

クリック&ミックス - CLUB T-fal  Leica LINO L2 - Leica Geosystems  Snapper Z-Mow / 150Z Lawn Mower User Manual  MANUAL DE INSTRUÇÕES DE INSTRUÇÕES DE  Connecting SITRANS LUT400 - Lesman Instrument Company  MANUAL DEL USUARIO ¡ADVERTENCIA!  WSC-5-SDOR Wind Speed Controller Single Set Point User`s Manual  取扱説明書 - M  Motorola ADVENTURE V750 User's Manual  Manual del Usuario  

Copyright © All rights reserved.
Failed to retrieve file