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 Center および File ExchangeRobotics についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by