Developer

ArduCopter in action: Testing the QuadCopter (HIL mode) on X-Plane v9

Here a video a the ArduMega board (2560 or 1280) with the firmware ArduCopter v2.1.1b (JLN update for X-Plane) connected on the X-Plane simulator throught the APM Planner in HIL mode. The QuadCopter QRO has been modelized for X-Plane v9.0 (or greater) so as get a closest replication of a true QuadCopter UAV.

This is a very good method for testing all the features of the ArduCopter firmware. For conducting a such test, only an ArduMega board (APM1280, APM2560, APM2) is used, no IMU shield or sensor are required here...


Setup:

- Receiver: Turnigy 9X8C v2 connected to the APM board

- Transmitter: Turnigy 9x

- APM planner v1.1.1x

- ArduMega board (APM v1 or APM v2)

- firmware ArduCopter v2.x.x + the JLN mod for X-Plane

- Software: X-Plane v9 or greater

- QRO_X: the quadcopter model (by JLN) for X-Plane

 
More infos at:

http://diydrones.com/profile/JeanLouisNaudin

E-mail me when people leave their comments –

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

Join diydrones

Comments

  • Developer

    Here a simple test of the RTL + AUTO LANDING mode with the firmware ArduCopter v2.1.1 R8 set in HIL mode on Xplane v9.70 through the APM Mission Planner. When the RTL (Return To Launch) is activated by the pilot (or here in this test by a script sent on the ground station), the quadcopter return itself above the landing point, wait 20 sec, then LAND automaticaly. The motors are stopped by the pilot (or by the script in this test).

    Regards, Jean-Louis

  • instead of crash subroutines, maybe post "un"-planned landing subroutines... :)

  • I ve been thinking though... "while cs.alt < 75:   Script.Sleep(50)" seems a bit generic, and with no error checking

    How about something like a countdown self check list

    (aka go no go pass at the systems... like nasa)

    life support (go) systems (go) engines (go) optical flow sensors (go) props spinning (go), and sensors say the craft is upright, not flipping over and/or engaging crash subroutines.

    etc...

  • Developer

    The RTL + AUTO LANDING is now working in HIL simulation on X-Plane with the ArduCopter v2.1.1r7b.

    I have done some importants fix about the auto landing feature. Here a video of the test of the firmware ArduCopter v2.1.1 R7b (JLN updated) about the RTL + AUTO Landing.

    The test has been done in HIL mode on X-Plane v9.70 through the Mission Planner v1.1.18 with a script.

    You may download the firmware v2.1.1r7b with my fix tested in the video above HERE

    Please, this an alpha version of the v2.1.1r7b and the RTL + Auto landing has been only tested in HIL mode, not yet in the real world... I shall conduct a real test flight as soon as the weather will be fine...

    Regards, Jean-Louis

  • Developer

    Hello Nicolas,

    Yes of course, as pointed in my tutorial, you may download a ready set of the firmware v2.1.1 R6 for the test in HIL mode on Xplane v9.70 HERE, you need also to download the starter_pack HERE.

    More infos about the installation and the use of the HIL test in the tuto. Happy simulation...

    Regards,

    Jean-Louis

     

  • Great work! Thanks, Jean-Louis!

    Would it be hard to have the current official/stable firmware (2.1.0 Alpha at the moment as shown on the APM planner) ready set for XPlane in HIL mode ?

  • @Jean that is awesome :) thanks very much

  • Developer

    You will find a full TUTORIAL for testing the ArduCopter v2.x.x firmware in HIL mode with the X-Plane simulator at:

    http://code.google.com/p/ardupilotdev/wiki/ArduCopter

    Regards,

    Jean-Louis

  • Developer

    Hello Darren,

    Woow, this is a very good idea to use the APM planner scripting to control the quadcopter in HIL mode. So, this is a very cheap setup for testing. I have tested you script above and it works very well. I have just added some spaces to set the block for the while condition, this avoid a script run error. I have also changed the radio setup and updated the param file for the radio setup.

    The two files (script + param) can be downloaded HERE

    Below your script which works with the QRO_X  for me on HIL mode with X-Plane v9.70:

    -------- Start ------

    print 'Start Script'
    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(3,1000,True)
    Script.SendRC(4,1500,True)
    Script.SendRC(5,1933,True) # Stabilize - Mode 6

    Script.Sleep(1000)

    while cs.lat == 0:
      print 'Waiting for GPS'
      Script.Sleep(1000)
    print 'Got GPS'

    Script.Sleep(1000)

    Script.SendRC(4,2000,True)
    cs.messages.Clear()
    Script.WaitFor('ARMING MOTORS',30000)
    print 'Motors Armed!'
    Script.SendRC(4,1500,True)

    Script.Sleep(1000)

    print 'Takeoff'
    Script.SendRC(4,1500,True)
    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(3,1700,True)

    while cs.alt < 75:
      Script.Sleep(50)

    Script.SendRC(5,1515,True) # acro - Mode 3
    Script.SendRC(1,2000,True) # roll
    Script.Sleep(5)
    Script.SendRC(3,1370,True) # throttle

    while cs.roll > -45: # top hald 0 - 180
      Script.Sleep(5)
    while cs.roll < -45: # -180 - -45
    Script.Sleep(5)
    Script.SendRC(1,1500,True) # roll
    Script.SendRC(2,1500,True) # pitch
    Script.SendRC(5,1291,True) # RTL - Mode 2
    Script.SendRC(3,1500,True) # throttle for RTL

    while cs.alt > 45:
      Script.Sleep(5)

    Script.SendRC(5,1466,True) # Loiter
    Script.Sleep(1200)
    Script.SendRC(3,1350,True) # throttle back to land

    while cs.alt > 0.1:
      Script.Sleep(5)

    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(5,1000,True) # Stabilize
    Script.SendRC(3,1000,True)
    Script.SendRC(4,1000,True)
    cs.messages.Clear()
    Script.WaitFor('DISARMING MOTORS',30000)

    print 'Roll complete'
    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(3,1000,True)
    Script.SendRC(4,1500,True)
    Script.SendRC(5,1000,True)

    ---- end ----

    Good work Darren,

    Regards, Jean-Louis

  • This is so fun, its makin me crazy... :)

    Been playing at using a 1280 with no Rx or Joystick. but yet completing mission scripting.

    FYI, I was able to create a Script that can I can reproduce most of the time.

    The mission is to arm motors, take off, reach alt, go acro, roll over, initiate RTL and stabilization modes, and land at home ( nicely! ), finally disengage motors, and finish the script.

    This is with Xplane 9.7, AC alpha 2.1.1r5, and MP 1.1.17.

    Here is the mission file im using.

    To use just:

    upload 2.1.1.r5 to any APM

    use CLI to do reset and erase (just to be safe, start blank)

    use Mission planner setup to set modes as shown below (radio/joystick isnt used, so calibration is irrevelent) after applying AC211r5_def_JLN.param.!

    Flight Mode 1 - Stabilize

    Flight Mode 2 - Loiter

    Flight Mode 3 - Stabilize

    Flight Mode 4 - Acro

    Flight Mode 5 - Stabilize

    Flight Mode 6 - RTL

    (sorry, just going by what worked for me, you can modify as needed)

     

    Just copy and paste the script then close and choose to run it.

     

    Dont beat me up if it doesnt go right all the time... but so far so good here with trial/errors :)

    Here is the script: (hope this pastes in ok; if not I'll upload as a file and edit the post)

     

    -------------- Start ---------------

    print 'Start Script'
    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(3,1000,True)
    Script.SendRC(4,1500,True)
    Script.SendRC(5,1000,True)

    Script.Sleep(1000)

    while cs.lat == 0:
    print 'Waiting for GPS'
    Script.Sleep(1000)
    print 'Got GPS'

    Script.Sleep(1000)

    Script.SendRC(4,2000,True)
    cs.messages.Clear()
    Script.WaitFor('ARMING MOTORS',30000)
    print 'Motors Armed!'
    Script.SendRC(4,1500,True)

    Script.Sleep(1000)

    print 'Takeoff'
    Script.SendRC(4,1500,True)
    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(3,1700,True)
    while cs.alt < 75:
    Script.Sleep(50)

    Script.SendRC(5,1500,True) # acro - Mode 3
    Script.SendRC(1,2000,True) # roll
    Script.Sleep(5)
    Script.SendRC(3,1370,True) # throttle
    while cs.roll > -45: # top hald 0 - 180
    Script.Sleep(5)
    while cs.roll < -45: # -180 - -45
    Script.Sleep(5)
    Script.SendRC(1,1500,True) # roll
    Script.SendRC(2,1500,True) # pitch
    Script.SendRC(5,2000,True) # RTL - Mode 6
    Script.SendRC(3,1500,True) # throttle for RTL

    while cs.alt > 45:
    Script.Sleep(5)

    Script.SendRC(5,1250,True) # Loiter
    Script.Sleep(1200)
    Script.SendRC(3,1350,True) # throttle back to land

    while cs.alt > 0.1:
    Script.Sleep(5)

    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(5,1000,True) # Stabilize
    Script.SendRC(3,1000,True)
    Script.SendRC(4,1000,True)
    cs.messages.Clear()
    Script.WaitFor('DISARMING MOTORS',30000)

    print 'Roll complete'
    Script.SendRC(1,1500,True)
    Script.SendRC(2,1500,True)
    Script.SendRC(3,1000,True)
    Script.SendRC(4,1500,True)
    Script.SendRC(5,1000,True)

    -------------- End ---------------

This reply was deleted.