K110 with Play F4 - rotorflight/rotorflight GitHub Wiki

:exclamation: This page is outdated

Rotorflight Wiki is replaced by www.rotorflight.org.


This walk-through shows you how you can configure your K110 with a brushless tail and a Play F4 FC. You can follow it for other brushless tail helicopters as well if the ESC supports BLHeli_S or BLHeli_32.

The Play F4 is an F4 based FC with a built in BLHeli_S 5A 4-in-1 ESC. 5A is not much, but it will fly OK with not too much power. On tail I'm using an Emax 0802 19000KV motor that brings loads of tail authority.

PDK wrote a great guide which details how to build a K110 with a Play F4 and configure it for Heliflight 3D. You can use that guide for building the hardware. Then you can use this guide to configure the hardware for Rotorflight. The only difference is that the guide connects servo 1 to TX1, whereas I connected servo 1 to RX1. TX1 can then be used for OpenLager. The Play F4 page shows the exact wiring.

Backup Your Original Settings

First, make a dump of the original settings of your Play F4. Go to the CLI tab, type dump all, wait till the dump is finished and click Save to File.

Flash Rotorflight Firmware

Now flash the Rotorflight firmware:

  • Select NOX as your board.
  • Select the latest firmware version.
  • Enable Full Chip Erase.
  • Click on Load Firmware [Online].
  • Click on Flash Firmware
  • After flashing, connect and select Apply Custom Defaults.

The Play F4 claims to be a NOX, but it's not the JHEMCU F4 Noxe. They are similar, but there are differences. To solve this, go to the CLI tab and paste this in it:

set current_meter = ADC
set battery_meter = ADC
save

Features, Board and Sensor Alignment

Go to the Configuration tab.

  • Give the heli a Craft name.
  • Set PID loop frequency to 2.67 kHz.
  • Enable the features Governor and RPM Filter and disable the others.
  • Set Roll Degrees to 180.
  • Set Yaw Degrees to 135.
  • Set First GYRO to CW 180.

Click on Save and Reboot. The helicopter in the Status tab should now move as expected when you move it by hand.

Calibrate the Accelerometer

The accelerometer is used for all self-leveling modes, like rescue, angle and horizon mode. To calibrate it, go to the System tab and press Calibrate Accelerometer. The accelerometer might need re-calibration sometimes, for example after a crash.

Configure Your Receiver

This example uses an SBUS receiver, but you can use other receivers as well. Go to the Serial Ports tab, set UART2 as Serial Rx and click Save and Reboot.

k110-motor-setup

Now go to the Receiver tab and select Serial RX input as Receiver Mode. Select SBUS as Serial Receiver Protocol. I'm using FrSky/AETRC123 as Channel Map. Click Save and Reboot again. Under Receiver Channels, check that your channels are working as expected. See also the Setup Receiver page.

Configure the Motors

The main motor -motor 1 in Rotorflight- is connected to M2. The tail motor -motor 2 in Rotorflight- is connected to M3. We have to assign the pins of M2 and M3 to motor 1 and 2:

resource MOTOR 1 A07 # M2
resource MOTOR 2 B08 # M3
resource MOTOR 3 NONE
resource MOTOR 4 NONE

Type save.

Now go to the Motors tab. Select DSHOT300 as the ESC/Motor protocol and enable Bidirectional DShot.

The Main Rotor Gear Ratio can be calculated by dividing the motor pinion tooth count with the main motor gear tooth count and is needed for calculating the main rotor RPM. The stock K110 has an 8T motor pinion and a 64T main gear, so specify 8 / 64. Since the tail rotor is directly driven by the tail motor, specify 1 / 1 for the Tail Rotor Gear Ratio.

To calculate the motor RPM, the FC has to know how many poles (magnets) each motor has. This is always an even number. The stock K110 main motor has 6 poles, and the Emax 0802 tail motor 12.

k110-motor-setup

Set Governor Mode to MODE2 and click Save and Reboot.

Flash Bluejay

Now it's a good time to flash Bluejay. Select version 0.16 or later with a PWM Frequency of 48Khz.

Main Motor Settings

Here are my main motor settings. Yours might be different. For example, the motor direction might be Normal on yours - depending on the wiring of the motor. Please set Maximum Braking Strength always to 0 to prevent the helicopter from spinning wildy when you use throttle hold.

k110-bluejay-main

Tail motor settings

The tail motor performs better with braking on, because then it can decelerate faster. And that will improve tail authority.

k110-bluejay-tail

Configure the Servos

Servo 1 is connected to RX1, servo 2 to LED_STRIP and servo 3 to TX2. The K110 servos are digital servos that can operate at 333 Hz. Paste this in the CLI, then type save.

resource SERVO 1 B07    # elevator servo
resource SERVO 2 A00    # left aileron
resource SERVO 3 A02    # right aileron
timer B07 AF2
  • Go to the System tab and switch Enable Servo Override on.
  • Go to the Servos tab, set the Servo update rate to 333 and click Save.
  • Reverse servo 3 and click Save.
  • Connect a lipo to the FC and enable Servo Override for servo 1, 2 and 3.
  • Level the servo arms by adjusting Center. Start with a small change, like 50. Click Save.
  • Now specify an angle of 30 for servo #1 under Servo Override and press enter. Servo 1 should now move to 30deg. If it's less, increase the Rate for that servo. If it's more, decrease it. Repeat for the other two servos.
  • You can limit or extend the servo movement range by adjusting Min or Max. Do this only if there's a mechanical issue, like servo binding. Use the mixer to limit roll/pitch/collective.

