hardware in the loop simulation for ardupilot mega

hi, am a working in hardware in the loop simulation (HILS) for ardupilot mega.

the purpose of my research is to ensure that ardupilot control system works well,before I do the actual flight test.
the difference between what I do with pre-existing HILS is a model airplane that I use is a model of state space and not a model of an aircraft that already exists on xplane.

The following is an overview of its design scheme:

3690927743?profile=originalI have managed to describe the control block diagram for stabilization control mode from ardupilotmega.pde coding ,and compare the results between simulation control dan ardupilot hardware control. the following picture is the block diagram for stabilization control mode in matlab/simulink :

3690928191?profile=original

inside logitudinal block

3690928213?profile=original

inside lateral directional block

3690928264?profile=original

now, the problem is:

I have difficulty in describing the existing control algorithms ardupilotmega.pde coding  to the form of control block diagram  for auto control mode, because I do not understand the coding of the overall ardupilotmega.pde

so far, for the auto control mode, this is what I have gained:

3690928312?profile=original

note:

-i a am still find a solution for make a gps simulation. now my idea is using yaw angle,speed,and inital position to estimate next position (some one help me)

-I am still trying to understand how the working process of waypoint tracking in ardupilotmega.pde coding , so that I can describe the block diagram in matlab / simulink. (some one help me)

new update (1 juni 2012)

this is my video off waypoint tracking simulation 

http://youtu.be/SdHOe_2Ryao

https://www.youtube.com/watch?v=SdHOe_2Ryao&feature=channel&list=UL

http://youtu.be/Th5mrblqSes

https://www.youtube.com/watch?v=Th5mrblqSes

 

thanks. 

sufendi


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

Join diydrones

Email me when people reply –

Replies

  • Hi Edmond,

    Did you ever figure this out? I am trying to do the same thing.

    Thanks,

    Eitan

    McGill U


    Edmond Leong said:

    Same question for the UDP data receiving from APM (pilot commands).  Question is how to configure the UDP block in Simulink in order to unpack the UDP data from APM? Thanks !

    3692854184?profile=original

  • hello sufendi, 

    i can't download your attachment file, can you send to my email?

    rizki633469@gmail.com

    best regards.

  • i can't download the attachments.could u help me .my email is 4201100117@csu.edu.cn i have read your paper ,thank you anyway

  • Hi Sufendi,

    I am trying to connect APM planner with Matlab like you did (using"UDP Receive" & "UDP Send" blocks)  but then I dont get any data, I just get this message:

    "Error in 'Conexion/UDP Receive': Received a fractional-length packet for the specified data type"

    Does APM planner send data to simulink by MAVlink protocol?

    I dont even know what datas are input/output in the APM planner.

  • Hi Sufendi,

    I know it's been a long time since you've completed this but I am undertaking a similar project but instead of using APM I will be utilising the Pixhawk. I still intend to model the dynamics of a system using matlab/simulink and will utilise a serial connection and mavlink up and down into matlab.

    It's been difficult to find good reference material on the subject. I am wondering If you have a copy of some of the simulation code that I can look at to get an idea of what you were trying to do. At this stage I am stuck trying to get the IMU off of the pixhawk. I have been able to read data off and display it on matlab using MEX but I can't seem to work out how I can use this to transfer to a s-code for use in simulink. Perhaps your work can shed some light.

    If you can I would really appreciate seeing anything you have that might help me. My email is 11306103@student.uts.edu.au

  • Hello. I study HILS . I have a lot of questions.

     1. How to communicate between the APM Planer(mission planer) and Simulink(matlab)?

     2. How to communicate between the Simulink and X-plane?

    I really wonder this problem, help you.

  • Hi All,

    This post on hardware in loop simulation with APM using Matlab seems exciting. I am also working on a similar problem. I am trying to do a Hardware in loop simulation with APM 2.6 connected to a mission planner. Instead of using flight gear or xplane, I am using Matlab to read in actuator commands from the mission planner through UDP and do simulation in Matlab and send back the sensor data to the mission planner.

    I have read in actuator commands send by the mission planner through UDP and I am currently working on sending the simulated data back to the mission planner. It would be of great help to me if someone could share the details of how this has been done. I am also unable to download the simulation file. Help in this regard would be greatly appreciated.

    Devaprakash

  • dear sufendi

    access is denied to this website

    may you pleas send it to my emai

    mfzavareh@gmail.com

    thanks alot

  • Dear sufendi

    Hello

    first let me to say thank you for the sharing your knowledge so others can use. and second let me apologize for the poor english I am writing in

    I am a beginer with electronic and APM. how ever i want to connect it the matlab in order to send my control commands and so on

    first of all i dont know how to do it ( connection for send and recive order). so I want you to help me in this field if is possible.

    having a model that i can run in my computer would so helpful for me.

    thank you so much

    MohSein

This reply was deleted.

Activity

DIY Robocars via Twitter
RT @TinkerGen_: "The Tinkergen MARK ($199) is my new favorite starter robocar. It’s got everything — computer vision, deep learning, sensor…
Nov 23
DIY Robocars via Twitter
Nov 23
DIY Robocars via Twitter
RT @roboton_io: Join our FREE Sumo Competition 🤖🏆 👉 https://roboton.io/ranking/vsc2020 #sumo #robot #edtech #competition #games4ed https://t.co/WOx…
Nov 16
DIY Drones via Twitter
First impressions of Tinkergen MARK robocar https://ift.tt/36IeZHc
Nov 16
DIY Robocars via Twitter
Our review of the @TinkerGen_ MARK robocar, which is the best on the market right now https://diyrobocars.com/2020/11/15/first-impressions-of-tinkergen-mark-robocar/ https://t.co/ENIlU5SfZ2
Nov 15
DIY Robocars via Twitter
RT @Ingmar_Stapel: I have now explained the OpenBot project in great detail on my blog with 12 articles step by step. I hope you enjoy read…
Nov 15
DIY Robocars via Twitter
RT @DAVGtech: This is a must attend. Click the link, follow link to read the story, sign up. #chaos2020 #digitalconnection #digitalworld ht…
Nov 15
DIY Robocars via Twitter
RT @a1k0n: Got a new chassis for outdoor races (hobbyking Quantum Vandal) but I totally didn't expect that it might cause problems for my g…
Nov 11
DIY Drones via Twitter
First impressions of the Intel OpenBot https://ift.tt/36qkVV4
Nov 10
DIY Robocars via Twitter
Nov 9
DIY Robocars via Twitter
Excellent use of cardboard instead of 3D printing! https://twitter.com/Ingmar_Stapel/status/1324960595318333441
Nov 7
DIY Robocars via Twitter
RT @chr1sa: We've got a record 50 teams competing in this month's @DIYRobocars @donkey_car virtual AI car race. Starting today at 10:00am…
Nov 7
DIY Robocars via Twitter
Nov 6
DIY Robocars via Twitter
RT @a1k0n: Car's view, using a fisheye camera. The ceiling light tracking algorithm gave me some ideas to improve ConeSLAM, and having grou…
Nov 5
DIY Robocars via Twitter
RT @a1k0n: To get ground truth I measured the rug, found the pixel coordinates of its corners, calibrated my phone camera with my standard…
Nov 5
DIY Robocars via Twitter
RT @a1k0n: @DIYRobocars is back in December, but outside. Time to reinvestigate ConeSLAM! I rigged up a quick and dirty ground-truth captur…
Nov 5
More…