Thursday, June 02, 2005

Control and National Instruments: Oil and Water?

National Instruments has put a lot of effort lately into producing serious control and automation solutions to help them move from analysis and acquisition to actual design and control. They acquired MatrixX to try to speed up the algebraic support in LabVIEW. They've put together elaborate control demonstrations with Quanser plants. They've been very visible. And perhaps most importantly, they've sued the pants off of Mathworks for recent work in Simulink that would make MATLAB+Simulink a stronger competitor with LabVIEW. NI likes patents, why? Because they stiffle the innovation that they don't want to do internally.

I used to work for National Instruments. When people called them the K-Mart of data acquisition, I defeneded them, and I think I still would. NI does DAQ pretty well. There are some very specific applications where NI products are top notch.

However, recent struggles helping a friend build a 6DOF quadrotor helicopter controller have made me come to despise that little company in Austin.

Has anyone used the Fuzzy Logic Control Toolset in LabVIEW? I'm pretty sure an intern (and a really dumb one) built it. Setting up your antecedence and consequence is okay, and building the fuzzy ruleset is ugly but reasonable, but there's a LOT of room for improvement there. However, there are deeper fundamental problems.

For one, it only supports four inputs and one output. In our case, we have twelve inputs and four outputs. You might think that would mean we could cascade fuzzy controllers; in fact, that's what NI's documentation says. However, if you put more than one of these things in a VI, they share memory and lock all of their output together. They do not act independently. That's really the most frustrating part.

However, even if that major problem was fixed, there still would be plenty more problems.

First, after you build your fuzzy rulesets, you have to store them as a ".fc" file. There's no information about the structure of this file, but further inspection of the "Load" VI that pulls it up makes it look like LabVIEW just dumps the structure directly to the file, so it's a big binary mess (heaven forbid it get corrupted). It would be nice if it wrote out a nice CSV file. You see, then I would be able to avoid the GUI completely and just use a text editor (or even Excel) to build my rules.

Now, you would imagine that this ruleset could be passed in as a "file path" constant or control. However, instead they've used a "file prompt" (or something like that -- something I've never used in LabVIEW before) which forces the user to get prompted for the file every time. This means that if you want your VI to run without prompting, you have to run your VI *ONCE*, get prompted, and load the data in, then STOP the VI, then make all its current values the default, then SAVE the modified LOAD with a SEPARATE NAME!! This is in the NI DOCUMENTATION!! This is **REQUIRED** for use on a real-time system. This inflates the size of your VIs a great deal because it has to save all of that data within the VI, and it makes it VERY DIFFICULT to make nontrivial updates to your fuzzy ruleset later on. On top of that, they don't tell you you could just change that to a file path control/constant and upload your ".fc" files onto the realtime machine via FTP, which is a much more attractive solution.

So to me and to many of my peers, the "Fuzzy Logic Control Toolset" is worthless. Four inputs and one output really is a killer. The rest of the stuff just adds insult to injury.

On top of all of this, the realtime system is always losing connection forcing us to shut down LabVIEW, start it back up, change the execution target, and re-load the VI every four or five runs. The realtime system is ***SO SLOW*** (33 Hz top loop rate doing a reasonable nonlinear (or even linear, really!) control) even after we build many of our components on the FPGA module!!

After all of that, it's clear to me why they've made the CompactRIO systems so robust. After working with them for a few months, you can't help but want to throw them out a window.

No comments: