Data Transfer via UDP between Simulink and X Plane

4 views (last 30 days)
Hello all, I am new to the community and to X Plane. I have recently started on working with RC Raptor 30 Helicopter on X Plane. My aim is to autonomously fly the copter in the simulator using commands from Simulink.I have been able to set up the udp communication between X Plane and Simulink, where i can receive data from and send data to X Plane. The problem I am facing is the data I receive from X Plane is discontinuous. Discontinuous in the sense that, the data is something like a PWM signal, in pulses. The data seems to be numerically correct on the rising edge of the pulse, after some time the value falls to '0', again there is a pulse with the correct value and then again the signal value fall to '0' and so on. I am not able to understand why I am not getting continuous discrete signal (oxymoron :D ) i.e. the data sent by X Plane is at discrete instants but the signal value does not fall to 0 every now and then, if the actual data is not 0. Can someone please help figure out what is the issue here. Thanks in advance.

Answers (1)

Don Zheng
Don Zheng on 9 Jun 2017
Edited: Don Zheng on 9 Jun 2017
Assuming you are using the UDP Receive block from the Instrument Control Toolbox, you may turn on the Status port by disabling the blocking mode. That way you can first identify if it is just a data loss rather than error for the unexpected zeros. Also, make sure the data type is compatible so the received data do not get rounded down to zeros due to precision loss. If you are using other UDP blocks, try similar things for diagnostics.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!