报错提示:Derivative of state '1' in block '___________/Integrator' at time ______ is not finite.The simulation will be stopped. There may be a singularity in the solution. If not, try reducing the step size (either by reducing the fixed step size or by tightening the error tolerances)”

解决方案(可如下尝试):

1.修改仿真时间

打开configuration parameters 界面

如果出错时间为time=0,可以将simulation time中的start time 修改为0.001,再次仿真检查能否解决问题

2.给积分器赋初值

修改积分器中的initial condition

3.减小步长

打开configuration parameters 界面

把variable-step改成fixed-step,step size(fundamental sample time)可自己来指定

提供一种例子:将 solver options 用fixed-step,并且求解器改为ode3

4.设置限幅环节

如果在仿真模块中含有控制器,可以在控制器的输出值后面增加一个限幅环节,这样可防止出现刚开始仿真时就出现过冲的现象。

注:如果使用了系统自带的PID控制模块,可以在模块中直接设置限幅limit output

5.更改PID控制模块中的滤波系数

考虑修改PID Controller模块中的Filter coefficient,在这里我把原来的值10000减小为1000

 

如果大家有其他好的解决方法可以评论一起分享一下!

 

 

 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