This will be a walk thru setting up Cleanflight on a Flip32 (similar to a Naze32 board) using the standard FrSky D4R-II Receiver flashed with the 27ms firmware and a Micro MinimOSD board running MW OSD with a RTFPIXEL STICK.

Start by downloading the latest Cleanflight Configurator, you will need Google Chrome installed on your computer.

Flash the latest version of Cleanflight on your board, v1.9.0 at the time of this post.

Cleanflight Boris B style – SETTINGS UPDATED 20th July 2015 bottom of page.

1 – Flash Firmware

Once you are sure you have selected the latest NAZE firmware click the Load Firmware [Online] button, then Flash Firmware

Once you get the success message at the top you can then connect the to the GUI.

Most of the setup will be done using the GUI but some setting still have to be done using the CLI (Command Line Interface)

 

2- PORTS

I want my FrSky Telemetry on UART1 which comes out inverted by default on the Flip/Naze32 Telemetry port next to the USB port. Note the Telemetry only works once the board is armed.
I also set UART2 to MSP (RC PIN 3 and 4 in the Flip32/Naze32) for the MinimOSD.
My LED signal is connected to RC PIN 5 for the LED_STRIP feature.

Hit Save and Reboot.

3- CONFIGURATION

If you are using oneshot capable ESC’s enable oneshot125, I’m using 12amp Afro’s flashed with BLHeli so set min_throttle to 1068, this will be the speed at which your motors spin when armed and set max_throttle to 2000 with damping light enabled.

I have my board rotated 90deg to the side (USB to the left)
Make sure you do this in this order or your calibration will be off, trust me I just did it
1- Set Yaw at 90 and hit Save and Reboot
2- Go back to the Setup tab, have the frame level and hit Calibrate Accelerometer.
3- If using tilted motors go back to Configuration and set Roll at -10 and

Hit Save and Reboot.

When you come back to the setup tab the calibration should be good and the angles matching.

Back in the Configuration tab switch the receiver mode to RX_PPM and make sure VBAT is enabled. The D4R-II PPM output is connected to the RC1 pin.
Set the warnings you like but I like the defaults, the Voltage Scale calibrates your voltage if you see a difference in the OSD reading and a voltmeter measurement. Mine was spot on at the default 110.

Config1-cropped

 

For current sensing I am using the virtual current sensor option.
The Scale value is the result of a weird formula, 210 seems just right for my quad after a few flights and checking what I put back in, just play with this until the mAh you put back when charging match the OSD readings.
The Offset value is pretty much your quadcopter current draw at idle. 10 = 0.5A
You want the support for legacy MultiWii MSP for MinimOSD  and since you’re using an OSD that expects the multiwii current meter output value, then set multiwii_current_meter_output = 1 in CLI (this multiplies amperage sent to MSP by 10) so you get a proper reading.

Don’t forget to enable LED_STRIP and TELEMETRY, then

Hit Save and Reboot.

Config2-cropped

 

3- PID TUNING

These are the settings posted by Boris B. they work great on my ZMR250.
Note the profile # at the bottom left, this not only stores your PID setting, but also the Receiver tab rates and settings, the modes and adjustments settings, failsafe values (IMPORTANT!) along with a ton of other things. We will need to play with the CLI once we get there to make sure all our changes work on all profiles. It is not fun to set everything up, switch profiles and not understand why nothing works.

Pid-cropped

Top left is your PID Controller, right now PID Controller’s 1, 2 and 5 are the most used with 1 being the favorite of the week. Read up on them in the Cleanflight docs.

On the right are the different rates setting. 1.8.0 rolled in with new separate Pitch and Roll rates, which makes sense since the weight distribution is really not even on our machines.

The 3 rates here are like extreme expo. They will set the speed at which you can flip at full stick.
TPA and TPA breakpoint are not in use in all PID Controllers. The more TPA you set the more docile the PID become when at a throttle value over the set TPA Breakpoint

4- RECEIVER

