You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

Location

The models are located in project_root/Data generation

  • Space_explorer_no_comp.m: Runs the space explorer

Script's description

This MATLAB script is designed to run a series of simulations over a defined set of test positions in a 5-dimensional space, capturing and storing the results for analysis. The main purpose is to evaluate the simulated SCU's kinematic behavior across various configurations.

Steps Performed by the Script

  1. Initialization:

    • simulation_time, n_pts, time: Define the duration of the simulation and create a time vector.
    • scriptFullPath, scriptFolder: Determine the full path and folder of the current script.


  2. Geometric Properties:

    • Define various geometric offsets and distances relevant to the system being simulated.
  3. Test Positions:

    • Define the arrays of test positions for x, y, pitch, roll, and yaw.
  4. Preallocation:

    • Calculate the expected number of cycles based on the combinations of test positions. This is given by m*n*u*v*w, that means that even by using 3 points per DOF, the total number of iterations is 243!
    • Preallocate a table space_array to store the results of each simulation.
  5. Main Simulation Loop:

    • Nested loops iterate over all combinations of the test positions.
    • For each combination:
      • Create arrays for each degree of freedom (x, y, pitch, roll, yaw) over the simulation time.
      • Solve the inverse kinematics for the given positions using the function inverse_kin_5.
      • Extract joint positions and set up the simulation.
      • Run the Simulink model SCU_FULL.slx and capture the simulation output.
      • Calculate average positions and orientations of the quadrupole over the latter half of the simulation time.
      • Store the results in space_array.
  6. Progress Tracking:

    • Calculate and display the remaining time and elapsed time for the simulations.
  7. Save Results:

    • Save the space_array table to a CSV file named no_compensation.csv in the Results folder.

Explanation of Key Parts

  • Geometric Properties: These are offsets and distances specific to the mechanical setup. They are likely used in the inverse kinematics calculations to account for the physical dimensions and positions of the components.

  • Test Positions: These arrays define the different positions and orientations that will be tested. Each loop combination represents a different configuration of the system.

  • Kinematic Solving: The function inverse_kin_5 is called to solve the inverse kinematics for each set of positions. This function is expected to return joint positions required to achieve the specified x, y, pitch, roll, and yaw.

  • Simulink Model Execution: The Simulink model SCU_FULL.slx is run for each configuration. The results of the simulation, including positions and orientations, are captured and processed.

  • Data Storage and Export: Results are stored in a preallocated table and finally saved as a CSV file for further analysis.

  • No labels