Betaflight — custom motor ordering made easy^2 [3.1.x]

Disclosure: This post may contain affiliate links, meaning I get a commission if you decide to make a purchase through my links, at no cost to you.

By | February 22, 2017

Have you ever assembled your quadcopter motors in the wrong order? I am quite sure you did! I am going to show you how to swap motors in betaflight without the need of a soldering iron! This tutorial is based on betaflight 3.1 and betaflight configurator 1.9.1.

On older betaflight versions you had to set up a custom mixer. This was failure prone, annoying and messed up the blackbox view. I recently wrote a tutorial that generated the custom mixer commands for you (see this blog post). It did not take long and some of the betaflight core developer people suggested that I should use the new resource remapping feature. As of writing the old tutorial I had never used it before. During the assembly of the pepperF1SH for the world tour I gave the resource remapping a try — and I love it!

So what is this remapping feature? Let me explain you some basics how the flight controller works. The processor on every flight controller has a lot of pins. They are grouped into ports and pin numbers. The motor output signals are connected to a number of special pins. The firmware on your flight controller has a configuration file that tells betaflight how to send a given thrust signal to a special motor. In the good old days this was set up and fixed during compilation of the firmware hex file. This has changed, nowadays you can modify this assignment at runtime!

First of all: remove the propellers! Fire up the betaflight configurator and start the CLI interface. Now enter “resource” into the command line and press enter. You should see something similar to this:

resource BEEPER 1 B02
resource MOTOR 1 B08
resource MOTOR 2 B09
resource MOTOR 3 A03
resource MOTOR 4 A02
resource LED_STRIP 1 A08

But what does this tell you? It is not as complicated as it sounds. Let’s have a look at the line “resource MOTOR 1 B08”. This tells you that the motor 1 output is connected to the processors’ port B and on pin 8 (B08). The motor 3 is connected to port A on pin 3 (A03). Now comes the fun part. Let’s assume we want to swap motor 1 and 3. With this new feature this is a piece of cake. We can swap those outputs by exchanging motor 1 and 3 by entering the following into the CLI (note how i swapped motor 1 and motor 3).

resource MOTOR 3 B08
resource MOTOR 2 B09
resource MOTOR 1 A03
resource MOTOR 4 A02
save

That’s it! This is really convenient… If you want to swap more than one motor you can exchange as many of the assignments as you like. If some of your motors spin in the wrong direction you can for example use the blheli configurator chrome app to set those motor direction to reversed.

Now test your modification. With the propellers still removed arm your quad and move it around. When you tilt the quad to one side, the motors on that should start to spin faster. Repeat it with all four directions and verify the correct operation before taking your quad for a ride.

2 thoughts on “Betaflight — custom motor ordering made easy^2 [3.1.x]

  1. Jacob

    Thank you I have an old 250 with a dud motor 1 port on my naze32. I spend my time with the mixer and failed with a quad that just flips on take off. I was going to recompile the hex file or do a rebuild but this will save me a lot of time.

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *