Friday, May 22, 2009

No software? No problem!

Hello there!

I've recieved some emails asking how to run the code I shared in the previous posts. Users might be interested in LabVIEW for simulation but don't have LabVIEW and/or some of the extra libraries needed.

Fear not, Guti is here to help you out!

National Instruments allow users to download LabVIEW-related software for free and evaluate it for 30 days. Follow this link to get the software

https://lumen.ni.com/nicif/us/evaltlktcds/content.xhtml

here, you can download not only core LabVIEW, but also very cool related toolkits and modules like the Control Design and Simulation Module, System Identification Toolkit, PID Control Toolkit, Real Time Module, FPGA Module, Statechart Module and more..

Go ahead, download all of them! but make sure you have a broadband connection :D

Now that you have the product, let me help you get started. There are a number of tutorials about LabVIEW on the web, but I have to suggest one place to start with, check out this link

I know, I know, you are eagerly to get started and don't feel like spending hours reading manuals, right. Well, here are a couple of youtube videos for the control geek that there is in you! Emily recorded a while ago, but is still valid




Here is one I just recorded (sorry, my voice is not as nice as Emilie's) the other day using the simulation loop



Enjoy!

Thursday, May 14, 2009

Will LabVIEW take us to warp speed?


I don't know many engineers that are not fun of Star Trek. It's probably one of the first TV shows/movies where engineering had and leading role; as a matter of fact I do know a few engineers to whom Star Trek was their inspiration to became engineer.


One of the recurring topics is the propulsion, or the warp engine. It seems the engineering crew deck (and Scotty, LaForge, Be'Elanna an others) are always struggling to maintain the warp core "contained". I've always guessed that containment was some kind on magnetic field, since the exotic matter that power the different Enterprise ships might not be just put into a fuel tank.

That let me think of one application at the Max Planck Institute for Plasma Physics in Garching, Germany, where researchers implemented a tokamak control system to more effectively confine plasma. Probably the most cool technology used in this application was LabVIEW's capability to leverage multiple cores present in computers to split matrix multiplication operations using a data parallelism technique on an octal-core system


LabVIEW is also bringing us closer to interact with machines using our voice (or thought). Here is an application where a wheelchair was controlled using the mind. The question is, are we going to program LabVIEW???

Enjoy!

Tuesday, May 12, 2009

Time to share some code

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!

Wednesday, April 15, 2009

How are cars built?

Cars are such a common view we don't realize how much engineering and design efforts are behind them. Think how much cars (and the technology they incorporate) have change since the crude Model T Ford produced to any of the cars you can see today in the road: electronic control, ABS, cruise control.. there are even cars that park themselves!!!

But how are those features developed? Well, let me show an example. There is a number of companies working of a feature called "active suspension". Don't you know what I'm talking about? Check this video





But how is 'active suspension' design? It would be inconvenient to have a car on your desk to go trough the design process. One option is to build something similar but to a smaller scale. This is what Quanser has done. This portable plant simulates the action of the road over a wheel and the body of a car and allow users to design and test their algorithms with a real system before actually building a prototype on a areal car






And this is the Active Suspension working with LabVIEW and cRIO

Thursday, April 9, 2009

Inverted Pendulum? Again?

Ever since I started to learn and work with control systems, the inverted pendulum has been around. It is a perfect example of an unstable system that "works" because a smart control engineer developed a control system right? But at the time I was in college I failed to see the applications of this systems. Recently you might have heard about the latest (in my mind) inverted pendulum application, the PUMA. Check it out



Well, I have this Love-Hate relationship with the inverted pendulum since I choose it for my master thesis. I learned, the hard way, there is more to control a system that just the control algorithm, but you have sensors, actuators, noise, non linearities, etc. You can actually check out the video



This was done long time ago, using C on a 486 running DOS (If you just understood what I wrote, you are over 30). Fortunately there are a number of tools available that make the whole control design and simulation much more faster. Check out this team of students as they develop something much better that mine in about four weeks, way faster of what I did

Wednesday, March 25, 2009

Want to go Green? Use simulation


We are living a period where extraordinary advances are being done.

Green engineering is a great example of how technology in general (and engineering practices in particular) are changing at incredible speeds as we as a society came to realize that natural resources won't last long if we keep consuming them at current rates. With the current computing power provided by computers, simulation has proven to be an excellent tool to decrease design times

Below in a link to an example on how simulation can be applied in the field of Green Engineering. A wind turbine is being simulated so users can quickly understand how effects on wind speed and direction affect the power the turbine provides to the grid.

Feel free to download the code (and the evaluation version of LabVIEW, if you don't have it) and play around with it. You might even be able to build your own backyard wind turbine!

http://zone.ni.com/devzone/cda/epd/p/id/6161

Monday, March 2, 2009

Barp's Intro...

As Javier, I mean Guti (I can never get over this nick-name... ) was saying, I am "the other" writer of this blog. I know I was supposed to write this about 2 weeks ago, but deadlines are part of the R&D work and they have priority and, most importantly, we don't want customers to wait for the next version, are we? Anyway, here is my introduction (in IEEE format):

"Alexandre Barp was born in Lages, Santa Catarina, Brazil, in 1973. He received the M.Sc. in Industrial and Scientific Metrology and Instrumentation and B.Eng. degree in Process Control and Automation from Universidade Federal de Santa Catarina, Brazil, in 2000 and 1997, respectively. He is currently project manager "...oh, you know what, I think we should be less formal in this blog. So, since I started in LabVIEW R&D in 2003, I was one of the developers who created the Control Design Toolkit and worked on several other products like PID, Fuzzy Logic, and Simulation Module. Now, I am a Group Manager in the heart of LabVIEW R&D focusing on Control and Simulation. I also work as Adjunct Professor for Texas State University where I lecture Control and Instrumentation.

I am very passionate about control and automation (and instrumentation, robotics, mechatronics, education, and anything related to Engineering, even food engineering...) and I love to program in LabVIEW (even before I started to work for National Instruments). So, I will try to show you the overlap between these two areas. Also, I plan to bring a bit of R&D into this blog, discussing ideas and features with a bit more "technical" insight and also I will use this avenue to discuss future development using LabVIEW in the area of design and implementation and, when possible, sharing where we want to go with this tools.

To get geared up a bit, check this video below. This was a demonstration we did for the last NI Week where we were trying to demonstrate how LabVIEW can be used to control an inverted pendulum controlled by a DC motor. Since it looks like a robot arm this is called Pendubot. In short, we used the LabVIEW Control Design and Simulation (on a iMac, new feature for LabVIEW 8.6!) to design the controller and we used web services to send the parameters to the Real-time target (cRIO). We used a switching controller with a state-machine to move from one state to another and we also used LabVIEW FPGA to estimate the speed of the signal on FPGA. We used state feedback control based on Linear Quadratic Regulator (LQR). I know that some of you at this point don't understand what I am saying... That is OK! Just keep reading and notice how LabVIEW is cool (first of all) and can be used for design and implementation of controlers with pretty advanced stuff... :) Now, if you want to get deeper into it, let me know if want more info, I will be happy to share this code with you... We had University of Texas and Iowa State University implementing this controller in their labs. One last thing: all that all this development was done in 2 to 3 weeks of development from begining to end. Which by itself was pretty nice too... Maybe we should call SRPC (Super-Rapid Control Prototype).




I hope you enjoy this forum!