How to solve Algebraic Loops in half car model with PID controller
Afficher commentaires plus anciens

6 commentaires
Sam Chak
le 23 Déc 2023
Hi @Mücahit
Can you show the entire set of differential equations for the half-car model and the two PID controllers? It may be easier to identify the root cause of the algebraic loop and find a way to remove it by creating the proper mathematical equation.
If you know how, try writing the differential equations in code for the convenience of checking in MATLAB. Otherwise, if you are unable, just write the equations with standard mathematical notations (preferably in LaTeX—click the icon
).
Mücahit
le 23 Déc 2023
Sam Chak
le 24 Déc 2023
Hi @Mücahit
I presume that you have derived all four second-order differential equations correctly. Since you already have the equations, it might be helpful to share the entire file or copy/paste the equations. I prefer to consolidate the equations and all parameters into a single function() file for easy troubleshooting in MATLAB (not Simulink).
I believe you created a separate parameter file for constants such as a, b, bf, ksf, ksr, etc., but you didn't show them.

Sam Chak
le 24 Déc 2023
Hi @Mücahit
There is no algebraic loop error message when I run the Simulink file. I added a Scope to check the signals, and they are stable. Perhaps @Sulaymon Eshkabilov can also take a look.


Mücahit
le 24 Déc 2023
Réponses (2)
Sulaymon Eshkabilov
le 23 Déc 2023
1 vote
By glancing at your Simulink model, that looks ok without seeing f(u)'s. I can see the problem is in f(u) function definitions. I would check f(u) for acceleration calcs.
Sulaymon Eshkabilov
le 24 Déc 2023
1 vote
There are a couple of derivative blocks in your model that creates all instability (spikes are occuring due to derivatives at t=0, i.e., Any/0 = inf) related issue at the start of your simulation. A possible solution can be:
(1) Switch the derivative block with a some sort of transfer function, e.g., TFD(s) = s/(tau_D*s+1)
(2) Include the derivative term into the PID's transfer fucntion
Catégories
En savoir plus sur General Applications dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!