Integrator doesn't work properly
古いコメントを表示
I am working on a controller that calculates the maximum velocity that the actuator can remove from the system so the kinetic energy is zero when achieving the set point. Please see the attachment.

the MATLAB Function block is:
function direction = dircVel(Xd, Xa, Va)
Fmax = 1;
m = 1;
Vmax = sqrt(2 * Fmax * abs(Xd - Xa) / m) * sign(Xd - Xa);
direction = sign(Vmax - Va);
What I expect to see is that the output approaches the setpoint position asymptotically but it diverges to infinity!

the output of the MATLAB function seems OK:

but the output of the first integration is wrong:

red line being what I expected to see.
I would appreciate it if you could help me know what is wrong and how I can resolve it.
採用された回答
その他の回答 (1 件)
Benjamin Thompson
2022 年 2 月 24 日
0 投票
The output of your first integrator is always positive. So the second integrator will keep increasing until its input become zero or negative.
カテゴリ
ヘルプ センター および File Exchange で Discontinuities についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