This was the result.

k110-servo-setup

This is also a good moment to set 0deg collective. Set all angles to 0deg, attach rotor blades, fold them both backwards and adjust linkages till swash is level and collective is 0deg.

Note: if your helicopter has fixed length linkages, your swash plate should be more or less level. Use servo Trim to set 0 collective. In this case the trim value should be the same for all servos. However, you might need different trim values for each servo if your swash isn't level.

Configure the Mixer

The K110 has a main and a tail motor and uses a 120deg 3-servo CP swash. Go to the Mixer tab and configure the rotors like this:

k110-motor-setup

Now calibrate the mixer. Since the swash plate was binding to the main shaft I reduced Min and Max SR and SP. I ended up with:

k110-motor-setup

Add Modes

Go to the Modes tab. Click on Add Range under ARM and configure a switch on your transmitter for arming. Click on Save. Note that the helicopter will only arm when throttle is 0%. Disconnect the USB cable and connect a lipo. Set throttle to 0% and arm the helicopter. Increase throttle. The heli should now spool up. Quickly switch it off since it isn't fully configured yet - especially when rotor blades are attached.

Also add a Rescue mode. It will level the heli to the nearest orientation -be it normal or inverted- and will then apply collective. Click on Add Range and configure a switch on your transmitter for rescue. I like to use a momentary switch for rescue. Click on Save. You can specify the amount of collective to be used when engaging Rescue mode in the Profile tab.

Modes

Configure RPM filters

Rotorflight can filter out vibrations coming from the main and tail rotor. For this to work, the FC needs to know how fast the motor is running and how many motor turns result in a rotor turn. Bidirectional DSHOT does provide motor RPM, but other techniques are also possible. See the RPM filter page for more information.

Go to the Gyro tab, enable RPM filters under Gyro RPM Notch Filter Settings and configure them like this:

Gyro RPM Notch Filters

In this example all filters are enabled, which is OK for starters. However, each filter does add to the filter delay - around 0.5 to 3ms per notch. For an agile heli it's important to keep the number of filters low. But it's even more important to keep the gyro trace clean.

Start by minimizing mechanical vibrations: replace (slightly) bend shafts, balance blades, replace bearings/gears/grips, tighten screws, lubricate, the usual. Then make Blackbox logs with different filter settings and compare the gyro trace.

Profiles

PIDs, yaw and rescue settings, headspeed and governor settings can be entered in the Profiles tab. You can have up to 6 profiles. This example uses just one profile. You can use this profile with 80/90/100% throttle, resulting in 3520/3960/4400 RPM.

Governor Settings

The governor settings are pretty much the default settings, except for Full headspeed.

governor settings

How to Determine the Maximum Headspeed

Each profile can have its own Full headspeed, i.e. the headspeed at 100% throttle. The Full headspeed should always be under the maximum headspeed. To determine the maximum headspeed, go to the System tab and Enable motor override. Connect a lipo to the Play F4. Go back to the Motors tab and enable motor #1 under Motor Override. Then type 15 under Throttle. The main motor will now spool up. The actual motor RPM will be shown under Motor #1. Mine will go up to 48000 at 4.1V - without rotors.

The motor has an 8T pinion, the main gear is 64T, so 8 turns of the main motor will result in 1 turn of the rotor head. The theoretical maximum headspeed is 48000/8 = 6000 RPM. Since we need some room for the governor and some voltage drop, let's say the practical maximum headspeed is 4400 RPM.

PIDs

I used these PID values, which I found after tuning.

k110 PIDs

I-term Rotation

I-term rotation can be used as some form of pirouette compensation. It works quite good.

k110 controller

Yaw settings

TTA will make your tail more locked in by using main motor torque to assist the motor driven tail.

k110 controller

Rescue

Rescue will level the heli to the nearest orientation -be it upright or inverted- and will then apply collective. The Initial Climb Collective Boost will be added to Rescue Climb Collective for the duration of Initial Climb Duration seconds. After the initial climb the heli will roll itself upright if it is inverted.

rescue settings

Rates

Rates are very personal and can be specified in the Rates tab. I like a relatively fast yaw. You can set expo either on your transmitter or in the FC. Setting expo in the FC increases resolution around mid stick.

k110 rates

Blackbox Logging and Tuning

TX1 can be connected to the RX of an OpenLog or OpenLager board for Blackbox logging.

For tuning PIDs, go to the Blackbox tab and set Blackbox debug mode to GYRO_SCALED. Click Save and Reboot.

To find the PIDs for pitch and roll I first tried to find the feed forward values. Then I increased I and P. For the motor driven tail I had to add some extra P and D to make it snappy. However, it does oscillate a bit, if you look at the Blackbox logs. As long as the tail motor doesn't get hot I don't think it's an issue.

Try It Out

Now you can make your first test hops and flights.

  • Look for oscillations. If you have them, try decreasing P and/or I.
  • Do not use D with servos, since they are too slow to react to that.
  • Look if the heli holds attitude in wind, collective moves, and big lateral moves. If it doesn't, increase I.
  • Tweak rates if necessary.
  • Test rescue.
  • If the heli seems to fly OK, have a look at some Blackbox logs. Are there any vibrations or oscillations you didn't notice while flying?

Here's a video of my K110 running Rotorflight.

The Final Diff

Here's the final diff of this exercise. You can compare it to your of diff by going to the CLI tab and typing diff.