ArduCopter HIL mode using Pixhawk4 with X-Plane 10 (QRO-X model)

Hey all,

I’ve been tasked with getting HIL mode working with the ArduCopter firmware. Currently my setup is a PX4 based Avionics board and I’m planning on using the QRO-X model, discussed in the link, in X-Plane 10 for my simulation environment. I’m currently using a custom GCS for my controller and can send sensor data through the GCS or through another program which connects via USB to the APM in my hardware set-up.

I want to know several things regarding the deprecated HIL_MODE and my understanding is mostly from reading other forum posts as to what the issues with having HIL_MODE not working.

  1. What has caused HIL_MODE to stop working since the introduction of Inertial Navigation? This article from the ArduPilot source archive states that since 2.9 the HIL mode hasn’t been supported. Specifically I want to know if this is a technical limitation of the Inertial Navigation or was not updated due a lack of interest in the HIL mode for Copter.

  2. Is there a better simulation environment I could/should use? I’m currently using the X-Plane 10 environment because my group was able to get it working with the HIL for ArduPlane using the Hilstar glider. I’ve read a couple differing posts on building my own quadcopter on X-plane forums and have seen Gazebo as a recommended simulator for Quads in SITL. Any guidance or advice on simulation environment is appreciated.

  3. What guidance on Parameter setting can I find on the site for HIL_MODE? Thr QRO_X model I’m planning to use came with two sets of parameters and I’m not sure which is appropriate, so I’d like to have something to give me a better understanding of the parameters with respect to HIL_Mode.

Any modifications I make to the firmware to get this working will be pushed back into the main project for others to use.

So an update on HIL_MODE work. I’ve been able to get the hil_support to work and compile however the pre-arm check fails due to the AHRS not being healthy. Those who are familiar with the code should know this is happening due to the ekf_starttime and imu_sampletime not being far enough apart in time (should be 1000ms). I’m going to move on to working with some of the Avoidance stuff however getting the HIL_MODE working is still something I’d like to help with.

Additionally I’ve got X-Plane 10 working with the QRO-X model and talking to our GCS over Mavlink. I believe I’m sending all 4 of the throttle controls back to the simulator however it seems like maybe I’m doing something that is making them all the same value in the model. As a result what it does is takes off quick and hard then stays in the air flying randomly around.

If anyone has any input on how to better handle the AHRS in HIL_MODE advice would be appreciated.