Hi,

I've been working for a couple of days on a remote controller for APM and after doing some extense research I'm still unable to figure out which is the proper set of instructions and parameter values for a GCS to arm/disarm my quadcopter.

There are some other threads with info on this matter but none of them is very specific and that is why I'd like to make a thread where we are very clear and organized. 

I went to a lot of posts but obvisously not all, so if this is a repeated and solved issue, please send me an answer via pm and delete the post if necessary.

INTRODUCTION

So far, I found that the arming parameters are:

  • ARMING_CHECK (set to 1 or -65)
  • ARMING_DIS_RUD (set to 0)
  • ARMING_REQUIRE (set to either 1 or 2)

quite possibly BRD_SAFETYENABLE is also involved but I'm not sure yet.

When I send the MAVLINK command to set these parameters I receive my ACK with the proper ACCEPTED value.

I've also read that some people perform a command sequence such as the following in order to take off:

  1. Set motors off
  2. Motors on at min for 2-5 seconds
  3. Take off (loiter and Alt_Hold with incresing alt) 

QUESTIONS

  1. Which are the parameters that must be set and to which values in order to ignore RC and star with telemetry only?
  2. Which is the set of commands that I must use in order to arm/disarm motors?
  3. Which is the set of commands that I must use in order to takeoff / land?

Thanks a lot for your help.

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

Join diydrones

Email me when people reply –

Replies

  • thank you

  • 2. Commands to arm / disarm motors

    Use the command_long message to arm and disarm. I'll expand below in C syntax

    command_long_send(target_system, //target_system is the ID of your mav.

                                   MAV_COMP_ID_SYSTEM_CONTROL, //you can hard code in 250 here.

                                                                               //Not certain why this is necesary but the copter looks for it

                                   MAV_CMD_COMPONENT_ARM_DISARM, //You can hard code in 400 here

                                                                               //tells the copter this is an arming / disarming command

                                  0, //this field is not used

                                  1, //sending a 1 here tells the copter to arm. Setting this to 0 would disarm

                                   0, 0, 0, 0, 0, 0); //the rest of the fields are unused

                                    

    3. Set of commands to takeoff / land

    To takeoff you can either have a mission scrip with includes a takeoff, or put the copter into loiter then immediately increase the altitude. To land you can either set the mode to RTL (will land at the place you armed the copter) or land mode (will land immediately at present location). Use the set mode command to change modes

    set_mode_send(target_system, //ID of your mav

                           1, //I think this field is ignored. I have a 1 here and can't figure out why

                           mode_number); //mode number options are below

    STABILIZE = 0
    ACRO = 1
    ALT_HOLD = 2
    AUTO = 3
    GUIDED = 4
    LOITER = 5
    RTL = 6
    CIRCLE = 7
    POSITION = 8
    LAND = 9
    OF_LOITER = 10
    TOY_A = 11
    TOY_M = 12

    • Hi Nate, how do you increase altitude? Forcing Rc inputs?

    • Overriding the throttle input to make the copter ascend will work but is imprecise.

      The autopilot can accept a set altitude command. I don't recall if it works in the current release or not. If it doesn't let me know and I can tell you how to fix it. To test if it works put your copter in loiter mode. In mission planner go to the flight data page -> actions tab. There is a change altitude button there. See if it can affect the altitude in loiter mode. If it does, you can request a new altitude through the mission item command.

      Send the mavlink mission item message. Set current = 3 (flag to only change altitude) options = 0 (don't use relative altitude) and alt = desired new altitude. All other parameters are not used.

    • THANKS A LOT! I will try this out today ASAP.

This reply was deleted.