How to model second order nonliniar in simulink

1 vue (au cours des 30 derniers jours)
Barak Bar-on
Barak Bar-on le 11 Juil 2022
Commenté : Paul le 11 Juil 2022
Dear all,
I have a dynamics model of a 3DOF robotic arm of the form:
where q=[q1;q2;q3]
and u is the motors torqes.
I've already whriten and solved those equations in Matlab (designed a feedback lianirzation controller to follow a given trajectory)
I need to design a PID controller (without inverse dynamics\ computed torqe),
So I've thought using the PID tuner in Simulink or the slTuner function in matlab,
but from what I saw there isn't an "easy" way to put those nonliniar matricies into Simulink.
Any suggestion?

Réponses (1)

Paul
Paul le 11 Juil 2022
Hi Barak Bar-on,
I depends on the form of the matrices and what you consider easy.
If you already have a .m function in Matlab that computes M, C, and G given q and qdot, you always have the option of copying the code from that function file into a Matlab Function block in Simulink, or have the Matlab Function block act as a wrapper and call the Matlab function. See the doc pages for more info.
  4 commentaires
Barak Bar-on
Barak Bar-on le 11 Juil 2022
Thanks again Paul.
I've tried to input the function into simulik block.
but my problem is its still a nonliniear second order ode,
So the inputs should be u from the PID and the out should be q. In the middle is a nonliniear second order ode model.
So I'm kinda stuck between Matlab and Simulink thinking the best way to optimize it.
Paul
Paul le 11 Juil 2022
Assuming M(q) is invertible, presumably you take the outputs of the function and solve for qddot or you can solve for qddot inside the function and make that the output. qddot is integrated to qdot and q (with appropriate initial conditions) using Integrator blocks. q and qdot feedback as inputs to the Matlab function along with u, which is an output from your controller, and is presumably a dynamic function of q, qdot and perhaps a reference trajectory input.

Connectez-vous pour commenter.

Produits


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by