This is where you want to check that all your channels are centered on 1500 and travel from 1000 to 2000, it’s better to be inside the range than outside if you have no choice.
I have set RSSI to channel 8, this is for the OSD and how to get the RSSI on CH8 is covered in the Taranis blog post.

Receiver-cropped

For the RC Rate and RC Expo this is how Boris B puts it:

Basically it’s these few parameters to get the center stick right:

RC Rate = Center stick feel!
R/P rate = Far end sensitivity (a bit like extreme expo)
RC Expo = Expo that improves mid stick

Everyone has a personal taste in here and the values can be different for everyone.
So basically configure RC Rate to what you like your mid stick to be and after that increase R/P rate to get the speed of flips and rolls you can handle. Leave RC expo on stock 0.6 or adjust to your liking.

5- MODES

This is how I have mine setup, and the Taranis programing must match these.
I keep Angle on a switch, as it will only be used for ‘ohshit’ moments and I don’t like the way it feels when flying.
Note the switch for the OSD, this allows to change the layout and you can set a clear one for racing.
I tried to use as little channels as possible here, so I mixed Angle and Horizon to the same channel, you can see room in the channel for another flight mode.
Another channel for the OSD switch and the Buzzer as I probably will never need to have the buzzer going while hiding the OSD layout…
This leaves 1 channels free for adjustments since we are using channel 8 for RSSI.

Modes-cropped

6- ADJUSTMENTS

Regarding adjustments, for regular flying I only have the rates on a switch. I’ll post a PID tuning setup as well (when I get to it).

7- MOTORS

This tab can be used to test your motor rotation and calibrate your ESCs

Motors Screen

Make sure these values are set in the CLI:

set max_throttle = 2000
set min_command = 1000
How to calibrate with this tab:
1- Turn on your Tx
2- Connect the Flip32/Naze32 to USB with the main battery UNPLUGGED
3- Go to the motor tab, activate the motors with ‘check’ and put the master slider at 2000 (our max_throttle).
4- Plug in the battery and wait for the ESC beeps.
5- Put the slider back down to 1000 (our min_command) and you should hear the ESC calibration beeps and be done.

8- LED

For LED strips start by clearing the default setup. Play around with it, very simple. Start by laying out all of your LED and then give them custom colors jobs
This is what my layout looks like:

Led-cropped

9- CLI

Now we want to check that the CLI values are good and set a few custom ones.

This is my CLI values for the LED layout if you want to test it out:

led 0 10,14:S:I:0
led 1 9,14:S:I:0
led 2 8,14:S:IAT:3
led 3 7,14:S:A:3
led 4 6,14:S:A:0
led 5 5,14:S:IA:0
led 6 4,14:S:I:0
led 7 3,14:S:I:0

Then let’s dump the enabled features (feature command)

# feature
Enabled features: RX_PPM VBAT FAILSAFE TELEMETRY CURRENT_METER LED_STRIP ONESHOT125

Matches our GUI settings, all good.

 

I plan to fly with MultiWi (rewrite) (PID 1) so I could run a 0 looptime, but right now there seems to be a bug that randomly starts motors when looptime is set at 0 so until fixed I will use 1200 as this is the lowest it goes. If you are not using BlHeli  with damped light  flashed esc’s, use 2500 works out to 400Mhz.

set looptime = 1200

I also want my quad to just drop out of the sky on failsafe, so we want no delay before the disarm, and we have already set out failsafe throttle at 1000 in the GUI.
You can also change the failsafe_delay but I like the default of 10 (1 second).

set failsafe_off_delay = 1

We need to set the current meter type to virtual and activate the better vfas FrSky voltage calculation as well as sending the correct multiwii current meter output value.

set current_meter_type = 2
set frsky_vfas_precision = 1
set multiwii_current_meter_output = 1

I also like to add a little deadband at center stick

set deadband= 4
set yaw_deadband = 4
set yaw_jump_prevention_limit = 300
set rc_yaw_expo = 35

These are Boris B. setting for Pid 1 you probably want to change these to your liking.

