Revised: 2003-05-20 Intent+: In this tutorial we will study the control system of a linearized model of the antenna utilizing the Adams Insight ASCII conduit and MATLAB. Demonstrate the integration of Adams Insight and Adams Controls / Matlab. (See tutorial Learning Adams Controls with MATLAB) Investigate how the antenna controls systems parameters affect the maximum computed torque. Prerequisites Basic working knowledge of MATLAB Basic working knowledge of Adams Insight Basic working knowledge of how to negotiate a file structure. This tutorial assumes that the following components are installed on the machine: - Adams Insight v2003.0 or higher. - MATLAB It is assumed that MATLAB is invoked via the command 'matlab' from the DOS or UNIX shell. Intent-: Caveats+: - working directory edit in plt_run.m clean-up (SK)??? - Change to screening DOE instead of sweep to identify what is significant - Not completely updated to new names Caveats-: 1) Getting the Tutorial Files - Create a working directory 'ain_asc_mat'. This is where the files for the exercise will reside. Copy the required tutorial files to this directory from the /ainsight/examples directory. Windows copy /ainsight/examples/ain_tut_110_asc_mat* . Unix: cp /ainsight/examples/ain_tut_110_asc_mat* . There should be nine files in the current working directory of ain_asc_mat ain_tut_110_asc_mat.txt (readme instructions for tutorial) ain_tut_110_asc_mat.m (MATLAB controls system model) ain_tut_110_asc_mat.mdl (MATLAB controls system model) ain_tut_110_asc_mat.py (PYTHON script to run simulation) ain_tut_110_asc_mat.a ain_tut_110_asc_mat.b ain_tut_110_asc_mat.c ain_tut_110_asc_mat.d ain_tut_110_asc_mat.x0 (Text files that store system matrices and ICS) Tip: To determine where the MSC.ADAMS installation resides, type the following command in the command prompt window: `adams03 -top` Windows `mdi -top` UNIX 2) Parameterize the Nominal System In this section the nominal system defined by the files ant_lin_run.m, ant_lin_run.py will be parameterized. Four files represent the nominal system. In this example only the control system parameters need to be parameterized, there is no need to build variants of ant_lin_dat.m or ant_lin_mdl.mdl. Thus, ant_lin_run.m and ant_lin_run.py only need to be parameterized. - Start the Adams Insight ASC Editor from the command prompt from the working directory (ain_asc_mat) with one of the following commands: adams03 ainsight -ascg Windows mdi -c ainsight -ascg exit UNIX - Import the ASCII files ant_lin_run.m and ant_lin_run.py: Select the menu items File->Import (or pick the toolbar import button) and select the files ant_lin_run.m ant_lin_run.py One will now notice that there are entries in the Templates menu pull down. The menu also indicates the current active ASC Template - Annotate the ASCII templates: Make the 'ant_lin_run.m' the active ASC Template. Highlight the numeric value of Kp. Right click and select Create. The 'Create Variable' dialog box will be displayed. Alter the 'Name:' field from 'F_04' and specify our own name as 'kp'. Leave the 'Format:' and 'Value:' fields with their respective default values. Select OK when done. Perform the same procedure as above with the numeric value of Kv. - Make the 'ant_lin_run.py' the active ASC Template. Update the properties of this ASC Template Specify the Execution method for this template by selecting the menu items Edit->Template Properties. In the field "Execution Prefix" type the following string: Windows: Execution Prefix: 'adams12 python ' Unix: Execution Prefix: 'mdi -c python ' Execution Postfix: 'exit ' In the "Labels of Post Operations" field, type: 'max_torque' Note: An ASC System consists of one or more ASC Templates. Each ASC Template has its own set or properties. In the tutorial, make certain to edit the template properties of the ant_lin_run.py template and not that of the ant_lin_run.m file. - The properties of the ASC System can no be updated. The optional attributes of name and Description can be updated via the menu picks of File->ASC Properties... In the ASC System Properties dialog box, fill in the 'Name:' field with 'tut_asc_mat_ant_lin' and the Description field with 'Tutorial using asc and Matlab'. - Save the ASC system by selecting File then Save As 'ant_lin'. Note: A file ant_lin.xml is created in the current directory. - One can now create a default Adams Insight experiment file with the File->Export Experiment menu picks Note: A file ant_lin_exp.xml is created in the current directory - At this point we have paramaterized the system and are ready to configure and investigation in Adams Insight. - One can exit the ASC Editor at this point or create another Command shell and go to the working directory to proceed with the exercise to start Adams Insight. Alternately click on the Adams Insight toolbar icon and Adams Insight will be started with the newly exported experiment loaded. 3) Design the experiment: - Start Adams Insight. Make certain to be in the 'ant_lin' working directory. Open the Adams Insight experiment file, ant_lin_exp.xml. - Update Response "response_01" to "max_torque" and make the changes name: max_torque. abbreviation: max_torque. variable field: dat:absmax:1 (to return absolute max of column 1 of the dat-file created by ant_lin_run.m) - Select the desired investigation strategy: Under design specification select Sweep Study for the Design Type. Set Number of Runs to 8. Next create the WorkSpace. One should now have a Work Space with 8 trials. 4) Write ASC Multi Event Regulator (ASC-MER) File - Hit the calculator button. - Click Yes on the question if you want to process the ASC system file 'ant_lin.xml'. - Click OK. Note: The result of this operation is that a newly created *_mer.py file has been generated in the current directory. This file can be utilized to build, run and post-process the ASC system(s) defined in the *_mer.py file. 5) Run the Multi Event Regulator (ASC-MER) File Open a command prompt window and move to the 'ant_lin' working directory. - For help on using the *_mer.py file, type: `adams03 python ant_lin_exp_mer.py -h` Windows `mdi -c python ant_lin_exp_mer.py -h exit` UNIX - To test the configuration and run only the first trial, issue the following command: `adams03 python ant_lin_exp_mer.py` Windows `mdi -c python ant_lin_exp_mer.py exit` UNIX - Investigate the newly created files in the newly generated subdirectory 'tst_dir' - Now run all the trials `adams03 python ant_lin_exp_mer.py -t` Windows `mdi -c python ant_lin_exp_mer.py -t exit` UNIX 6) Import the results into Adams Insight - In Adams Insight, select the menu items File->Import->Results - Select the directory below the current directory 'tst_dir' and the .csv file 'tst_pos.csv.' - Review the Work Space matrix by clicking on the workspace leaf in the Adams Insight tree under the Design leaf End: