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

Development of a Hardware-In-the-Loop (HIL) Simulator for a Rotary Wing UAV

  Print

Figure 1 - System Architecture

Author(s):
R. Pretolani - UNIVERSITÁ DEGLI STUDI DI BOLOGNA II - FACOLTÁ DI INGEGNERIA - SEDE DI FORLÍ
G. M.. Saggiani - UNIVERSITÁ DEGLI STUDI DI BOLOGNA II - FACOLTÁ DI INGEGNERIA - SEDE DI FORLÍ
B. Teodorani - UNIVERSITÁ DEGLI STUDI DI BOLOGNA II - FACOLTÁ DI INGEGNERIA - SEDE DI FORLÍ
F. Zanetti - UNIVERSITÁ DEGLI STUDI DI BOLOGNA II - FACOLTÁ DI INGEGNERIA - SEDE DI FORLÍ

Industry:
Government/Defense, Aerospace/Avionics

Products:
LabVIEW, CompactRIO, Simulation Module, FPGA Module, Reconfigurable I/O, Real-Time Module

The Challenge:
To develop an HIL test bench for the Rotary wing UAV (RUAV) platform available at the University of Bologna. The HIL must be capable to emulate the real UAV system in order to allow safe and risk-free pre-flight testing

The Solution:
The HIL simulator was developed as an integrated modular system using National Instruments hardware and software. The real RUAV systems were emulated using the National Instrument PXI-7831 (instead of the onboard CompactRIO controller and FPGA modules), while the RUAV platform was simulated by implementing a helicopter model using the NI Simulation Module software. Comparison with flight tests demonstrated that the developed HIL simulator is a reliable test bench for safe ground tests of the onboard RUAV control system.

"The DIEM Aerospace Department at the University of Bologna developed a rotorcraft UAV using the NI CompactRIO system as onboard computer for flight data acquisition and helicopter control."

Summary
At the University of Bologna - DIEM Aerospace Department, a rotorcraft UAV was developed using the NI CompactRIO system as onboard computer for flight data acquisition and helicopter control. During the first flight tests the UAV helicopter was able to perform a complete flight pattern under computer control. Parallel to the RUAV platform, a modular HIL test bench was also developed in the NI LabVIEW environment to allow safe and risk-free pre-flight hardware and software tests.
The developed HIL test bench (see fig.2) includes as much of the flight hardware in the testing loop as possible and is constituted by both software and hardware equivalent to the onboard systems. Particularly, National Instrument PXI-7831 was used instead of the CompactRIO FPGA modules. Inside the HIL, the RUAV platform was emulated by implementing a helicopter simulation model using the NI Simulation Module software.
Comparison with flight tests demonstrated that the HIL simulator can be a reliable test bench for safe ground tests of the onboard RUAV control system.

Article

Background
It is well known that UAVs may represent a promising and cost-effective alternative to manned aircraft for a large number of civil applications. Compared to traditional air vehicles, UAVs may offer significant advantages in terms of human safety (especially in dull, dirty and dangerous missions), operational cost reduction and work rate efficiency. In the last years, UNIBO has carried out several research projects concerning the development of UAVs platforms, both fixed and rotary wing, for civilian applications.
In order to develop such kind of platform, new avionic systems are required to enable the helicopter maintaining a stable attitude and following desired trajectories. This avionics package is comprised of sensors, computer and data link hardware as well as software to guide, navigate and control the air vehicle. Generally speaking, the setup of an avionic package for RUAVs requires a number of skills which span the area of micro-circuitry, data link communication, electronics integration, installation and programming, filter design, signal conditioning and vibrations isolation. Most of the existing RUAV projects use onboard electronic devices, which require the employment of numerous expert technicians for system assembling and testing, thus increasing the development time and total costs.

At the University of Bologna, the RUAV avionics package was developed as an integrated modular system using off-the-shelf and cost-effective technologies. The CompactRIO system from National Instruments was chosen as flight computer due to its reliability and reconfigurable architecture, which enables fast and easy integration of different input/output hardware and sensors.

Parallel to the helicopter platform construction and avionics setup, a modular Hardware-In-the-Loop (HIL) test bench was developed in the NI LabVIEW environment, to allow safe and risk-free pre-flight testing.
CompactRIO and the HIL simulator were fast and easily programmable, they increase hardware/software development and integration. These systems will be described in the paper.

Hardware and system architecture
Usually, the set up of a RUAV system requires a series of subsequent steps to be undertaken including:
- hardware selection and system set up
- design of sensor acquisition software and control system
- development of a Hardware-In-the-Loop (HIL) simulator test bench to allow risk free ground test of the flying hardware and software
- final autonomous flight experimental tests.

