Filter löschen
Filter löschen

Error in simuscape model

3 Ansichten (letzte 30 Tage)
Weilin Piao
Weilin Piao am 16 Nov. 2023
Beantwortet: Gowtham am 21 Nov. 2023
Hello there.
I am new to simulink and simscape and I am trying to model a planar 2 DoF robot arm in simulink.
I have a picture of a simple shape and turned them into waypoints and these waypoints are used to produce polynomical trajectory.
I then turn these coodinates of trajectory into joint angles of the robot arm using inverse kinematics and use inverse dynamics from robortics toolbox to calculate torque.
But when I apply these torque into my simscape model, I am getting a error saying there might a singurality. How do I fix this error?
I have attached my simulink file with relevant script.

Akzeptierte Antwort

Gowtham
Gowtham am 21 Nov. 2023
Hello Weilin,
I understand you are facing an issue while simulating a robot arm, related to the derivative of a state in the model.
I tried to reproduce the issue at my end with the given files and it ran smoothly without encountering any errors.
To address the error you are experiencing, I suggest following the steps outlined below:
  1. In the model configuration parameters, navigate to Solver and adjust the type of solver to ‘Variable-step’ and set the Solver to “ode15s” (stiff/NDF).
  2. If the issue still persists, proceed to the configuration parameters, and under Diagnostics > Data Validity > Signals, set the ‘Inf or NaN block output’ to ‘error’ and then rerun the model. This action will prompt an error message, which reads as follows:
  • To address this issue, ensure that you eliminate the ‘divide by zero’ error in ‘simulink_test1/Torque prediction/MATLAB Function1’, which generates an ‘Inf’, leading to the error.
Kindly refer to the following MATLAB Documentation for further information on ‘ode15s’ solver and ‘NaN’
Hope this helps.
Best Regards,
Gowtham

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by