set rc_rate = 100
set rc_expo = 70
set rc_yaw_expo = 35
set thr_mid = 50
set thr_expo = 0
set roll_rate = 60
set pitch_rate = 60
set yaw_rate = 95
set tpa_rate = 50
set tpa_breakpoint = 1400
set yaw_jump_prevention_limit = 300
set pid_controller = 1
set p_pitch = 55
set i_pitch = 30
set d_pitch = 30
set p_roll = 40
set i_roll = 20
set d_roll = 30
set p_yaw = 135
set i_yaw = 65
set d_yaw = 1
set p_level = 20
set i_level = 20
set d_level = 150
set looptime=1200
feature ONESHOT125
set min_command = 1000
set min_check = 1020
set min_throttle = 1080
set pid_at_min_throttle=1

Then let’s dump the enabled features (feature command)

# feature
Enabled features: RX_PPM VBAT FAILSAFE TELEMETRY CURRENT_METER LED_STRIP ONESHOT125

It is also best to use a Custom mix on non symmetrical frames like the ZMR250 which is not a perfect square but more of an H configuration since this makes PID tunning easier. Measure Motor 2 to Motor 4 and Motor 1 to Motor 2 and use this ratio, a much better explanation is found here.

mixer CUSTOM
cmix 1 1.0, -1.0, 0.765, -1.0
cmix 2 1.0, -1.0, -0.765, 1.0
cmix 3 1.0, 1.0, 0.765, 1.0
cmix 4 1.0, 1.0, -0.765, -1.0

 

Now if your board has built in memory or you are using an external flight data recorder you want to activate blackbox to make use of it.Eventually I want to try this but for now it’s just what I’ve read on various forums

feature blackbox
set blackbox_device = 1
set blackbox_rate_num = 1
set blackbox_rate_denom = 2

Now we want to duplicate some settings such as failsafe and modes across all profiles. Use ‘dump profile’ to copy and paste your AUX / Adjustments settings, and anything else that you might have changed that relates to profiles such as failsafe_off_delay. Switch to each profile (profile 0, profile 1, profile 2) and paste your profile 0 dump values.

Don’t forget to send the save command once done.

This is my dump at this point of the setup. Only thing left is to tweak the PIDs and rates. All 3 profiles are the same as profile 0.

# version
# Cleanflight/NAZE 1.9.0 May 31 2015 / 13:17:47 (98f7549)
# dump master

# mixer
mixer QUADX
# feature
feature -RX_PPM
feature -VBAT
feature -INFLIGHT_ACC_CAL
feature -RX_SERIAL
feature -MOTOR_STOP
feature -SERVO_TILT
feature -SOFTSERIAL
feature -GPS
feature -FAILSAFE
feature -SONAR
feature -TELEMETRY
feature -CURRENT_METER
feature -3D
feature -RX_PARALLEL_PWM
feature -RX_MSP
feature -RSSI_ADC
feature -LED_STRIP
feature -DISPLAY
feature -ONESHOT125
feature -BLACKBOX
feature RX_PPM
feature VBAT
feature MOTOR_STOP
feature FAILSAFE
feature TELEMETRY
feature CURRENT_METER
feature LED_STRIP
feature ONESHOT125
# map
map AETR1234
# serial
serial 0 5 115200 57600 0 115200
serial 1 1 115200 57600 0 115200
# led
led 0 10,14:S:I:0
led 1 9,14:S:I:0
led 2 8,14:S:IAT:3
led 3 7,14:S:A:3
led 4 6,14:S:A:0
led 5 5,14:S:IA:0
led 6 4,14:S:I:0
led 7 3,14:S:I:0
led 8 0,0:::0
led 9 0,0:::0
led 10 0,0:::0
led 11 0,0:::0
led 12 0,0:::0
led 13 0,0:::0
led 14 0,0:::0
led 15 0,0:::0
led 16 0,0:::0
led 17 0,0:::0
led 18 0,0:::0
led 19 0,0:::0
led 20 0,0:::0
led 21 0,0:::0
led 22 0,0:::0
led 23 0,0:::0
led 24 0,0:::0
led 25 0,0:::0
led 26 0,0:::0
led 27 0,0:::0
led 28 0,0:::0
led 29 0,0:::0
led 30 0,0:::0
led 31 0,0:::0
# color
color 0 0,0,0
color 1 0,255,255
color 2 0,0,255
color 3 30,0,255
color 4 60,0,255
color 5 90,0,255
color 6 120,0,255
color 7 150,0,255
color 8 180,0,255
color 9 210,0,255
color 10 240,0,255
color 11 270,0,255
color 12 300,0,255
color 13 330,0,255
color 14 0,0,0
color 15 0,0,0

