How to model second order nonliniar in simulink

2 views (last 30 days)
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?

Answers (1)

Paul
Paul on 11 Jul 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 Comments
Paul
Paul on 11 Jul 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.

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by