CLI Variables

DTFUHF edited this page Dec 8, 2014 · 30 revisions


There are 2 groups of settings:

  • Global setting affecting things like hardware, receiver, ESC outputs, etc..
  • Profile setting affecting things like PID, deadbands, servo limits, etc. Which can be different between the 3 distinct configurable flying profiles.
NOTE: These settings always describe LATEST firmware source release, and do not necessarily reflect features of pre-built firmware images.

Global settings

emf_avoidance Default value is 0 for 72MHz processor speed. Setting this to 1 increases the processor speed, to move the 6th harmonic away from 432MHz.
looptime This is the main loop time (in us). Changing this affects PID effect. Default of 3500us/285Hz should work for everyone. Setting it to zero does not limit loop time, so it will go as fast as possible (about 750us/1.3kHz) in latest builds.
midrc This is an important number to set in order to avoid trimming receiver/transmitter. Most standard receivers will have this at 1500, however Futaba transmitters will need this set to 1520. A way to find out if this needs to be changed, is to clear all trim/subtrim on transmitter, and connect to GUI. Note the value most channels idle at - this should be the number to choose. Once midrc is set, use subtrim on transmitter to make sure all channels (except throttle of course) are centered at midrc value.
rssi_aux_channel read PWM (1000..2000us) RSSI value from a given AUX channel. This is used for OSD when transmitting baseflight internal RSSI value. Note that AUX channels are numbered 1-4 and are mapped to RC channels using the map CLI command.
minthrottle, maxthrottle These are min/max values (in us) that are sent to esc when armed. Defaults of 1150/1850 are OK for everyone, for use with AfroESC, they could be set to 1064/1864.
mincheck, maxcheck These are min/max values (in us) which, when a channel is smaller (min) or larger (max) than the value will activate various RC commands, such as arming, or stick configuration. Normally, every RC channel should be set so that min = 1000us, max = 2000us. On most transmitters this usually means 125% endpoints. Default check values are 100us above/below this value.
motor_pwm_rate Output frequency (in Hz) for motor pins. Defaults are 400Hz for motor. If setting above 500Hz, will switch to brushed (direct drive) motors mode. For example, setting to 8000 will use brushed mode at 8kHz switching frequency. Up to 32kHz is supported. Note, that in brushed mode, minthrottle is offset to zero.
servo_pwm_rate Output frequency (in Hz) servo pins. Default is 50Hz. When using tricopters or gimbal with digital servo, this rate can be increased. Max of 498Hz (for 500Hz pwm period), and min of 50Hz. Most digital servos will support for example 330Hz.
mincommand This is the PWM value sent to ESCs when they are not armed. If ESCs beep slowly when powered up, try decreasing this value. It can also be used for calibrating all ESCs at once.
retarded_arm Disabled by default, enabling (setting to 1) allows disarming by throttle low + roll. This could be useful for non-acro tricopters, where default arming by yaw could move tail servo too much.
disarm_kill_switch Enabled by default. Disarms the motors independently of throttle value. By setting it to 0 baseflight reverts to the old behaviour of disarming only when the throttle is low. Only applies when arming and disarming with an AUX channel.
small_angle If the copter tilt angle exceed this value the copter will refuse to arm. default is 25°.
serial_baudrate This is the baud rate used for main serial interface - default of 115200 is probably best to leave alone. Can be changed if for example RF telemetry such as XBee is used which is limited to 57600 baud.
softserial_baudrate This is the baud rate used for soft serial interfaces. Currently valid values are from 2400 to 19200.
softserial_1_inverted, softserial_2_inverted Controls inversion on soft serial interface. Useful for example for frsky telemetry output.
gps_baudrate This is the baud rate at which GPS will run. For NMEA-type GPS, user can set a baudrate if known, otherwise firmware will attempt to auto-detect the baudrate. When configured GPS type is UBX or MTK, firmware will attempt to configure the module at specified speed using vendor commands.
0 - 115.2kbps
1 - 57.6kbps
2 - 38.4kbps
3 - 19.2kbps
4 - 9.6kbps (not fast enough for 5Hz updates)
serialrx_type When feature SERIALRX is enabled, this allows connection to several receivers which output data via digital interface resembling serial. These include Spektrum Satellite, Futaba SBUS, and Graupner SUMD. Currently supported values for this setting are:
0 - Spektrum 10bit (1024)
1 - Spektrum 11bit (2048)
2 - Futaba SBUS
3 - Graupner SUMD
4 - Multiwii Serial Protocol
Note, that SBUS will require a signal inverter in order to connect.
telemetry_port Choose which serial interface will be used for telemetry output. 0 = UART, 1 = SoftSerial port #1 (rc pins 5-rx/6-tx), 2 = SoftSerial port #2 (rc pins 7-rx/8-tx)
telemetry_provider Choose what type of telemetry to output. Currently available: 0 = FrSky D8-compatible telemetry, 1 = Graupner HoTT telemetry
telemetry_switch Which aux channel to use to change serial output & baud rate (MSP / Telemetry). It disables automatic switching to Telemetry when armed.
throttle_correction_value, throttle_correction_angle the throttle_correction_value will be added to the throttle input. It will be maximal at the throttle_correction_angle and over, null when the copter is leveled and proportional in bewteen. The angle is set with 0.1 deg steps from 1 to 900, ie : 300 = 30.0 deg, 225 = 22.5 deg.
vbatscale result is Vbatt in 0.1V steps. 3.3V = ADC Vref, 4095 = 12bit adc, 110 = 11:1 voltage divider (10k:1k) x 10 for 0.1V. Adjust this slightly if reported pack voltage is different from multimeter reading. You can get current voltage by typing "status" in cli.
vbatmaxcellvoltage maximum voltage per cell, used for auto-detecting battery voltage in 0.1V units, default is 43 (4.3V)
vbatmincellvoltage minimum voltage per cell, this triggers battery out alarms, in 0.1V units, default is 33 (3.3V)
power_adc_channel This selects the ADC input channel for an external current sensor. 0: disabled, 1: input via CH2, 9: input via CH8
currentscale This sets the output voltage to current scaling for the current sensor in 0.1 mV/A steps. 400 is 40mV/A such as the ACS756 sensor outputs. 183 is the setting for the Überdistro with a 0.25mOhm shunt.
currentoffset This sets the output offset voltage of the current sensor in millivolts.
multiwiicurrentoutput Default current output in Baselfight via MSP is in 0.01A steps. Setting this to 1 lets baseflight use the default multiwii scaling (1mA steps).
align_gyro, align_acc, align_mag When running baseflight on non-default hardware or adding support for new sensors/sensor boards, these values are used for sensor orientation. Default of zero means the driver determines alignment (and this generally means it's configured for baseflight standard hardware). Default orientation of X forward, Y right, Z up is 1. After that, the numbers are as follows, and mean sensor is rotated. CW0_DEG=1, CW90_DEG=2, CW180_DEG=3, CW270_DEG=4, CW0_DEG_FLIP=5, CW90_DEG_FLIP=6, CW180_DEG_FLIP=7, CW270_DEG_FLIP=8. This should cover all orientations. When carefully understood, these values can also be used to rotate (in 90deg steps) or flip the board.
align_board_roll, align_board_pitch, align_board_yaw Arbitrary board rotation in degrees, to allow mounting it sideways / upside down / rotated etc
acc_hardware This is used to suggest which accelerometer driver should load, or to force no accelerometer in case gyro-only flight is needed. Default (0) will attempt to auto-detect among enabled drivers. Otherwise, to force a particular device, set it to 1 for ADXL345, 2 for MPU6050 integrated accelerometer, 3 for MMA8452, 4 for BMA280, or 5 to disable accelerometer alltogether - resulting in gyro-only operation.
max_angle_inclination This setting controls max inclination (tilt) allowed in angle (level) mode. default 500 (50 degrees).
moron_threshold When powering up, gyro bias is calculated. If the model is shaking/moving during this initial calibration, offsets are calculated incorrectly, and could lead to poor flying performance. This threshold (default of 32) means how much average gyro reading could differ before re-calibration is triggered.
gyro_lpf Hardware lowpass filter for gyro. Allowed values depend on the driver - For example MPU6050 allows 5,10,20,42,98,188,256Hz, while MPU3050 doesn't allow 5Hz. If you have to set gyro lpf below 42Hz generally means the frame is vibrating too much, and that should be fixed first. Values outside of supported range will usually be ignored by drivers, and will configure lpf to default value of 42Hz.
gps_type When feature GPS is enabled, configures type of connected GPS. NMEA=0, UBLOX=1, MTK(NMEA)=2, MTK(Binary)=3
pwm_filter Applies a hardware filter on the PWM or PPM inputs to remove high-frequency interference that may cause jitter. Default is 0 (off), can be set up to 15.

Per-profile settings

pid_controller default (0) multiwii PID controller, 1 = alternative PID controller.
deadband and yawdeadband These are values (in us) by how much RC input can be different before it's considered valid. For transmitters with jitter on outputs, this value can be increased. Defaults are zero, but can be increased up to 10 or so if rc inputs twitch while idle.
mag_declination Current location magnetic declination in format. For example, -6deg 37min, = for Japan. Leading zero in ddd not required. Get your local magnetic declination here:
gimbal_flags When feature SERVO_TILT is enabled, this can be a combination of the following numbers: 1=normal gimbal (default), 2=tiltmix gimbal, 4=in PPM (or SERIALRX) input mode, this will forward AUX1..4 RC inputs to PWM5..8 pins
tri_unarmed_servo on tricopter mix only, if this is set to 1, servo will always be correcting regardless of armed state. to disable this, set it to 0.