set looptime = 1200
set emf_avoidance = 0
set mid_rc = 1500
set min_check = 1020
set max_check = 1900
set rssi_channel = 8
set rssi_scale = 30
set rssi_ppm_invert = 0
set input_filtering_mode = 0
set min_throttle = 1080
set max_throttle = 1950
set min_command = 1000
set servo_center_pulse = 1500
set 3d_deadband_low = 1406
set 3d_deadband_high = 1514
set 3d_neutral = 1460
set 3d_deadband_throttle = 50
set motor_pwm_rate = 400
set servo_pwm_rate = 50
set retarded_arm = 0
set disarm_kill_switch = 1
set auto_disarm_delay = 10
set small_angle = 25
set flaps_speed = 0
set fixedwing_althold_dir = 1
set reboot_character = 82
set gps_provider = 0
set gps_sbas_mode = 0
set gps_auto_config = 1
set gps_auto_baud = 0
set serialrx_provider = 0
set spektrum_sat_bind = 0
set telemetry_switch = 0
set telemetry_inversion = 0
set frsky_default_lattitude = 0.000
set frsky_default_longitude = 0.000
set frsky_coordinates_format = 0
set frsky_unit = 0
set frsky_vfas_precision = 1
set hott_alarm_sound_interval = 5
set battery_capacity = 0
set vbat_scale = 108
set vbat_max_cell_voltage = 43
set vbat_min_cell_voltage = 33
set vbat_warning_cell_voltage = 34
set current_meter_scale = 110
set current_meter_offset = 10
set multiwii_current_meter_output = 1
set current_meter_type = 2
set align_gyro = 0
set align_acc = 0
set align_mag = 0
set align_board_roll = 0
set align_board_pitch = 0
set align_board_yaw = 90
set max_angle_inclination = 500
set gyro_lpf = 42
set moron_threshold = 32
set gyro_cmpf_factor = 600
set gyro_cmpfm_factor = 250
set yaw_control_direction = 1
set pid_at_min_throttle = 1
set yaw_direction = 1
set yaw_jump_prevention_limit = 300
set tri_unarmed_servo = 1
set servo_lowpass_freq = 400
set servo_lowpass_enable = 0
set failsafe_delay = 10
set failsafe_off_delay = 1
set failsafe_throttle = 1000
set rx_min_usec = 985
set rx_max_usec = 2115
set acc_hardware = 0
set mag_hardware = 0
set blackbox_rate_num = 1
set blackbox_rate_denom = 1
set blackbox_device = 0

# dump profile

# profile
profile 0

# aux
aux 0 1 0 1700 2100
aux 1 2 0 1300 1700
aux 2 12 1 1775 2100
aux 3 18 1 1800 2075
aux 4 0 0 900 900
aux 5 0 0 900 900
aux 6 0 0 900 900
aux 7 0 0 900 900
aux 8 0 0 900 900
aux 9 0 0 900 900
aux 10 0 0 900 900
aux 11 0 0 900 900
aux 12 0 0 900 900
aux 13 0 0 900 900
aux 14 0 0 900 900
aux 15 0 0 900 900
aux 16 0 0 900 900
aux 17 0 0 900 900
aux 18 0 0 900 900
aux 19 0 0 900 900

