Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Designing of an Automated Fuel Cell Validation Stand Using Compact FieldPoint for Custom Analog and Discrete Control

  Print

Using Compact FieldPoint, Viewpoint Systems built a fuel-cell test stand that predicts system response and eliminates overshoot while achieving a faster settling time.

Author(s):
Jim Campbell - Viewpoint Systems

Industry:
Life Science, Industrial Controls/ Devices/ Systems

Products:
Compact FieldPoint, LabVIEW, FieldPoint

The Challenge:
Combining slow safety clocks and faster PID control loops, as well as precisely and reliably controlling a fuel cell test stand that implements advanced control algorithms.

The Solution:
Using NI’s programmable automation controller, Compact FieldPoint (cFP), and LabVIEW Real-Time to run advanced control algorithms and multiple parallel loops, to control our process and communicate with a PC.

Selecting a PAC as an Alternative to Traditional PLCs
At Viewpoint Systems, Inc., we were contracted by Micro Instrument, an automation vendor building the test and validation stands for a major fuel cell company. Micro has extensive experience with PLCs and standalone controllers for control of repetitive motion, safeties, and other “environmental” parameters, such as pressure and temperature. From their experience, it was clear that a PLC could reliably deliver discrete I/O control and standard PID loop control.

However, their customer needed to implement control algorithms more advanced than simple PID. With Compact FieldPoint and LabVIEW Real-Time as an alternative to traditional PLCs we were able to provide a flexible control environment that could meet their system demands. For example, we programmed Compact FieldPoint to run control loops that were aware of imminent system-state changes. These control loops predicted system response and could eliminate overshoot or achieve a faster approach to a setpoint. Because the customer did not know in advance what these “smart” controls would entail, it was a benefit to have the full power of LabVIEW to develop such controls. Providing this functionality with a PLC would be cumbersome, if not impossible.

Achieving Superior PID Control with Compact FieldPoint
First, we needed to ensure that Compact FieldPoint running LabVIEW Real-Time could deliver the required control tolerances. In this system, PID control was of two forms – pulse width module (PWM) and continuous control.

Because we did not have the cFP-PWM-520 module when we performed our initial testing, we used LabVIEW to create the PWM control with a standard digital output module. We chose the PWM period of 100 ms and implemented with a high-speed 1 ms loop that created the PWM pulse by setting the output on or off according to the PWM pulse width. This provided a PWM pulse width granularity of 1 percent. Inside the 100 ms loop, we read the process variable, performed a PID calculation using the LabVIEW PID toolkit to compute a new PWM pulse width, and passed that new width to the inner 1 ms loop, to build the PWM pulse through a digital output.

Even with this custom, software-timed PWM, we achieved similar or better control than was available with our existing PLC controller. Ultimately, we used the cFP-PWM-520 module, rather than this inner 1 ms loop, so the CPU running LabVIEW Real-Time can perform advanced control tasks. For example, we implemented gain scheduling for the PID parameters in LabVIEW and included some nonlinear control based on process error to change the minimum and maximum outputs allowed by the PID controller. These programming enhancements boosted our PWM control capabilities beyond the PLC in terms of reaction time and stability.

In the continuous control case, we passed an analog input value through a parallel PID calculation and passed it to an analog output. We designed this loop to run at a 100 ms loop rate. Again, we achieved similar or better control that with our traditional controller.

Safety and Tooling Control
Our second task was to validate the capabilities of Compact FieldPoint to perform discrete control. A typical PLC application uses discrete I/O to watch and manipulate the state of the machine. These discrete I/Os tend to be 24 VDC or 120 VAC, and we used Compact FieldPoint digital I/O modules to implement this functionality.

For our application, we needed to watch several safety sensors to monitor the test stand health. Because the loop time on these sensors did not need to be extremely fast, we chose a 25 ms loop time. On some PLC applications, the reaction time to discrete inputs may need to be on the order of milliseconds. In our tests, we found that Compact FieldPoint was able to achieve a 2 to 5 ms response time through careful application of LabVIEW coding techniques and appropriate digital I/O hardware. However, with the nearly 30 parallel analog and discrete loops we used, a loop time of 25 ms was more realistic. If we had needed the 2 to 5 ms response, we would have needed to include another Compact FieldPoint controller.

Communicating with the PC
Our final task consisted of communicating the state of the test stand to the master PC. In addition, we needed to update new control setpoints to the various PID loops on the Compact FieldPoint controller.

On most PLCs, such communication between the PLC controller and a PC is done through a proprietary communication protocol, such as Modbus or Profibus, or through standards such as Ethernet. The PC commonly has a driver written to communicate with the PLC, or the user can incorporate a standard layer, such as OPC, to communicate with the PLC. In either case, to update a setpoint value held in a PLC memory location, the PLC tag associated with the memory is read from or written to through the driver or OPC interface. Then, any ladder logic program on the PLC can use an updated value by polling the PLC memory.

On the Compact FieldPoint controller, there are several options for moving data to and from the PC. First, since LabVIEW Real-Time is running on the cFP controller, we could use a number of communication methods, including remote VI server, raw TCP/IP, and the FP tag I/O VIs used in conjunction with “memory” tags created with the ‘FP Publish.vi’ function. This VI automatically creates tags that appear in FieldPoint Explorer.

We chose to use the “memory” tags for performance and ease of programming. With this approach, we were able to read the process variable values from Compact FieldPoint, as well as write new setpoints and PID coefficients.

Achieving Advanced Control Capabilities
The final solution used a single Compact FieldPoint controller to control the following independent parallel loops:
- 7 parallel loops for PWM based temperatures control
- 2 parallel loops for continuous pressures monitoring
- 4 parallel loops for discrete solenoid and sensor monitoring and control
- 15 parallel loops discrete safety loops
Each control loop performs in a separate LabVIEW “while” loop. We programmed control loops of similar type into a single VI, so we could tweak performance by placing the control VIs into separate threads.

The PWM control used inputs on the TC-120 module and outputs on the cFP-PWM-520 module. As stated above, we used the PID toolkit to perform the PID calculations. In addition, we incorporated some of the advanced features the customer wanted by switching control methodology and PID coefficients based on system state. Each temperature loop was in a separate LabVIEW “while” loop. The PWM temperature PID loops ran with a 500 ms cycle. We coded all loops into a single VI that was set at ‘above normal’ priority.

We also perform the pressure control within separate loops, programmed in fashion similar to the temperature loops. The inputs here came from the cFP-AI-110 module and the cFP-AO-200 module drove the outputs. These loops ran at a 100 ms cycle. We coded these loops into a single VI that was set at ‘above normal’ priority.

We coded the discrete control into a third VI. These loops monitored sensor input and reacted by closing or opening solenoids. We also switched solenoids based on thresholds on some analog levels. We used multiple DI-300 and DO-400 modules. These loops ran with a 25 ms cycle, and we coded the loops into a single VI that was set at ‘time-critical’ priority.

Finally, we set a VI at ‘normal’ priority for communication with the PC.

In summary, Compact FieldPoint with LabVIEW Real-Time was able to run our custom control algorithms and surpassed the capabilities offered by standard PLCs.

For more informaiton, contact:
VIEWPOINT SYSTEMS
800 W. Metro Park Rochester, New York 14623-2708
Tel:(585) 475-9555
Fax:(585) 475-9645
126A Main Street Watertown, Massachusetts 02472 Tel:(617) 926-9064
Fax:(617) 924-3402
www.ViewpointUSA.com

Browse All Case Studies »

  Print