Data Transfer via UDP between Simulink and X Plane

조회 수: 12 (최근 30일)
Pranjal Biswas
Pranjal Biswas 2017년 6월 7일
편집: Don Zheng 2017년 6월 9일
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.

답변 (1개)

Don Zheng
Don Zheng 2017년 6월 9일
편집: Don Zheng 2017년 6월 9일
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.

카테고리

Help CenterFile Exchange에서 Simulink에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by