# Ardupilot setup for power boards

## Quadcopter setup (Default)

### ESC settings

#### Motor order

It is based on the basic Ardupilot settings for the motor map

* Ardupilot motor ID (X-frame) with Powerboard
  * A,B,C,D are for the needs of the GCS software
  * M1..M4 are servo functions for ESC control
  * ESC0..ESC3 are ESC addresses on the Powerboard

```
      D(M3)                  A(M1)
(ESC Addr: 0) +        + (ESC Addr: 3)
               \      /
                \    /
                 \/\/
                 |  |
                 |__|
                 /  \
                /    \
               /      \
(ESC Addr: 1) +        + (ESC Addr: 2)
      C(M2)                  B(M4)
```

* The addresses for the ESC are linked to the *SERVOx\_FUNCTION* parameter
  * ESC Addr: 0 -> *SERVO1\_FUNCTION*
  * ESC Addr: 1 -> *SERVO2\_FUNCTION*
  * ESC Addr: 2 -> *SERVO3\_FUNCTION*
  * ESC Addr: 3 -> *SERVO4\_FUNCTION*
  * In the case of another frame, the procedure is analogous
* Powerboard ESC map in Ardupilot (X-frame)
  * `SERVO1_FUNCTION` = 35 (*Motor3*)
  * `SERVO2_FUNCTION` = 34 (*Motor2*)
  * `SERVO3_FUNCTION` = 36 (*Motor4*)
  * `SERVO4_FUNCTION` = 33 (*Motor1*)

#### CAN bus

* Necessarily set drivers to display additional parameters (reboot Ardupilot)
* Setting up virtual drivers for physical ports
  * In the case of the same setting, the input is redundant
  * PowerBoard for ESC connection has only physical port CAN2
  * `CAN_P1_DRIVER` = 2
  * `CAN_P2_DRIVER` = 2
* Set CAN protocol for virtual driver
  * `CAN_D2_PROTOCOL` = 1
  * `CAN_D2_UC_NODE`
    * ID device on CAN bus
    * Use default (*Recommanded*)
    * Forbidden IDs: 50-53 (used by PowerBoard)
  * `CAN_D2_UC_ESC_BM` = 15
    * Enabling individual ESC
    * Value = 15 => 4 motors (ESC1 - ESC4)

#### PWM range

* PWM output
  * Type
    * `MOT_PWM_TYPE` = 0 (*Normal*)
      * Output has adjusted range
      * Usage range 1000-2000us (*Set by param lower*)
  * Min and max PWM
    * `MOT_PWM_MIN` = 1000 (*Match with settings in AMC Manager*)
      * Represents lower limit
    * `MOT_PWM_MAX` = 2000 (*Match with settings in AMC Manager*)
      * Represents upper limit
* PWM level for ESC control
  * Dead-zone of ESC = 50 us (*Match with settings in AMC Manager*)
  * `MOT_SPIN_ARM` = 0.07
    * Motor speed when to be armed
    * Use dead-zone from ESC
    * Equals (the percentage dead-zone from pwm range + 2%) / 100
  * `MOT_SPIN_MIN` = 0.1
    * Lower limit when motor never stop spinning
    * At least 0.03 higher than `MOTOR_SPIN_ARM`
  * `MOTOR_SPIN_MAX` = 1.0
    * Equals value which generally produces no additional thrust
* Thrust correction
  * `MOT_THST_EXPO` = 0.8
    * The value depended on the ESC, which linearizes the output

### Battery settings

#### Monitor

* Use CAN settings from \[ESC settings]\(## CAN bus)
* `BATT_MONITOR` = 8 (*UAVCan*)

## Octocopter setup

### ESC setting (changes compared to default)

#### Motor order

**ESC links to the \_SERVOx\_FUNCTION :**\_

* **.Power board main**
  * ESC0 (Motor 1 connector) = SERVO1\_FUNCTION
  * ESC1 (Motor 2 connector) = SERVO2\_FUNCTION
  * ESC2 (Motor 3 connector) = SERVO3\_FUNCTION
  * ESC3 (Motor 4 connector) = SERVO4\_FUNCTION
* **.Power board secondary**
  * ESC0 (Motor 1 connector) = SERVO5\_FUNCTION
  * ESC1 (Motor 2 connector) = SERVO6\_FUNCTION
  * ESC2 (Motor 3 connector) = SERVO7\_FUNCTION
  * ESC3 (Motor 4 connector) = SERVO8\_FUNCTION

{% hint style="info" %}
User needs to match servo output function numbers according to used configuration and frame type
{% endhint %}

#### CAN bus

* Set CAN protocol for virtual driver
  * `CAN_D2_UC_ESC_BM` = 255
    * Enabling individual ESC
    * Value = 255 => 8 motors (ESC1 - ESC8)

### Battery settings (changes compared to default)

#### Monitor

* `BATT_MONITOR` = 8
* `BATT_SERIAL_NUM` = 174
* `BATT2_MONITOR` = 8
* `BATT2_SERIAL_NUM` = 175
* `BATT2_VOLT_MULT` = 1
* `BATT2_VOLT_PIN` = -1
* `BATT2_CURR_PIN` = -1


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.airvolute.com/autopilots/dronecore-1/getting-started/ardupilot-setup-for-.power-board.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
