Post · 2 min read· pp. 538–539

Remapping Motors with Resource Command

Necessity for swapping/shifting/rotating motor positions rises from time to time. Before v3.1, we had to either use long wires between FC and ESC to retain the original mapping (which make the build messy) or use a custom mix to change how each motor contributes to attitude adjustment.

With 3.1, we can easily modify motor mappings with resource CLI command. See Betaflight resource mapping for descriptions of this command.

####Videos: A Joshua Bardwell Video: Resource Remapping- No more Custom Motor Mixer Project Blue Falcon video: Find Bad ESC output Pin and Remap Motors

A Blue Falcon video: Remap Motors In Betaflight (damaged pins fix)

###Examples:

Here, the most common case of "rotating FC or PDB" is taken as an example.

Suppose you have a board with motor numbers labeled like this:

text
     FRONT
4            2

3            1
     BACK

and for some reason, you want to rotate the board 90-degrees clock wise, ending up with

text
     FRONT
3            4

1            2
     BACK

Let's fix this.

  1. Record the current motor mapping

Type resource list to find out the original mapping.

text
# resource list
...
A06: MOTOR 1
A07: MOTOR 2
A11: MOTOR 3
A12: MOTOR 4
...
  1. Write a diagram with the original pin to motor mapping.
text
       FRONT
4(A12)       2(A7)

3(A11)       1(A6)
       BACK
  1. Rotate the drawing clock wise 90-degrees.
text
       FRONT
3(A11)       4(A12)

1(A6)        2(A7)
       BACK
  1. Remove the old motor position label.
text
       FRONT
A11            A12

A6             A7
       BACK

This is your actual MCU pin position.

  1. Assign new motor position label to the MCU pins.
text
       FRONT
4(A11)       2(A12)

3(A6)        1(A7)
       BACK

This is your new mapping.

  1. The cli resource command for this mapping is:
text
resource motor 1 a7
resource motor 2 a12
resource motor 3 a6
resource motor 4 a11
save

As you enter these commands, you will be seeing error messages in the form * ERROR * X also used by MOTOR Y. The overlapping mapping is transitional, and you will be ending up with clean mapping at the end. If you don't like the error messages, you can clear the old mapping by following typing following commands prior to new mapping.

text
resource motor 1 none
resource motor 2 none
resource motor 3 none
resource motor 4 none

This is just an example. Please work on your case on your own and verify the results before flying.

Have fun!!!