Customer SolutionsDesigning of an Automated Fuel Cell Validation Stand Using Compact FieldPoint for Custom Analog and Discrete Control
Author(s):Jim Campbell, Viewpoint Systems
Industry:Industrial Controls/ Devices/ Systems, Life Science
Product:Compact FieldPoint, Distributed I/O, FieldPoint, LabVIEW, LabVIEW Real-Time
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 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 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 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 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 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: |

