SilF4ware

Supported Hardware

Flight Controller

Flight ControllerWeightNotesBoard PinoutSource
Omnibus3.2gImageBanggood
NOXE (first version)3.4gImage
NOXE v14.3guntestedImageBanggood
F4-XSD4.2gRCGroups PostImagext-xinte

Receiver Modules

The firmware uses the Bayang protocol

  • 8 digital aux channels
  • 2 analog aux channels
  • telemetry for battery voltage, packet count, PID tuning
  • low latency 5 ms packet period
  • autobind

via a SPI-connected XN297 or nRF24L01+ or nRF24L01+PA+LNA radio module.

ReceiverWeightNotesSource
NRF24 Mini0.5gHow to add an wire antennause “nrf24l01 mini” as search term (Banggood)
NRF24 PA+LNA (GT-24)1.1gHow to add an U.FL antennause “GT-24” as search term (Banggood)
XN297Can be harvested from toy TX like H101, H8, …
XN297 DIY PCBDIY PCB
XN297untestedBanggood

Configuration

Overview

Configuration TypeFilename
Main Configurationconfig.h
Battery Cell Countbattery.c
Receiver Modulesee radio_config.txt
DShot Driver Selectionhardware.h
PID Configuration
Basic PID Settingsconfig.h
PID Advanced Configurationpid.c
PID Level Mode Configurationangle_pid.c
DShot Driver Configuration
Bidirectional DShot (RPM Filter)drv_dshot_bidir.c
DMA DShotdrv_dshot_dma.c
Conventional DShotdrv_dshot.c

Basic Configuration

Receiver Module

The default configuration is setup for NRF24 modules. If using a NRF24 module with PA+LNA, it is recommended to adjust TX_POWER in config.h:

#define TX_POWER 1 // 0 .. 3 (use 1 when using an nRF24L01 PA+LNA module)

If using a XN297 module, see radio_config.txt for configuration notes.

DShot

Bidirectional DShot (RPM Filter) (default)

Make sure that the number of magnets on the motor bell is set correctly in drv_dshot_bidir.c:

#define MOTOR_POLE_COUNT 14 // usually on 22xx motors and above
// #define MOTOR_POLE_COUNT 12 // usually on 18xx motors and below

Other DShot Drivers

If you don’t want to use Bidirectional DShot, you need to choose another driver in hardware.h:

#define DSHOT_DMA_BIDIR // needed for RPM_FILTER, 4k loop frequency max
// #define DSHOT_DMA_DRIVER // conventional Dshot, consumes less cycles, works for 8k loop frequency
// #define DSHOT_DRIVER // delay version

In that case you also have to comment the RPM Filter in config.h:

//#define RPM_FILTER // requires DSHOT_DMA_BIDIR in hardware.h -- also ensure MOTOR_POLE_COUNT in drv_dshot_bidir.c is correct
//#define RPM_FILTER_HZ_MIN 100
//#define RPM_FILTER_2ND_HARMONIC false // note, that there are 12 notch filters (4 motors * 3 axes) per harmonic
//#define RPM_FILTER_3RD_HARMONIC true
//#define RPM_FILTER_Q 6 // -3dB bandwidth = f0 / Q -- but a higher Q also results in a longer settling time

2D/3D Flying

3D flying is enabled by default. If using a 2D setup, following changes are needed:

In the main config file (config.h):

//#define INVERTED_ENABLE
#define FN_INVERTED CH_OFF
//#define LEVEL_MODE_INVERTED_ENABLE // be careful when enabling this

In the DShot configuration file (e.g. drv_dshot_bidir.c when using RPM Filter):

// Enable this for 3D. The 'Motor Direction' setting in BLHeliSuite must be set to 'Bidirectional' (or 'Bidirectional Rev.') accordingly:
//#define BIDIRECTIONAL

Props in/out

Props out configuration is enabled by default:

// Invert yaw pid. Necessary when spinning props outwards.
#define INVERT_YAW_PID

If you are using Props in, just comment INVERT_YAW_PID to disable it:

// Invert yaw pid. Necessary when spinning props outwards.
//#define INVERT_YAW_PID

Rates

Default rates are very high, adjust them if needed:

// rate in deg/sec for acro mode
#define MAX_RATE 1800
#define MAX_RATEYAW 1800

Transmitter Configuration

Channel Mapping

By default, SilFware is setup for using Deviaton TX.

FunctionDefault Channel
Throttle Kill SwitchDEVO_CHAN_5
Inverted (3D) ModeDEVO_CHAN_6
LED onDEVO_CHAN_7
RatesDEVO_CHAN_9
Level ModeDEVO_CHAN_10
Motor BeepsDEVO_CHAN_12
Motors Test ModeCH_AUX1