# adjrange
adjrange 0 0 0 900 900 0 0
adjrange 1 0 0 900 900 0 0
adjrange 2 0 0 900 900 0 0
adjrange 3 0 0 900 900 0 0
adjrange 4 0 0 900 900 0 0
adjrange 5 0 0 900 900 0 0
adjrange 6 0 0 900 900 0 0
adjrange 7 0 0 900 900 0 0
adjrange 8 0 0 900 900 0 0
adjrange 9 0 0 900 900 0 0
adjrange 10 0 0 900 900 0 0
adjrange 11 0 0 900 900 0 0

# servo
servo 0 1020 2000 1500 30 -1
servo 1 1020 2000 1500 30 -1
servo 2 1020 2000 1500 100 -1
servo 3 1020 2000 1500 100 -1
servo 4 1020 2000 1500 100 -1
servo 5 1020 2000 1500 100 -1
servo 6 1020 2000 1500 100 -1
servo 7 1020 2000 1500 100 -1
servo 8 1020 2000 1500 100 -1
servo 9 1020 2000 1500 100 -1

set gps_pos_p = 15
set gps_pos_i = 0
set gps_pos_d = 0
set gps_posr_p = 34
set gps_posr_i = 14
set gps_posr_d = 53
set gps_nav_p = 25
set gps_nav_i = 33
set gps_nav_d = 83
set gps_wp_radius = 200
set nav_controls_heading = 1
set nav_speed_min = 100
set nav_speed_max = 300
set nav_slew_rate = 30
set alt_hold_deadband = 40
set alt_hold_fast_change = 1
set deadband = 3
set yaw_deadband = 3
set throttle_correction_value = 0
set throttle_correction_angle = 800
set default_rate_profile = 0
set gimbal_flags = 1
set acc_lpf_factor = 4
set accxy_deadband = 40
set accz_deadband = 40
set accz_lpf_cutoff = 5.000
set acc_unarmedcal = 1
set acc_trim_pitch = 0
set acc_trim_roll = 0
set baro_tab_size = 21
set baro_noise_lpf = 0.600
set baro_cf_vel = 0.985
set baro_cf_alt = 0.965
set mag_declination = 0
set pid_controller = 1
set p_pitch = 55
set i_pitch = 30
set d_pitch = 30
set p_roll = 40
set i_roll = 20
set d_roll = 30
set p_yaw = 100
set i_yaw = 65
set d_yaw = 1
set p_pitchf = 2.500
set i_pitchf = 0.600
set d_pitchf = 0.060
set p_rollf = 2.500
set i_rollf = 0.600
set d_rollf = 0.060
set p_yawf = 8.000
set i_yawf = 0.500
set d_yawf = 0.050
set level_horizon = 3.000
set level_angle = 5.000
set sensitivity_horizon = 75
set p_alt = 50
set i_alt = 0
set d_alt = 0
set p_level = 20
set i_level = 20
set d_level = 150
set p_vel = 120
set i_vel = 45
set d_vel = 1
set yaw_p_limit = 500

# dump rates

# rateprofile
rateprofile 0

set rc_rate = 90
set rc_expo = 65
set rc_yaw_expo = 35
set thr_mid = 50
set thr_expo = 0
set roll_rate = 30
set pitch_rate = 30
set yaw_rate = 50
set tpa_rate = 50
set tpa_breakpoint = 1500

#

That should cover the basic and not so basic setup of Cleanflight on your Flip32 or Naze32 board.

 

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Cleanflight Boris B style – SETTINGS UPDATED 20th JULY 2015
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

A Work In Progress!!!!

Why is this such a great improvement?
From what I understand (I’m no expert in programming – just my interpretation/observations!)
the filtering that Boris B introduced allows for higher D settings and gives less oscillation.
Higher D settings seems to make stopping at sharp turns and after flips and rolls more abrupt.
This works great in combination with active braking. Even in windy conditions these settings
with Boris B style firmware don’t lose their ‘rocksteadyness’.

To use this mini-how-to you’ll have to know your way
around Cleanflight and know how to flash your ESC’s.

SETUP

– ZMR 250
– 2300KV 2204s
– SimonK 30Amp ESC’s (reflashed with new firmware – bootloader enabled)
– 3S LiPo’s – 1800mAh
– GemFan 5045 props
– Flip32 (Naze32 clone without baro/magno/GPS)

