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