Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Running the simulation

Code Block
titleExecute the codeRun simulation
linenumberstrue
collapsetrue
% comment the next line if you want to see the output on the Mechanics
% Explorer
set_param('SCU_FULL', 'SimMechanicsOpenEditorOnUpdate', 'off');
simOut = sim(fullPath, 'StopTime', string(simulation_time));  

Running the simulation is quite straightforward, the only command to execute is "sim()", and it will return a Simulink.SimulationOutput object. This is where all the simulation output signals are stored

Data analysis

Now it's time to analyze the results. 

Image AddedImage Added

If we look at the positions/orientations measured during the simulation we can observe 2 characteristics:

  • Y axis is properly following the commanded motion of 3 mm
  • X position, instead of being 0 (as requested on our command profile) is almost 4 um at both the extremity of the motion with a clear quadratic law.
    Image Added
    The interpolating equation shows a negligible error, confirming the theory about the quadraticity. This information can be added to our inverse kinematics function to further reduce this error

If our goal is to analyze how good an inverse kinematics algorithm is, we need to compare the desired quadrupole motion/orientation together with the real one defined by our inverse function and executed by the model. A good indicator is the error between the two arrays.