By popular request, here are the code of the two examples we've posted before.
Let me start with the pendubot. I reused (A.K.A "stole") this code from Alex. This example does it all! It linearizes a the (obviously non-linear) model, designs a full state controller, simulate the behaviour of the controller with the non linear system and, if you happen to have a pendubot and a cRIO at hand, actually runs the controller to the real think! All you need is LabVIEW and the Control Design and Simulation module (for the design and simulation) and the Real Time and FPGA module (for the controller).
By the way, if you run the controller, you can actually see how the 3D picture does the same as the real thing!. You can download the code form NI Community
http://decibel.ni.com/content/docs/DOC-4788
Now is my turn.
Below is the code for the Active Suspension Demo from Quanser. I know, I know.... is not as complete as Alex's, but gets the job done. It implements two control loops in parallel, one to control the "road" and one to control the "suspension" you can change both controllers on the fly as well as setpoint magnitude and frequencies
http://decibel.ni.com/content/docs/DOC-4789
Enjoy!
Subscribe to:
Post Comments (Atom)
Hi Guti,
ReplyDeleteI saw in the picture you attached that there are small structures that minimize some code while you have arrows as inputs and outputs.
Is this some kind of a XUnit? Where can I get this minimizing windows?
Thanks in advance,
D.
P.S. - I saw your posts regarding inverted pendulum. What do you think about implementing the control over the inverted pendulum and in LV in general with Fuzzy Logic instead of a PID?