The RUAV system architecture and the HIL simulator are shown in figures 1 and 2.
Both the flying systems and the HIL simulator were developed through extensive use of National Instruments hardware and software.
The RUAV platform developed at UNIBO is constituted by a Hirobo 60 hobby helicopter which was modified to accommodate the avionics hardware. A more powerful engine, longer fiber glass blades, longer tail boom and tail blades were also mounted in order to increase the helicopter payload carrying capabilities.

The NI CompactRIO was used as Flight Computer in order to acquire sensors information and generate PWM actuator signals based on the control algorithms implemented on it. Particularly:

- the CompactRIO FPGA receives flight data information from the Crossbow NAV420 AHRS (Attitude Heading Reference System) managing an RS232 protocol through the Digital Input cRIO-9411;
- the CompactRIO FPGA receives and sends PWM actuators signals through digital input cRIO-9411 and output cRIO-9474 respectively;
- the CompactRIO acquires sonar sensor altitude information by managing an I2C protocol using the digital input cRIO-9411 and output cRIO-9474;
- the CompactRIO real-time core receives sensor information from the FPGA and records all the flight data; meanwhile it manages also wireless Ethernet communication with the ground control station.

The developed HIL test bench (see fig. 2) includes as much of the flight hardware in the testing loop as possible and is constituted by:
- an hardware, equivalent to the flight computer which runs the onboard software. At this aim, a National Instrument PXI-7831 was used as it is equivalent to the CompactRIO FPGA modules. PXI communication with the computer (emulating the CompactRIO Real time core) can be performed by means of a FPGA interface card.
- a computer which emulates the helicopter plant and the onboard sensor outputs.
- a Ground Control Station computer which contains the real GCS source code and communicate with the simulation computer by means of a TCP/IP protocol
- an OpenGL visual system computer can be optionally added for rendering the helicopter flight as it moves around in a virtual scenery. The visual system can receive input from the GCS computer using a TCP/IP protocol

Software
Fig. 3 shows the LabVIEW code which manages the whole RUAV system while fig. 4 shows the equivalent code in the HIL simulator. Both software have the typical CompactRIO application design architecture.
Particularly, for the real RUAV system:
- The FPGA code uses four different sensor read/write loops and one PID control loop for helicopter control. By now the PID loop is closed at 50 Hz. The write loops send PWM command to the helicopter servo actuators (main rotor cycles and collective, tail rotor collective and engine) in order to track a pre-defined flight pattern. The first read loop acquires helicopter attitudes, angular rates, velocities and GPS position from the Crossbow NAV 420 which uses a RS232 protocol; the RS232 protocol has been managed using the FPGA Digital Input to guarantee deterministic data acquisition which couldn’t be achieved using a real time application. The second read loop manages PWM commands data acquisition. Another read/write loop is used for sonar sensor data acquisition and manages an I2C protocol.
- The CompactRIO Real-Time software is used for FPGA data acquisition, onboard flight data logging and wireless Ethernet communication with the ground control station. The ground control station communication is managed by means of the LabVIEW real time communication wizard.
- The ground control station software is also developed in LabVIEW for Windows and runs on a laptop computer using Windows XP OS (Host computer). The remote graphical user interface is constituted by two windows - the virtual cockpit window and the telemetry window - for real time display of flight data information (fig 3). The first one has been developed using also ActiveX controls, such as aircraft instrumentation available from Global Majic Software House. Additional information are available such as GPS and inertial measurement unit status and system warnings.

The equivalent code in the HIL simulator is constituted by:
- the same FPGA code of the real RUAV system running on the NI PXI-7831;
- the software running on the simulation computer which is composed by three main parts:
• the simulation loop which contains the helicopter simulation model, developed using the NI simulation module;
• a serial port write loop for emulating the Crossbow NAV 420 RS232 output, based on the states information coming from the helicopter simulation loop;
• the same CompactRIO real time software. For practicality reasons, the helicopter simulator and the real time code runs on the same machine. This is possible because all the source code is organized using independent loops;
- the software running on the GCS computer which is the same of the real GCS software.

The result of this setup is that the on-board computer effectively “thinks” it is flying the vehicle, as all of its configuration/data flow is identical to an autonomous flight setup.
In this scenario, performance and possible errors of the onboard software can be detected during intensive ground safe simulations, before performing any flight test.

Results and Conclusion
HIL simulations and experimental flights were performed in order to test the feasibility to use the selected hardware and the developed software for helicopter control. Comparison between simulation and experimental results showed good agreement (see fig.5), thus demonstrating the feasibility to use the developed HIL simulator as ground safe test bed for the UNIBO RUAV system.

In the future, the simulation platform will be further improved. More sophisticated dynamics models will be implemented on the HIL simulator, including more accurate models of all flight sensors. Coupled with the RUAV platform, these simulation environments will provide useful test beds for safe ground pre-flight tests or for studying different control and navigation strategy. Researches in man machine interface and air system integration could also be performed, which were addressed as one of the most critical technology aspect for the future development of the civil UAVs and their integration into the airspace.

Browse All Case Studies »

  Print