CLEANFLIGHT SPECIFICS

– BorisBstyle Cleanflight version (upgrade from 1.9.0 enabling filtering)
The Boris B hex file is downloadable at https://dl.dropboxusercontent.com/u/…light_NAZE.hex
(right click and select download when you get the code as text)
Flash your board with this local hex file you’ve downloaded.
These settings don’t work with Cleanflight 1.9.0

CHANGES IN CLI

set looptime = 2500
set gyro_lpf = 0
set gyro_cut_hz = 60
set pterm_cut_hz = 40
set dterm_cut_hz = 15

======================

STEP BY STEP:

1) Flash your ESC’s with with Blheli with braking and oneshot enabled
2) Download the hexfile from Boris B : https://dl.dropboxusercontent.com/u/…light_NAZE.hex
3) Flash your board with the Cleanflight configurator with this hexfile using ‘Load Firmware local’
4) Enable oneshot in Cleanflight
5) Enter the values in the GUI from the pics below or one of the less agile alternatives
6) Check that you use PID controller 1 !!!
7) Enter the following in the CLI:

set looptime = 2500
set gyro_lpf = 0
set gyro_cut_hz = 60
set pterm_cut_hz = 40
set dterm_cut_hz = 15

PID values & rates and expo you’ll find in the attached pictures
======================

MORE TAME ALTERNATIVE SETTINGS

The settings you’ll find in the pics are quite agile.
If you’re confident doing flips and rolls they are great!
If you’re a little bit confident like I am. They are also great
Do you want less agility? Then you might want to use one of the
two alternative settings below:

1) Intermediate agility
PID Tuning tab: ROLL rate = 0,31 PITCH rate = 0,29 YAW rate 0,32
Receiver tab: RC Expo = 0,65

2) Tame agility
PID Tuning tab: ROLL rate = 0,20 PITCH rate = 0,19 YAW rate 0,23
Receiver tab: RC Expo = 0,50

REMARKS

The hexfile from Boris B is a candidate to be implemented in a next release from Cleanflight.
Boris B is still improving this but it worked great and is very stable on my Flip32.
Read more here: https://github.com/cleanflight/cleanflight/pull/1028

This ‘tuning queeste’ from Joshuabardwell commented by Boris B
is very informative and has provided me with a lot of insight!
http://www.rcgroups.com/forums/showthread.php?t=2439428

Angle mode and horizon mode are programmed differently in the GUI with PID 1 compared to PID 3.
P = 2.8 is the value for Angle mode (gentle self levelling)
I = 0,028 is the same value for horizon mode
D = 100 determines where horizon mode switches from Angle to Rate mode.
(max = 255 is max Rate mode with just a little bit of levelling at center stick)

Rates work differently in PID 1 compared to PID 3.
In PID 3 ROLL rate and PITCH rate work as kind of an expo.
In PID 1 they just ‘add up’ So higher PITCH & ROLL rates give higher rotation speed.
If you want expo. Raise the RC Expo value in the Receiver tab.

 

 

  1. Nice write up but I do have a queation.
    In the title you say Flip32 but then you only mention Naze32. Specially in part 2 this gets confusing.
    So is it about the flip or is it about the Naze?

    • Hi Gerard,

      This blog is mostly for my own use, your the first person I’ve ever received a comment from. 🙂

      They are pretty much the same board just a different layout.Cleanflight setup on them is the same only the position of the connectors are different.

      Revised the page, hopefully makes things a little clearer will have to revise again as Cleanflight just updated to version 1.9

  2. Hi Guy,

    Which wires connect to RC3 and RC4 to get telemetry going? I have my OSD on UART1 and was hoping to get my Frsky telemetry on UART2 but I seem to be struggling. I have a Flip32. Thanks for any help 🙂

    • Actually FrSky needs to be on UART1, as I understand it UART1 is the only serial port capable of inversion which is required by the Frsky telemetry.

Leave a Reply

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