Real-World Applications

Showing results for 
Search instead for 
Did you mean: 

Development of a Cost-Effective Versatile Servo-hydraulic Controller Using NI CompactRIO

Company: Tun Abdul Razak Research Centre
Author(s): Vincenzo Orlando
NI Product(s) Used: NI cRIO-9064, NI 9205, NI 9269, NI 9421, NI 9472, NI USB-6002
Industry: Research and Development

The Challenge

Developing and retrofitting a versatile, reliable, and low-cost motion controller for a ±50 mm, ±5 kN dynamic fatigue test machine.


The Solution

Using LabVIEW software and a CompactRIO embedded controller to develop an FPGA-based solution, which results in fast and deterministic timing control to satisfy the proportional–integral–derivative (PID) controller requirements, log data, and run the safety loops.



The Tun Abdul Razak Research Centre (TARRC), is the UK-based research and promotion centre of the Malaysian Rubber Board. Its research focuses on expanding and enhancing applications of natural rubber. TARRC has pioneered many test and design methodologies for engineering applications of rubber, and many other new applications. It also has a consultancy arm, Rubber Consultants, that offers help with all rubber-related problems.


TARRC bought the Servotest type 178:100:500 servo-hydraulic test machine in 1974 and used it to produce databases well known in the rubber industry, such as the dynamic properties data published in the Engineering Data Sheets (1979-1983). However, TARRC’s engineering unit has barely used it in the last few years, mainly due to the limitations of the controller.


We carried out our first approach to control the machine using software in late 2015, when we needed a machine that could run arbitrary motion histories written into CSV files. The dynamic specifications of the Servotest were a perfect match for the tests, so we explored the possibility of carrying out the tests using the machine.


We had recently purchased two USB-6002 DAQ modules for electronic development from NI. We implemented the USB-powered, compact, and lightweight USB-6002 DAQ module in cascade between the old controller and the PC. We created several LabVIEW virtual instruments using this control scheme and used the machine for consultancy and research after retrofitting the USB-6002 DAQ module.


The digital control system using the USB-6002 DAQ proved to be more than capable of fulfilling our testing needs on the Servotest machine. It also transformed the machine from the least used to the most used among our servo-hydraulic equipment as it enabled more flexibility on user-defined command signals than the more modern machines with digital controllers run by commercial software. However, the system relied on the 35-year-old Servotest controller as the main communication system between the servovalve and transducers.


Servotest.pngFigure 1. An NI embedded controller manages the Servotest machine


Controller Development

We carried out intensive research on servovalve control schemes and controllers. We determined our best solution was to develop a programmable logic controller (PLC) or FPGA-based solution. Since we already used NI hardware and software, an FPGA-based solution was more attractive and easier to develop.


We selected the cRIO-9064 embedded controller to develop the new control system. The software-designed controller features a real-time processer and an FPGA, which we used to:

  • Control the servovalve using a fast and robust proportional–integral–derivative (PID) controller
  • Interface with the hydraulic power pack, turning it on and off while periodically checking on the safety sensors of the system to prevent any damage to the machine itself, the specimen under test, and the users
  • Communicate with the embedded PC, sending and receiving control and logging data


To communicate with the servovalve, hydraulic power pack, and transducers, the controller requires digital and analogue I/O modules. We selected the NI 9472 digital output module, NI 9421 digital input module, NI 9269 analogue output module, and NI 9205 analogue input module to fill the chassis. Each module has a specific purpose in the system:

  • The NI 9472 generates the digital signal that controls the hydraulic power pack
  • The NI 9421 reads the status of the safety interlocks in the hydraulic power pack: oil pressure, oil temperature, oil level, oil filter, and motor temperature
  • The NI 9269 generates the ±10 V signal that controls the servo-amplifier
  • The NI 9205 serves as analogue input for transducers (displacement and load) and external control



Figure 2. The high-speed embedded controller includes conditioning modules. Purple lines represent software controlled I/O, green lines represent transducer inputs, and blue lines represent the servovalve control output.


LabVIEW programming

The whole system was programmed using LabVIEW software with the LabVIEW Real-Time Module and the LabVIEW FPGA Module. This section briefly describes the code written for each part of the system. Figure 2 shows a simplified diagram with the tasks carried out by the system.


FPGA Code:

  • Servovalve control: PID controller runs at 100 kHz with a 10 kHz low-pass input filter. It controls the actuator position. Additionally, this loop creates a small amplitude dither signal (sine wave, 691 Hz) that is applied to the servovalve. The dither signal removes the control spikes that occur when the servovalve is in its dead band zone and prevents static friction (stiction) effects.
  • Preprocessing of data: The displacement and load signals are sampled at 2.5 kHz, then they go through a 300 Hz low-pass filter, and into a multiplexed target-to-host, first in, first out (FIFO) direct memory access (DMA).
  • Safety logic: FPGA sends an output that turns the hydraulic power pack off if any safety interlock or limit is tripped, and ignores the pump ON signal from the control PC if any safety interlock or limit is tripped. The system carries out these checks 100,000 times per second.


Real-Time Code:

  • Generates the signals that control the servovalve for routine testing
  • Carries out cycle/frequency detection on the displacement signal
  • Controls the start-up value of the FPGA PID gains, low-pass filter cut-off frequencies, control loop frequency, logging loop frequency, and dither signal amplitude and frequency
  • Passes information between the control PC and the FPGA for displacement, load, actuator setpoint, pump ON/OFF control, displacement and load limits, interlock status, and external control


Control PC Code:

The control PC has the main user interface (UI). We can use this to activate a legacy support function, which enables the USB-6002 DAQ with the new controller, giving the operator the option of using all the software developed for the previous version of the control system.




Figure 3: Simplified diagram shows the FPGA, real-time computer, and control PC tasks.



Using LabVIEW with the CompactRIO controller to develop the low-cost modular motion controller was quick, easy, and 80 percent cheaper than purchasing a commercial solution.


Additionally, the interface with the low-cost USB-6002 DAQ provided all the versatility that had elevated our oldest servo-hydraulic machine from last choice to first choice for users, given compatibility with load, stroke, and rate requirements.



 Figure 4:Screenshot of the control PC running one of the Legacy LabVIEW programmes with the hydraulic powerpack control on the right


Smarter than the average bear!

Thanks for sharing. This is very similar to systems I work with and would like to upgrade.