Simulation step size in simulink is very small and takes really long to run. Unable to solve it

27 vues (au cours des 30 derniers jours)
Hello, I am trying to model the interaction between a robotic structure and a human hand. Here's a brief description of my system. All the blocks in yellow represent my robot and associated FK equations while the blocks in blue represent my human hand model and corresponding FK equations. I have a constraint in that I cannot model the dynamics directly and need to use only a second order model to approximate the behavior. Further, the robot and the Human are coupled by a large stiffness and the corresponding interaction force is recorded. It is a 1 dof robot coupled to a 1 dof human joint.
In the image below X=[f1(q),f2(q),f3(q)]^T; X_h=[f4(q_h),f5(q_h),f6(q_h)]^T; J_MM=[f7(q),f8(q),f9(q)]^T;J_h_t=[f10(q_h),f11(q_h),f12(q_h)]^T;
Now for the problem I'm having: The simulation step size is automatically chosen to be extremely small (order of e-5). all my FK and Jacobian equations are simple algebraic equations in a single variable and when i evaluate them in matlab, I am able to run 10000 evaluations (using a for loop) in 0.05s.
I am very new to simulink and do not have much experience. so any help regarding how I can solve this is very much appreciated!
HEBI Block

Réponses (1)

Sam Chak
Sam Chak le 20 Sep 2023
It's not bad for a beginner in Simulink to create a rather sophisticated model using mostly user-defined MATLAB Function blocks and feedback loops. If the Simulink model takes a long time to run, open the Model Configuration Pane: Solver and select the ode15s solver.
  2 commentaires
Suhas Raghavendra Kulkarni
Dear Sam, Thank you very much for your response! Indeed the solution time is orders of magnitude better, however, is still slow (takes roughly 200s to simulate 3s of simulation) considering the next step for me would be to run this in (near) real time (response time <0.5s) while communicating with motors and sensors. For this, I would like to improve the model and make it more robust possibly using built-in simulink blocks and functions.
Is there any advice you can provide to me to improve the model from it's current form?
Sam Chak
Sam Chak le 21 Sep 2023
Some sophisticated systems take longer to simulate. If you identify that your system is stiff, then change the solver to ode15s.

Connectez-vous pour commenter.

Tags

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by