MATLAB SETUP

  1. Make sure to be connected to JPL VPN if not on JPL network already when opening matlab.
  2. Make sure the following are on your matlab path and saved.
Dropbox\PFS_EM\SVN\MATLAB
Dropbox\PFS_EM\SVN\MATLAB\lib
Dropbox\PFS_EM\SVN\MATLAB\peter\download
Dropbox\PFS_EM\SVN\MATLAB\peter\lib

MATLAB QUICK SCRIPTS AND FUNCTIONS

Read in a MSIM XML config file as matlab structure

CobraConfigStruct = loadCfgXml
CobraConfigStruct = loadCfgXml('Dropbox\PFS_EM\TEST_RESULTS\TargetConvergence\06_24_14_08_51_13_TargetRun','dmpAdj_msimMaps_062314_1.xml')

Plot a motor map from config file

plotMotMapsFromStruct(CobraConfigStruct.ARM_DATA.ARM_DATA_4.FAST_CALIBRATION_TABLE)

Make MSIM XML from a current config structure in Matlab

cobraCfg2xml(CobraConfigStruct,'mynewXMLforMsim.xml')

Get a field value from the Kinematics structure of a Cobra Config structure

L2 = getARMval(CobraConfigStruct,7,'Link2_Link_Length')

Set a field value from the Kinematics structure of a Cobra Config structure

CobraConfigStruct = setARMval(CobraConfigStruct,7,'Link2_Link_Length',35.323)

On-Time Tuning

  1. Manually move all non-cabled up cobras out of the way of the ones under interest
  2. Generate ROM Scripts using Matlab script:
    Dropbox\PFS_EM\SVN\MATLAB\ontimeTuning.m
    1. Edit the ROM Script filenames, they shall follow the convention: YYYYMMDD_(theta/phi)(Fwd/Rev)_onTimeTuning.lst (Example: 20140609_thetaFwd_onTimeTuning.lst)
    2. The ontimes to test and other parameters in the ontimeTuning script hopefully do not need adjustment, but they are described within in case.
  3. Execute ROM Scripts with MSIM
    1. Each one of these will create its own test directory with the suffix "onTimeTuning"
  4. Go to the Images directory of each onTimeTuning directory with matlab (it should be your current folder) and execute the command:
    chooseOntimes
    1. The chooseOntimes shouldn't need modification, but tunable parameters are listed at the top of the script here: Dropbox\PFS_EM\SVN\MATLAB\chooseOntimes.m
  5. A figure will appear asking you to verify that all positioners are identified by the center streaks. Click yes if you see all the centers (red stars) and good streaks for them (>180deg or around there for phi). You can click the other two buttons to halve or double the b/w threshold. Eventually you need to click yes to proceed.
  6. Once you proceed, you'll be asked identify which MSIM PIDs go with which streaks. Enter just the pid number and click ok for each one. The selected centers are shown with a green circle.
  7. After the MSIM PIDs have been assigned, a figure will appear with two subplots. The right plot contains the next streak with first ontime. Hit enter to make it the current streak and que up the next one. Keep hitting enter until you can see that the next streak does not change from the current one and that the positioner makes it's full range of motion or close enough. This may be difficult to tell with phi. Once the two look the same, check the box at the lower left to select the ontime for the streak in the left subplot. Hit enter and it will begin this process again for the next positioner. Keep going until they're all done and the XML dialog appears.
  8. Select the XML you want to start with. This should be the current one you are working with if you have done other ontime tests or if this is the first ontime test you've done and there is no xml file yet, choose the template here: Dropbox\PFS_EM\SVN\MATLAB\CobraConfigTemplate.xml
  9. Next the save XML dialog will appear. Save the new XML containing your selected ontimes and centers if this was theta data. Save it in the Images directory of the test directory for the ontime data. Should be your current working directory in MATLAB already.

Target Convergence Analysis

  1. Copy MSIM target log dir on testbed computer (eg: D:\PfsTests\06_16_14_10_36_21_TargetRun\Log) to the drobox test results target convergence folder (Dropbox\PFS_EM\TEST_RESULTS\TargetConvergence\). Rename the log directory in dropbox to have the same name as the mother directory on testbed computer (eg: 06_16_14_10_36_21_TargetRun). This directory will now be referred to as the test directory here.
  2. Move the appropriate CobraConfig xml used by MSIM into the test directory.
    1. Since this is getting complicated to track, for now we shall keep track of which configs are used for which tests on this page: EMTestReports. Make sure to update it after running this.
  3. Change the matlab current folder to the test directory in dropbox.
  4. Execute the following command to run the target analysis script:
    analyzeTargetRun
  5. When prompted, select the appropriate xml which was used for the MSIM test. The one you moved into test directory.
  6. Run the script and the figures and mat files will be saved to the same log directory as the log txt files are in.

Target Convergence Comparisons

  1. Change the matlab current folder to Dropbox\PFS_EM\TEST_RESULTS\TargetConvergenceRun the target convergence analysis on data you wish to compare. The mat files from that script are needed for this comparison.
  2. Open the convergence comparison matlab script in that folder: convCompare.m
  3. Edit the INPUTS section so that the dataDirs array contains the folder names of test data you wish to compare. These must all contain the results of analyzeTargetRun script.
  4. Run the script.
  5. The convergence comparison figure will automatically be saved in the last folder of the dataDirs array, so make sure that is in order.

Motor Map Global Adjustment

  1. Change matlab current folder to the directory containing results of analyzeTargetRun. (eg. Dropbox\PFS_EM\TEST_RESULTS\TargetConvergence\06_16_14_10_36_21_TargetRun\)
  2. Execute the command
    adjustMaps
  3. A dialog appears asking you to provide the original data config xml. This should exist already in the current directory, so select it. If not, go find it. This XML contains the original motor maps which will be modified by this script based on the error vs request data.
  4. Script should execute now and create and save figures as well as modify the motor maps from the original XML you just provided.
  5. After script is finished, a dialog will appear asking where to save the new XML config file with adjusted maps. Save it in the same directory and name it the same as the orignal but with suffix 'adj1' or adj2, etc depending on how many adjustments this is for it. To clarify, if the original raw map was called msimMaps_062314_1.xml and the one used for this test data was msimMaps_062314_1_adj1.xml because you already ran this once before, then the new modified config should be called msimMaps_062314_1_adj2.xml.
  6. Since this is getting complicated to track, for now we shall keep track of which configs are used for which tests on this page: EMTestReports. Make sure to update it after running this.

Motor Map Creation with MSIM

  1. Run the motor mapping script in MSIM: 2014_06_22_msimMotMap.lst
  2. Navigate to log directory of the MSIM test directory with Matlab
  3. Execute the MSIM motor mapping matlab script:
    processMsimMaps
    1. A dialog appears and asks you for the original XML used in running the motor map data. IMPORANT to get this right as the cobra orientations will be wrong if you choose an XML different than what was used when the MSIM script ran.
    2. After creating the maps and displaying figures comparing them against the previous ones, a dialog will appear and ask you to specify a name for a new XML file.
Edit | Attach | Watch | Print version | History: r27 | r12 < r11 < r10 < r9 | Backlinks | Raw View | Raw edit | More topic actions...
Topic revision: r10 - 2014-06-25 - ChazMorantz
 
  • Edit
  • Attach
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback