Filter löschen
Filter löschen

How to stop simulink from terminating with position violation error?

5 Ansichten (letzte 30 Tage)
Hi MATLAB Community,
I have built up a model of a parallel industrial robot using Simulink Simscape Multibody, and I am now attempting to model the work volume, or space of reachable points. I am doing this by programmatically running the simulation using a script that goes through all possible positions of the actuated joints and recording the achievable positions of the end effector. I am using the ‘sim’ command method to run the simulation, rather than the run-button method. There are a number of input positions that will not be possible for the robot due to other joint limits and hence not solvable for the simulation, and I need to know which positions are possible and which are not. The issue is that whenever an input is used that is not solvable, the position violation error (see below) is thrown. This causes the simulation and the script to terminate. Is there a method to have Simulink and the MATLAB script not terminate when this error is thrown? If I can ignore this error, then the simulation would be able to move onto the next points, which may be possible, and simply not record the point that was not possible.
The error:
['Machine_model/Solver Configuration']: Model not assembled due to a position violation. The failure occurred during the attempt to assemble all joints in the system and satisfy any motion inputs. If an Update Diagram operation completes successfully, the failure is likely caused by motion inputs. Consider adjusting the motion inputs to specify a different starting configuration. Also consider adjusting or adding joint targets to better guide the assembly.
  3 Kommentare
christina maher
christina maher am 27 Okt. 2022
Verschoben: Walter Roberson am 27 Okt. 2022
how to write it??? i entered a matlab function have inverse kinematics that should make the robot draw circle path.
Walter Roberson
Walter Roberson am 27 Okt. 2022
You currently have a MATLAB function or script that calls sim(). That call should have "try" inserted before it, and "catch ME" and then "end", like Peter O showed.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Peter O
Peter O am 16 Mär. 2022
Wrap it in a try catch block?
%for loop
% set_param calls and stuff...
outs = sim('model', ...)
disp('Bad Parameter Set')
%end for loop

Weitere Antworten (0)


Mehr zu Applications finden Sie in Help Center und File Exchange




Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by