10-07-2014 06:05 AM
Hi,
I came from here: http://forums.ni.com/t5/LabVIEW/Simulation-Loop-Acting-Weird/m-p/3012191 where I posted some problem I was having with my simulation system.
I am designing a controller for a swing-up and balance of an inverted pendulum mounted on a cart system. I created a non linear model which represents the full range non linear equations of motion and also a linearized model towards the upright equilibrium point, in order to design the balance controller (using linear techniques).
There are also some facts that arised up and I want to share with you guys, first one is the fact that I am having some heavy discrepances between the non linear model and the linear one. That seems weird to me because the first thing I did was to check the behaviour of the NL model to a nonzero rod angular position initial condition, and it behaved as suposed, doing a free fall and then a damped oscillation around the downwards point.
After that I compared the behaviour of the two models in this free fall to see what should be the operating range of the linearlized model.
But my problems started when I try to run a simulation of the closed loop systems because the simulation loop seemed to get stuck or freezed and I wasn´t obtaining any output. That was the motivation of my post.
I am telling you this because I assume that there is nothing wrong on my Non Linear model representing the equations of motion, (It acts normal responding to a zero input, but with a nonzero initial condition), but the results I am getting running the simulation of the closed loop are a lot of strange, and surely they are not valid.
I run the control law with the Linear Model and also it gives correct results. But the point is to check it with the non linear model and then step by step adding another non linear constrains that the real system has like saturation blocks on some signals and quantization... backslash and so...
I am getting out of my mind with this, I manage to get the simulation loop running using the memory blocks that another user told me in my older post, but I am having weird results like that the control effort goes infinity in a short time like fraction of seconds..
I also attach the VIs so you can take a look, but note that they are a little bit to look at because of the parameters of the model and the notation. basically there are three simulation subsystems, two of them represent the two equation of motion for the displacement of the cart (X) and the pendulum angle (Theta). The complete subsystem includes the linear actuator dynamics that there is a DC motor with a planetary gearbox.
This is for my final career projetc, so any help to overcome this is very apreciated.
Also, I try checking the "synchronize loop with an external timing source" checkbox and set it up to 1 KHz, but did not work either...
Best regards.
10-08-2014 05:07 AM
Try to lift the thread to see if I am lucky and someone could help a little.
10-11-2014 05:01 AM
Hello guys,
I do not know how to edit my first message so I post a new one here. I forgot to add the top level VI so anyone could run a proper simulation of the system. I will add all of the files to this new post so you can compare the behaviour of the model.
Any help will be very appreciated.
Best.
Javier.