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

  • anybody managed to figure out how to use the UDP block in MATLAB?

  • 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

  • I have few questions. I would really be thankful if you could answer them: 

    1. What port number did you assign in PORT: By default it is 9090 ? But so far i remember my Ports are COM1,COM2,...,COM5.

    2. In data type : there are  single,double,int8,...etc. Data from the C code is of type float. There is no float option. Which one should i select. 

    3. Is the Byte order BigEndian or LittleEndian ? 

    4. What is the appropriate sample time ? 

    5. Your simulink Block shows UDP data- Yaw1,Roll1 etc. Are those yaw,pitch and role or yaw,pitch and roll rate - p,q and r ? 

  • A question, how could we run APM planner and simulink at the same time ? Also how could we hook up Simulink Block with APM Planner software ? 

  • The control code used here is PID. A good and simple book to understand is http://www.amazon.com/Feedback-Control-Dynamic-Systems-Edition/dp/0.... It is a linear controller and works fine for Ardupilot UAVs. I have taken couple of classes at my university. So feel free to asks concepts . 

    Just a question, which Ardupilot you are using , APM 2.5 ? 

  • Hi Sufendi:

    I am recently building a HIL simulation environment on my APM 2.5 project and saw your post at 2012 while searching for information. I used MATLAB/Simulink to build my own aircraft 6DOF simulation model, instead of using existing models from FG or Xplane, for better accuracy.

    However, I couldn't find any information/manual on web to explain how to hook up APM with MATLAB/Simulink. I then saw your post and found it encouraging.  I hope you can share your experience with me on how to connect MATLAB/Simulink with APM.  Below describes what I intend to setup:

    1) APM 2.5 connects with RC controller through radio link.

    2) APM 2.5 provides control output (throttle, elevator, aileron, rudder), either in manual, stabilizer, or other modes.

    3) MATLAB/Simuilink takes control outputs (from APM 2.5) as model inputs and then run the predefined 6DOF nonlinear model to generate aircraft full state outputs (p,q,r,pitch,roll,yaw, gps, etc.)

    4) Model outputs from MATLAB/Simulink are fed back to APM 2.5.  APM will perform internal control algorithm to calculate next state of control outputs (if in stabilizer or other auto mode).  All state outputs are shown on Mission planner. 

    5) MATLAB/Simulink model outputs send to FG for visualization. (PS: FG is ONLY used to visualize outputs from MATLAB/Simulink.  FG itself does not simulate anything.  MATLAB already builds an interface with FG for this purpose).

    Please advise.

    Edmond

  • here is the file

    simulasi.rar

    https://storage.ning.com/topology/rest/1.0/file/get/3692633508?profile=original
  • i fine this... http://www.control.isy.liu.se/research/reports/2011/2996.pdf 

    http://www.control.isy.liu.se/research/reports/2011/2996.pdf
This reply was deleted.

Activity