Frequency Sensor - rotorflight/rotorflight GitHub Wiki

❗ This page is outdated

Rotorflight Wiki is replaced by www.rotorflight.org.


The Frequency Sensor is a feature for acquiring the motor RPM.

Typically it is used when the RPM is not available via ESC telemetry. Only BLHeli_32, some BLHeli_S and APD F3 ESCs support Dshot/KISS telemetry, so this feature is needed with a wide range of traditional ESCs.

The RPM signal is used in multiple places in the FC, e.g. in the PID control, the governor and the RPM-filter. If these features are not needed, then there is no need for the frequency sensor either.

An electrical frequency signal is provided by some ESCs, e.g. Hobbywing with the "yellow" wire. Or it can come from an RPM sensor, which is converting the motor three-phase voltages into a frequency signal - e.g. Hobbywing RPM sensor. Please refer to your ESC's or sensor's manuals how to connect them correctly.

Note about the Hobbywing RPM sensor: it's safest to power it with 3.3V, as the input voltage of the sensor is also the output voltage of the RPM signal it generates. All inputs on a STM32 MCU tolerate 3.3V, and some will also accept 5V. But if you're using a 8.4V BEC to power the sensor, you'll likely damage the MCU.

Up to two frequency sensors are supported, for acquiring motor #1 and motor #2 speed.

If both Frequency Sensor and telemetry RPM signals are available, the Frequency Sensor has precedence.

Configuration

First, a pin must be configured for frequency sensor use. The pin must be connected to a timer with exclusive access. In other words, there must be a free timer, not used by anything else, and one of its positive channels must be available on a pin that is connected to the FC's solder pads. Negative channels, like CH3N, can't be used as inputs. Once we know which timer and pin we can use, it can be configured for frequency sensor use. This can be done via the Custom defaults remapping spreadsheet or by reading through the STM32 manual for your processor.

In this example, we have chosen to use the LED_STRIP pin as our frequency input. We see there is only one option (Timer1) on AF1. We can use this pin but must not allocate any of the Servos or Motors to Timer1. Only the motor pins share this timer so we can choose either AF2 (timer3) or AF3 (timer8).

The lines which configure the frequency signal

resource LED_STRIP 1 NONE											
resource Freq  1 A09											
timer A09 AF1 # Freq - pin A09: TIM1 CH2 (AF1)
dma pin A09 0 # Freq - 0: DMA2 Stream 6 Channel 0

Then the frequency sensor can be turned ON with the feature flag located on the Configuration tab.

Please note -

The spreadsheet is currently only built to add one frequency sensor. If using a motorised tail you will need to use the spreadsheet twice to obtain the 4 lines as shown above for each input. On the tail motor change the resource Freq 1 to resource Freq 2

⚠️ **GitHub.com Fallback** ⚠️