If you are using OpenTX with Multiprotocol Module, you probably want to replace DEVO_CHAN_x with MULTI_CHAN_x, e.g.:

#define THROTTLE_KILL_SWITCH MULTI_CHAN_5

Jumper T-Lite / MPM / OpenTX

PID Display

As of March 2021, Jumper T-Lite comes with Multiprotocol Module Firmware v1.3.1.78 installed.

For displaying PID Values, MPM firmware with at least v1.3.2.30 is needed (quoting from the release notes):

If supported by the Silverware telemetry the PID values are appearing as sensors: AccX=P, AccY=I, AccZ=D (you can rename the sensors after the discovery)

For updating the MPM firmware, see the MULTI-Module Documentation.

RSSI

In config.h, comment this line:

//#define DISPLAY_MAX_USED_LOOP_TIME_INSTEAD_OF_RX_PACKETS

Devo TX

A Devo 7E build and model file which is able to display PID values can be found in this post. Note that it will only display PIDs set via gestures, not when set via analog aux channels.

Compiling & Flashing

It is recommended to use STM32CubeIDE for compiling SilF4ware. Keil uVision can also be used, but it produces some non-working binary when using lot’s of RAM. Change FFT_SIZE in fft.h to 2048 when using Keil. Flashing can be done with betaflight-configurator. After compiling, the target files can be found in the “Release” directory.

Using & Troubleshooting

Gestures

When you are used to use other silverware branches, please note that the gestures for PID tuning are swapped.

GestureFunction
LRUreboot flight controller
LRDswitch to DFU mode
LLUswitch to motors test mode
LLDexit motors test mode
UUUtoggle autobind flag (remember to save with DDD)
UDDswitch to the next PID column
UDUswitch to the next PID row
DDDsave configuration

PID Stick Tuning

PID_STICK_TUNING is a more comfortable alternative to PID_GESTURE_TUNING.

With the right stick the desired term is selected by moving and holding the stick to the corresponding position, while yaw stick movement changes its value. The rate of change is proportional to the yaw stick deflection, so coarse as well as fine changes are easy to make.

             |                 P  |  I
             |                    |
decrease ----+---- increase   ----+----
             |                    |
             |                 *  |  D

                             * next axis

See this demonstration video on YouTube.

Motors test mode

With default setup, when using LLU stick gesture (Left, Left, Up) SilF4ware switches into motor test mode (MOTORS_TO_THROTTLE). It can be used to verify that the configured motor order is correct, but also to check for bad/noisy props.

In motor test mode, push the stick in the corresponding direction, e.g. left up will make the motor spin which is configured as front left. LLD stick gesture (Left, Left, Down) turns this mode off again.

If you are used to other silverware branches, please note that with SilF4ware it is not needed to adjust the idle offset to make sure that only one motor spins.

LED Blink Codes

If SilF4ware fails to start and the FC LED flashes, the following table can be used for troubleshooting:

Flash countMeaning
2low battery at powerup - if enabled by config
3radio chip not detected
4Gyro not found
5clock, interrupts, systick, bad code
6flash write error
7ESC pins on more than two distinct GPIO ports

The blink codes are defined in usermain.c.

Advanced Features

Analog Aux Channels

The variables aux_analog[ 0 ] and aux_analog[ 1 ] hold a value between 0.0 and 2.0 which can be used in various places in the code. Per default they are used to tweak Kp and Kd respectively. This is done in pid.c:

#define AA_pidkp ( x <2 ? pdScaleValue * aux_analog[ 0 ] : 1.0f ) // Scale Kp and Kd only for roll and pitch.
#define AA_pidki 1.0f
#define AA_pidkd ( x <2 ? pdScaleValue * aux_analog[ 1 ] : 1.0f ) // Scale Kp and Kd only for roll and pitch.

If you want to use them for something else, change the define for AA_pidkp and AA_pidkd to look similar to the one for AA_pidki:

#define AA_pidkp 1.0f
#define AA_pidki 1.0f
#define AA_pidkd 1.0f

Now you could use aux_analog[ 0 ] and aux_analog[ 1 ] for example to tune the filter frequency by adding it to config.h like this:

#define GYRO_LPF_2ND_HZ_BASE 400 * aux_analog[ 0 ]
#define GYRO_LPF_2ND_HZ_MAX 400 * aux_analog[ 1 ]

Blackbox Logging

Blackbox logging is possible with an external logging device. See details here

Overclocking

It’s possible to run 8k loop frequency with bidirectional Dshot even on STM32F411 boards.

Overclocking:

In drv_time.h increase SYS_CLOCK_FREQ_MHZ to 150

8k loop frequency:

In config.h set LOOPTIME to 125

necessary for 8k loop:

In drv_dshot_bidir.c use DSHOT 600

References