Hi everyone.

Are you trying to test your control law, that you implemented in Simulink, on a flight simulator (e.g. X-Plane) and see how it  performs before you actually try it on your drone?

Then this is the right tool for you!!

This is basically some Simulink models that allow communication between Simulink and X-Plane 10 (Yes X-Plane 10, not 9!)

Simply, it decodes the UDP data packets coming from X-Plane to meaningful data (roll, pitch, yaw, rates...etc), so you can use them in your control design!

Also, it allows you to send commands to the plane in X-Plane (e.g. control surfaces, nosewheel and many!!)

I know many of you (developers, researchers, or even hobbyists), myself included, have been looking for such tool. Probably since long time, like myself!

I also know that there are many people who have already done that, but I can not easily find such tool that can be just downloaded and used immediately.  So I thought of just doing it and share it with you guys.

These are basically three models.

1- 'setup_xplane': it sends some commands to xplane to tell it what data to send back (e.g. attitude angles, rates, GPS data..etc). Basically, it checks the boxes of the requested data in the 'Data Input & Output' screen in xplane

2- 'getData_from_xplane': it receives requested data packets from xplane, then decipher them to meaningful information.

3- 'commands_to_xplane': send commands to xplane to manipulate the plane actuators (elevators, ailerons, rudder, nose wheel). However, it's not limited to that!! You can have almost full control of the simulator environment, by sending the appropriate commands.

Again, this is tested successfully on X-Plane 10 NOT 9. However, it can be modified to talk to X-Plane 9 (you will do that; yet, i don't see why you still use X-Plane9 anyway!)

Feel free to play with it and tune/modify/improve/copy/redistribute it, for good, but please at least keep the credit :)

I hope you find it useful for you guys, and I am waiting for your feedback.

[Codes here]

Thanks

[EDIT] July 2nd 2014

I did a little modification on the nose wheel  control signal. It was not working properly. Now it does.

Inbox me if you are interested in the modified version.

=============================

[EDIT] Jul 6 2014

Files are moved to Mathwroks File Exchange website

Link here

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi Mohamed

    while i was trying connect the simulink with x-plane i opened all m files(getdata,send command and setup_x-plane ) i get a error.

    "Unable to locate a C-compiler required by Stateflow and MATLAB Function blocks.
    Use 'mex -setup' to select a supported C-compiler."

    Do you have any advise

    • @ thevenin:  Could you contact me by email?

      • yes i contated to you by e-mail at 10.44 today

  • Hi Yoga,

    I am glad it serves your needs. It certainly helped a lot in our lab, too. It facilitates the process of simulation testing and control design.

  • I have found this UDP very useful as it is very configurable. I could adapt it to a helicopter X-planes model and set the various parameters like rotor rpm, pitch etc. Getting the data back is also very easy and I could close the loop on an X-planes helicopter model using Simulink. Thank you.

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @a1k0n: Did I get rid of hand-tuned parameters? Yes. Am I still hand-tuning more parameters? Also yes. I have a few knobs to address the…
Monday
DIY Robocars via Twitter
RT @a1k0n: I'm not going to spoil it, but (after charging the battery) this works way better than it has any right to. The car is now faste…
Monday
DIY Robocars via Twitter
RT @a1k0n: Decided to just see what happens if I run the sim-trained neural net on the car, with some safety rails around max throttle slew…
Monday
DIY Robocars via Twitter
Saturday
DIY Robocars via Twitter
RT @SmallpixelCar: @a1k0n @diyrobocars I learned from this. This is my speed profile. Looks like I am too conservative on the right side of…
Saturday
DIY Robocars via Twitter
RT @a1k0n: @SmallpixelCar @diyrobocars Dot color is speed; brighter is faster. Yeah, it has less room to explore in the tighter part, and t…
Saturday
DIY Robocars via Twitter
RT @a1k0n: I'm gonna try to do proper offline reinforcement learning for @diyrobocars and throw away all my manual parameter tuning for the…
Sep 23
DIY Robocars via Twitter
RT @circuitlaunch: DIY Robocars & Brazilian BBQ - Sat 10/1. Our track combines hairpin curves with an intersection for max danger. Take tha…
Sep 22
DIY Robocars via Twitter
RT @SmallpixelCar: Had an great test today on @RAMS_RC_Club track. However the car starts to drift at 40mph. Some experts recommended to ch…
Sep 11
DIY Robocars via Twitter
RT @gclue_akira: 世界最速 チームtamiyaのaiカー https://t.co/1Qq2zOeftG
Sep 10
DIY Robocars via Twitter
RT @DanielChiaJH: Always a good time working on my @diyrobocars car at @circuitlaunch. Still got some work to do if I’m to beat @a1k0n howe…
Sep 10
DIY Robocars via Twitter
RT @SmallpixelCar: My new speed profile for @RAMS_RC_Club track https://t.co/RtLb7TcgIJ
Sep 10
DIY Robocars via Twitter
RT @SmallpixelCar: Practiced at @RAMS_RC_Club today with my new @ARRMARC car https://t.co/AEu2hCx89T
Aug 28
DIY Robocars via Twitter
Aug 24
DIY Robocars via Twitter
RT @gclue_akira: 柏の葉で走行させてるjetracerの中身 #instantNeRF #jetracer https://t.co/giVvuE4hP7
Jul 4
DIY Robocars via Twitter
Cool web-based self-driving simulator. Click save when the AI does the right thing https://github.com/pncsoares/self-driving-car
Jul 4
More…