> For the complete documentation index, see [llms.txt](https://taiphoon-com.gitbook.io/taiphoon.com-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://taiphoon-com.gitbook.io/taiphoon.com-docs/firmware/px4/first-setup/motor-setup.md). Agents can also search and read this documentation through its [MCP server](https://taiphoon-com.gitbook.io/taiphoon.com-docs/~gitbook/mcp).

# 設定馬達輸出與測試

指定馬達輸出與通訊協定後，逐一測試馬達的位置與轉向。依電子調速器（ESC）使用的協定，選擇下方的 **DShot** 或 **PWM** 分頁。

{% hint style="danger" %}
測試前務必卸下螺旋槳。
{% endhint %}

{% stepper %}
{% step %}

### 確認馬達配置

在 **Vehicle Configuration** 左側點 **Actuators**。**Geometry: Multirotor** 列出各馬達的位置與轉向（**Direction CCW** 勾選表示逆時針），下方為機體俯視圖，x 軸朝向機頭。以 Quadrotor x 為例：

| 馬達      | 位置 | 轉向       |
| ------- | -- | -------- |
| Motor 1 | 右前 | 逆時針（CCW） |
| Motor 2 | 左後 | 逆時針（CCW） |
| Motor 3 | 左前 | 順時針（CW）  |
| Motor 4 | 右後 | 順時針（CW）  |

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2FmIbIreoDqaISCka4bu7B%2Fpx4-motor-01-actuators.png?alt=media&amp;token=3a86ec44-737a-4837-8265-16c31fd9917d" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 指定馬達輸出與協定

在 **Actuator Outputs** 的 **PWM MAIN** 分頁，將 **MAIN 1**～**MAIN 4** 的 **Function** 依序設為 **Motor 1**～**Motor 4**。全部指定後，紅字提示 `One or more actuator still needs to be assigned to an output.` 會消失。

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2Fb4Ywu8bSqcwK7GSvLyfg%2Fpx4-motor-02-function.png?alt=media&amp;token=4ff0866d-3686-411c-af4c-75f1c9141ecd" alt=""><figcaption></figcaption></figure>

再依 ESC 使用的協定設定 **MAIN 1-4**：

{% tabs %}
{% tab title="DShot" %}
將 **MAIN 1-4** 的協定下拉選單由 `PWM 400 Hz` 改為 DShot（例如 **DShot300**）。改為 DShot 後只剩 **Function** 與 **Rev Range** 欄位，不需要設定 Disarmed、Minimum、Maximum。

出現 `Vehicle reboot required for changes to take effect.` 時按 **Ok**，再依訊息從工具列的主要狀態指示重新啟動飛控。

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2F9rtPODTgHFNfuTE675eM%2Fpx4-motor-08-dshot300.png?alt=media&amp;token=d1a43d97-bd97-47fd-b965-b0f7883eddf1" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="PWM" %}
**MAIN 1-4** 的協定維持 `PWM 400 Hz`。使用 PWM 時，PX4 建議先完成 [ESC 校正](https://docs.px4.io/main/en/advanced_config/esc_calibration.html)。

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2FUSjL71OamkOANSxFSyIJ%2Fpx4-motor-03-assigned.png?alt=media&amp;token=f1ec3aaa-0ac0-4bb6-8452-5e972c267fc9" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
{% endstep %}

{% step %}

### 測試馬達

確認已卸下螺旋槳後，打開 **Actuator Testing** 的開關（**Propellers are removed - Enable sliders**），文字會變成 **Careful: Actuator sliders are enabled**。逐一稍微推動 **Motor 1**～**Motor 4** 的滑桿，確認轉動的馬達位置與轉向符合上表。測試完成後將滑桿拉回最低，再關閉開關。

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2F3PFOjfMATu6tcO3KyFpw%2Fpx4-motor-04-sliders.png?alt=media&amp;token=a4092368-3594-4784-8e9a-b40cd8aa4223" alt=""><figcaption></figcaption></figure>

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2Fg0wtw2eTjtBdAQICNHlY%2Fpx4-motor-05-motor1.png?alt=media&amp;token=79dc7385-9a74-430a-8233-3ee032aa598b" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 馬達順序錯誤時

按 **Identify & Assign Motors**，確認視窗（Warning: Only proceed if you removed all propellers.）按 **是**。每顆馬達會以 15% 推力轉動 0.5 秒，在配置圖上點選剛才轉動的馬達；重複到所有馬達完成後，輸出功能會依點選順序自動重新指定。需要再看一次時按 **Spin Motor Again**，要中止時按 **Abort**。

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2FkPCTj522N2g0yRxCqMwk%2Fpx4-motor-06-identify.png?alt=media&amp;token=d50b3f82-a714-4521-8668-6856aa8af09b" alt=""><figcaption></figcaption></figure>

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2FtES6coKGiqRQ4tQZYWxi%2Fpx4-motor-07-click.png?alt=media&amp;token=2919be01-a445-431c-b0da-a2069d70e7dc" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### 馬達轉向錯誤時

{% tabs %}
{% tab title="DShot" %}
使用 DShot 時可直接在 QGC 設定轉向，不需要使用 AM32 Configurator。在 **Actuator Testing** 下方按 **Set Spin Direction 1** 或 **Set Spin Direction 2**，再選擇轉向錯誤的馬達（**Motor 1**～**Motor 4**）。轉向設定會永久保存，按下後畫面不會顯示結果訊息。

QGC 無法讀取馬達目前的轉向，設定後重新測試該馬達；若轉向仍不正確，改用另一個選項。

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2FVkfhPHDGdqaloZecW7fS%2Fpx4-motor-09-spin-direction-buttons.png?alt=media&amp;token=f2136292-4e64-4e04-8726-407e917cedff" alt=""><figcaption></figcaption></figure>

<figure><img src="https://401369577-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FmvFqg0h5Ob1pRXspm7Yi%2Fuploads%2FoizzC7cshIfy97RWbcxO%2Fpx4-motor-10-spin-direction-menu.png?alt=media&amp;token=46b54831-0ba8-4acf-8ed7-0037252d2f68" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="PWM" %}
對調該馬達三條馬達線中的任意兩條；使用 AM32 ESC 時，也可以在 [AM32參數](https://taiphoon-com.gitbook.io/taiphoon.com-docs/esc-firmware/am32/am32-parameters.md)的轉向設定中反轉該馬達。調整後重新測試。
{% endtab %}
{% endtabs %}
{% endstep %}
{% endstepper %}
