Error in simuscape model

조회 수: 2 (최근 30일)
Weilin Piao
Weilin Piao 2023년 11월 16일
답변: Gowtham 2023년 11월 21일
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.

채택된 답변

Gowtham
Gowtham 2023년 11월 21일
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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Robotics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by