Mugin UAV HIL Sim Initialization Errors

For a bit of background: I’ve got a Mugin aircraft (troybuiltmodels.com/items/TBMUAV4-3-H.html) that I’m working on getting up and flying with an APM 2.6. I’ve currently got my Mugin (nicknamed Muggle) made up in plane maker for some x-plane 10 simulation.
https://www.dropbox.com/s/rm4rvc5w17vf8j8/Muggle%20Painted.JPG
I’ve setup my futaba T8FG super remote with my 2.6 and it arms correctly and went through the arduplane wizard without a problem using mission planner. However when I then upload the HIL firmware to get set up for simulation I’m having some problems. It loads the firmware just fine and I can connect (currently over usb but I tried via the radios as well with the same problem) and it just gets hung up with initializing.
https://www.dropbox.com/s/ggdo15h9vosxb0v/xplane%20muggle.jpg
https://www.dropbox.com/s/ggtdex7mstpaygs/MP%20muggle.jpg
I know that it is partly working because GPS values are being received by MP in the simulation tab and are correct for where I’m loading the aircraft in x-plane (transmitted data circled in red as well as the mode stuck in initializing). The x-plane and MP pics are screenshots at the exact same instance. I’m using the most up to date x-plane, mission planner and HIL plane firmware. Also as a note, the flight data tab in MP does not update with any data (shows as initializing) and the aircraft gps location does not update onto the map.

Thanks,
Calvin

Hi Calvin,
if you cannot see any live data on the flight data screen on mission planner then the APM is not receiving live flight data from the sim, have you configured the data input/output settings screen in X-plane?
Also have you checked that the green bars move on the RC callibration page on mission planner when you move your transmitter sticks.
You could maybe try an older version of the Arduplane code, for some reason I can’t get the radio control to work with the current 3.0.3 version,
Martin :smiley:

Thanks for your response Martin,
I am not sure exactly which screen you are referring to in X-Plane. I have set the MP simulation tab advanced settings as follows: Sim pc IP 127.0.0.1 SITL pc IP 127.0.0.1 Sim pc Port 49000 and Planner pc Port 49005. In X-Plane I’ve set it up as the following images show:
Data Set:
https://www.dropbox.com/s/zy6fpxohqgyoser/XPlane%20Data%20Input%20output.JPG
Net Connections:
https://www.dropbox.com/s/b6jrcgcbywc8m2g/XPlane%20Net%20Connections%20Data.JPG
The green bars move while I’m using the arduplane firmware. Once I upload the HIL Plane firmware they no longer move. However, in this firmware if I go to the simulation tab and hit the start the sim link (without xplane on) I get servo outputs as I should. When I start X-Plane and then start the sim link all the servo outputs jump to 1 and I lose control of servo output as the system is stuck in initializing.
Sim Start:
https://www.dropbox.com/s/nu5k2nkb8iasqif/MP%20Sim%20Start.JPG
The flight data tab shows disarmed and no gps (I’m flying out of Tacomoa Airport in X-Plane)
https://www.dropbox.com/s/e1b86mdv4alo3qc/Disarmed%20Initilising.JPG
When I close X-Plane with the sim link still going the servo output drops back down to neutral and I regain control with of the servo output as you can see in this image:
https://www.dropbox.com/s/shh0bhz7kmgrbbt/After%20Exiting%20XPlane.JPG
I hadn’t thought about trying to use an older version of HIL firmware.

Calvin

Hi Calvin,
My rc control always works fine once the APM and sim are connected, the settings that you need to configure on X-plane are can be found by choosing the tabs Settings/Net Connections/Data.
When you connect you should see “Your IP address is …” this IP address … is the one that should be entered into mission planners advanced settings tab.
Once you have done that and the sim has sent data you should receive this reply on X-plane, “Got transmission from a multiplayer etc, Label for IP address …” this IP address should be entered into the data output for X-plane further down the x-plane data page.
Hopefully once the flow of data between APM and the sim is working your radio connection issues should clear.
How are you set up, do you just have a minimal anmount of hardware connected to the APM, ie just the RC receiver, you do not need to have GPS,radio telemetry, or servos connected for the sim to work.
Martin :smiley:

Thanks again Martin,
So I’m a bit confused now… According to the ardupilot X-Plane wiki:
"If you are running X-plane on the same computer as Mission Planner, then enter the loopback IP address (127.0.0.1) as shown above. If you are running X-plane on a different computer, enter the IP address of the other computer here(for example 192.168.1.1)."
As seen in https://code.google.com/p/ardupilot-mega/wiki/Xplane10
I am indeed running X-Plane and Mission Planner on the same pc so I would think that the IP needed would be the loopback IP indicated here. However after doing what you suggested I did gain rc control in X-Plane with the caveat of not having any data update in Mission Planner. As in, not even the data I was getting earlier (gps coordinates, attitude as it sat on the ground etc) that was populating on the simulation tab in MP. So when I do the loopback IP I get that info and no control in X-Plane and when I do what you suggested I get control but no info. And either way, I’ve never gotten the GPS to update on the Flight Data tab in MP. Part of my confusion in all of this is that instructions for setup all seem to refer to IP and port as if there is only one option for input where actually MP asks for two IPs (sim PC followed by SITL pc) and two ports (sim pc followed by planner pc). Also in the X-Plane settings/net connections/data There is a box for IP and immediately next to it a UDP (I have a value of 49005 here as indicated in the xplane wiki linked above) and then 3 more UDP port options below that. 1st “port that we receive on” 2nd “port that we send on” and finally “port that we send to iPad on” so it is all very confusing when just referred to as IP and port since there are so many of those to input.
Oh also, when I did as you suggested I’m getting this error:
https://www.dropbox.com/s/8nctk8q8pmakzru/IP%20Data%20Not%20Sending.JPG

Calvin

Hi Calvin,
Sorry I may have confused things because I’m set up on two pc’s, but I’ve just done a quick check and returned to the single pc set up.
So on the x-plane data screen you need to have 127.0.0.1 and 49005 in the top box, I never paid any attention to the 3 UDP boxes further down the screen, mine are all set at default, 49000, 490001 and 490003.
Also I’m using Arduplane version 3.0.1 as I couldn’t get my rc control to work with the current 3.03 version.
How are you powering your APM, just using the usb cable? Have you tried connecting a power supply to the receiver.

Thanks, I just reverted to the 3.0.1 and it is working now.