Remapping Outputs¶
Rotorflight flight controllers (Radiomaster Nexus, FlyDragon, Flywing, Matek G474, GooSky, FrSky 007 ...) come with their servo, motor and RPM outputs already set up. If you have one of those, skip this page -- unless you want to repurpose an output, for example to add a servo.
Betaflight flight controllers are built for multirotors: four or more motor outputs, no servos. To fly a helicopter, some of those pads have to be remapped -- reassigned to servos, a motor and an RPM input.
What a helicopter needs¶
| Function | Typical pin |
|---|---|
| Motor 1 | Main ESC (or the throttle servo on a nitro). |
| Servos 1-3 | Cyclic servos. |
| Servo 4 | Tail servo -- or Motor 2 for a motorised tail. |
| Frequency input 1 | RPM signal from the ESC or an RPM sensor. |
Rules for a working layout¶
The STM32's outputs are driven by hardware timers, and a pin can only do what its timer allows:
- Servos on the same timer share one update rate. Put the cyclic servos together on one timer. Give a narrow-band tail servo (760 µs, 560 Hz) a timer of its own.
- The main motor needs a timer of its own, not shared with servos.
- A frequency (RPM) input needs a timer used by nothing else, and a
positive timer channel (not
CHxN). 32-bit timers -- TIM2 and TIM5 -- are best. Two frequency inputs can share one timer. - Motors and servos must be numbered without gaps: S1, S2, S3, S4 -- not S1, S2, S4. The flight controller stops at the first missing output.
With the Remap FC tab (2.4)¶
The Remap FC tab does all of this for you. Click Read FC, click a pin, and choose what it should do; the Configurator works out timers and DMA, warns about anything that can't work, and suggests fixes.
With presets¶
The Presets tab has REMAPPING presets for many flight controllers: search for your board's name.
With the CLI¶
On 2.3, or for boards the Remap FC tab doesn't support, the remapping is a
set of CLI commands that assign pins (resource), timers (timer) and DMA
(dma). The
Rotorflight remapping spreadsheet
generates them from your board's Betaflight target:
- Copy your board's configuration from the Betaflight target repository,
from the
board_nameline down, into the spreadsheet. - Assign motors, servos and the frequency input to pins, choosing timers that follow the rules above.
- Copy the generated commands, paste them into the
CLI and type
save.
For example, to use the LED strip pad (A09, TIM1) as the RPM input:
resource LED_STRIP 1 NONE
resource FREQ 1 A09
timer A09 AF1
dma pin A09 0
TIM1 then can't be used by any motor or servo.
See Betaflight FC (DIY) for more on choosing and wiring a Betaflight board.
Adding an extra servo¶
An extra servo -- retracts, lights, a winch or a camera on a scale helicopter -- can be driven straight from a spare radio channel.
With S.BUS output or F.Bus master set up, bus servos S9-S26 can each be set to Source: RX on the Servos tab. The servo then passes a receiver channel straight through: S9 follows channel 1, S10 channel 2, and so on, so S17-S26 follow channels 9-18 (which is how they're set by default). No remapping needed.
- Give the servo a pin: assign the next free servo number (e.g. S5)
to a spare pad -- with the Remap FC tab, or with
resource SERVO 5 <pin>in the CLI. If it shares a timer with another servo, it also shares its update rate. -
Add a mixer rule that drives it from the radio channel. For AUX3 driving servo 5, in the CLI:
mixer rule 10 set AUX3 S5 1000 0 save1000is 100% weight and0is the offset. Use a rule number that isn't already used --mixer rulelists them. -
Set the servo's centre, limits and rate on the Servos tab.