QuadPlane SITL with X-Plane 12?

I’m trying to get SITL to work with a custom QuadPlane in X-Plane 12, but I can’t seem to get the dataref mappings correct. The plane is a 4-rotor tailsitter with no control surfaces (Q_TAILSIT_ENABLE = 2), but I’m not even attempting VTOL flight yet - just trying to get basic motor/stick inputs working.

I created a custom xplane_plane.json file, and launch SITL with this command: ../Tools/autotest/sim_vehicle.py -v ArduPlane -f xplane --add-param-file=uav-sitl.param

The contents of my JSON and param files are shown below.

Motor outputs are somewhat working, but it’s not clear what “range” value should be used for “ENGN_TRQ”. If I provide a value of 1, then the motors spin at 15,000+ rpm even at idle. Setting it to 0.2 gives slightly more realistic, but still not correct, rpm levels. Does “range” correspond to some physical real-world measurement?

The other problem I’m having is with stick inputs: I can’t seem to get the plane to respond to any stick axis at all. I’m not even sure if they’re being sent from X-Plane → SITL. I believe the network settings are data outputs configured correctly, and the plane location syncs with the QGroundControl map. Any idea why I can’t get throttle or control response?

xplane_plane.json:

{
  "settings": {
    "debug": 1
  },

  "sim/operation/override/override_joystick" : { "type" : "fixed", "value" : 1 },
  "sim/operation/override/override_engines" : { "type" : "fixed", "value" : 1 },

  "sim/flightmodel/engine/ENGN_running[0]" : { "type" : "fixed", "value" : 1 },
  "sim/flightmodel/engine/ENGN_running[1]" : { "type" : "fixed", "value" : 1 },
  "sim/flightmodel/engine/ENGN_running[2]" : { "type" : "fixed", "value" : 1 },
  "sim/flightmodel/engine/ENGN_running[3]" : { "type" : "fixed", "value" : 1 },

  "sim/flightmodel/engine/ENGN_TRQ[0]" : { "type" : "range", "range" : 0.2, "channel" : 1 },
  "sim/flightmodel/engine/ENGN_TRQ[1]" : { "type" : "range", "range" : 0.2, "channel" : 2 },
  "sim/flightmodel/engine/ENGN_TRQ[2]" : { "type" : "range", "range" : 0.2, "channel" : 3 },
  "sim/flightmodel/engine/ENGN_TRQ[3]" : { "type" : "range", "range" : 0.2, "channel" : 4 },

  "mapped2" : { "type" : "joymapped", "channel" : 1, "input_min" : -1.0, "input_max" : 1.0 },
  "mapped1" : { "type" : "joymapped", "channel" : 2, "input_min" : -1.0, "input_max" : 1.0 },
  "mapped4" : { "type" : "joymapped", "channel" : 3, "input_min" : 0.0, "input_max" : 1.0 },
  "mapped3" : { "type" : "joymapped", "channel" : 4, "input_min" : -1.0, "input_max" : 1.0 }

}

uav-sitl.param:

AHRS_EKF_TYPE 10
GPS1_TYPE 100
INS_GYR_CAL 0
ARSPD_TYPE 100
ARSPD_USE 1

Q_ENABLE 1
Q_FRAME_CLASS 1
Q_FRAME_TYPE 3
Q_TAILSIT_ENABLE 2
Q_TAILSIT_MOTMX 15

ARMING_SKIPCHK -1

SERVO1_FUNCTION 33
SERVO2_FUNCTION 34
SERVO3_FUNCTION 35
SERVO4_FUNCTION 36

AIRSPEED_CRUISE 14.75232
AIRSPEED_MAX 35
AIRSPEED_MIN 12
AIRSPEED_STALL 9.83488
THR_MAX 100
TRIM_THROTTLE 40
PTCH_LIM_MAX_DEG 90
PTCH_LIM_MIN_DEG -90
ROLL_LIMIT_DEG 90

Q_A_ANGLE_MAX 80
Q_A_INPUT_TC 0.2
Q_BCK_PIT_LIM 15
Q_FWD_PIT_LIM 5

Q_M_PWM_MIN 1000
Q_M_PWM_MAX 2000
Q_M_SPIN_ARM 0.1
Q_M_SPIN_MIN 0.15
Q_M_SPIN_MAX 0.95
Q_M_THST_EXPO 0.65
Q_RC_SPEED 490

Q_TAILSIT_ANGLE 55
Q_TAILSIT_ANG_VT 45
Q_TAILSIT_INPUT 0
Q_TAILSIT_RAT_FW 18
Q_TAILSIT_RAT_VT 45
Q_TAILSIT_RLL_MX 45
Q_TAILSIT_THR_VT 50
Q_TRANS_DECEL 2
Q_TRANSITION_MS 5000