All Projects → Cleric-K → Flysky I6x_firmware_bugfix

Cleric-K / Flysky I6x_firmware_bugfix

Fixes a bug in the original FS-i6X firmware

Programming Languages

c
50402 projects - #5 most used programming language

Labels

Projects that are alternatives of or similar to Flysky I6x firmware bugfix

Idevicerestore
Restore/upgrade firmware of iOS devices
Stars: ✭ 505 (+1302.78%)
Mutual labels:  firmware
Asuswrt Merlin
Asuswrt-Merlin is an enhanced version of Asuswrt, the firmware used by Asus's modern routers.
Stars: ✭ 6,591 (+18208.33%)
Mutual labels:  firmware
Mu tiano plus
UEFI Tiano Core Value
Stars: ✭ 28 (-22.22%)
Mutual labels:  firmware
Stm32 Bootloader
Customizable Bootloader for STM32 microcontrollers. This example demonstrates how to perform in-application-programming of a firmware located on an external SD card with FAT32 file system.
Stars: ✭ 541 (+1402.78%)
Mutual labels:  firmware
Broadcom Bt Firmware
Repository for various Broadcom Bluetooth firmware
Stars: ✭ 677 (+1780.56%)
Mutual labels:  firmware
Vsphere Modules
This is my Module Collection for VMware vSphere
Stars: ✭ 18 (-50%)
Mutual labels:  firmware
Awesome Embedded And Iot Security
A curated list of awesome embedded and IoT security resources.
Stars: ✭ 500 (+1288.89%)
Mutual labels:  firmware
Esp3d
FW for ESP8266/ESP8285/ESP32 used with 3D printer
Stars: ✭ 979 (+2619.44%)
Mutual labels:  firmware
Raspberrypipkg
DEPRECATED - DO NOT USE | Go here instead ->
Stars: ✭ 758 (+2005.56%)
Mutual labels:  firmware
Mobiletss
Check signing status and save blobs on iOS device.
Stars: ✭ 21 (-41.67%)
Mutual labels:  firmware
Nanovna
Very Tiny Palmtop Vector Network Analyzer
Stars: ✭ 539 (+1397.22%)
Mutual labels:  firmware
Emba
emba - An analyzer for Linux-based firmware of embedded devices.
Stars: ✭ 607 (+1586.11%)
Mutual labels:  firmware
Lowlevelprogramming University
How to be low-level programmer
Stars: ✭ 7,224 (+19966.67%)
Mutual labels:  firmware
Dorita980
Unofficial iRobot Roomba and Braava (i7/i7+, 980, 960, 900, e5, 690, 675, m6, etc) node.js library (SDK) to control your robot
Stars: ✭ 523 (+1352.78%)
Mutual labels:  firmware
Davega
Firmware for DAVEga, a device for electronic skateboards that displays data read from VESC based speed controllers.
Stars: ✭ 30 (-16.67%)
Mutual labels:  firmware
Anne Key
Firmware for Anne Pro Keyboard written in Rust
Stars: ✭ 506 (+1305.56%)
Mutual labels:  firmware
Nodemcu Firmware
Lua based interactive firmware for ESP8266, ESP8285 and ESP32
Stars: ✭ 6,884 (+19022.22%)
Mutual labels:  firmware
Exein Openwrt Public
Openwrt 18.06.5 featured with the Exein's security framework
Stars: ✭ 36 (+0%)
Mutual labels:  firmware
Uart Smartwatch
Android App, Firmware and Circuit for a DIY Smartwatch working with Bluetooth Low Energy
Stars: ✭ 30 (-16.67%)
Mutual labels:  firmware
Bcf Skeleton
BigClown Firmware Skeleton (Empty Application)
Stars: ✭ 14 (-61.11%)
Mutual labels:  firmware

FlySky FS-i6X Firmware Bug Fix

Why is this needed?

The FlySky-i6X's official firmware has a bug which is decreasing its performance. It is not a hardware problem, but a software mistake. Unfortunately FlySky never addressed that bug with an official update. I tried on several occasions to get in contact with them and to ask them if they are even aware of the problem, but I never got any response back.

The effect of this bug is not so pronounced that it makes the radio unusable (obviously). It is also technical enough that its nature can be grasped only when working with blackbox logs and applying some observation. For the average user it is simply the case that this radio seems to be not of high enough quality compared to others.

This firmware patch will not give your radio "superpowers" but it will simply make it work as it was originally designed to.

This is how a single channel's data looks like before (with original firmware) and after (with bugfix):

Before-After

The problem is much more pronounced when using a digital protocol (IBUS or SBUS). PPM is not affected that much because by its nature it has lower frame rate than digital protocols.

If you just want to install the update head over to the How to flash section.

If you are interested in the details - read on.

The problem

The radio data from the transmitter is sent over 2.4GHz in frames (packets) of information. Each frame is a short sequence of binary data. There are different types of frames, carrying different kinds of information. The most important and most frequently sent frame type is the one that carries the channel data. These frames are sent at approximately 7 milliseconds interval (which is actually one of the best frame rates, compared to other radio brands).

The problem is that although frames are sent every 7ms, most of the time we receive several frames which carry the same channel data!

See this graph:

Stepped graph

This is just the first channel (roll). The rectangles represent the channel's value as it arrives with each frame. On the X axis we have time, on Y - the channel value [1000 - 2000]. Note how several consecutive frames carry the same channel value.

In many cases this is not necessarily a problem. It simply means that the effective frame rate is lower. For example instead of getting fresh channel data every 7ms, you get it every 14 or 21ms.

If you are flying airplanes or some other not-so-sensitive craft you might never sense a problem.

The problem becomes more pronounced when the radio is used for higher-performance quad copters for example.

Flight Controller software (Cleanflight, Betaflight) can detect quick movements of the sticks and apply further boost to the motors. This is much used in racing because it can provide more crisp and responsive behavior of the copter.

In former versions this feature was called Setpoint Weight, now it has been extracted as the F (Feedforward) gain of the PID loop. The Feedforward component is a direct derivative of the stick movement - if your stick is stationary F is zero, if your stick is moving F rises. The faster you move the stick, the higher F's value is (the sign of F depends on the direction you are moving the stick).

In the early days of flight controller software this has posed a problem: as we are using digital radio protocols and the channel data arrives in frames, channel values stay the same most of the time (between two frames) and then jump to their new values when a new frame arrives. This does not work very well with F, because in the time between frames, when channel values stay the same, F should be zero. On the other hand, when new frame with different channel value arrives, F reacts to the change and a F kick is produced. On the next iteration of the PID loop F drops to zero again because channel data once again stays the same until the next frame.

For this reason radio channel interpolation was implemented (and later a low pass filter) - the software tries to smooth out the "staircase" shape of the axis values, so that the derivative is also smooth and F kicks are avoided.

The following graph illustrates all this:

Stepped blackbox graph

It represents one channel (roll in the example). The curves are:

  • debug[0] is the raw radio data. Notice how it jumps to new values as new frames arrive.
  • RC Command is the above radio data but after the interpolation/smoothing filter has been applied.
  • Feedforward is the derivative of the above. Note that where RC Command is not changing (it is horizontal) F is zero and where RC Command is changing F has a value (the steeper the change of RC Command, the higher the value of F).

As it's visible, the step-like shape of the RC Command produces F kicks which can be quite significant. They translate to very erratic commands to the motors (they are asked very rapidly to increase speed then to reduce and so on) which decreases their effectiveness, increases heat and mechanical stress.

Although this problem affects F the most, P is not immune to it either:

P

We can see that P constantly changes direction while trying to keep the copter in sync with the stair case shaped commands.

So if the raw radio data passes through smoothing filter why is it still so step-like?

The answer lies in the way the software configures the smoothing filter. By default the amount of smoothing is determined automatically based on the interval at which channel frames arrive (the frame rate). With FS-i6X this is about 7ms and the filter is setup in such a way that it has to "connect the dots" of two frames.

Keep in mind that when using filtering the RC Command curve is about one-frame-time behind of the actual radio data. This is because in realtime the flight controller does not know if it has to smooth the current value up or down until it sees the next frame. That's why interpolation/filtering always introduces some delay.

Frames

Here with red we can see the actual frames (and because of the bug, several consecutive frames have the same value). As we can see the filter actually does pretty good job in smoothing out the curve between two frames. And here "between two frames" is the key. Consider two frames with the same value - the smoothing actually works there, they are connected with a straight line - there's no reason for the filter to make a curvy line between points of the same value!

In other words, from the filter's perspective there's no way to know that the arriving frame's data is wrong - it looks like perfectly valid channel data (maybe we are somehow really moving our sticks in such a way) and it does its best to smooth out the line between any two frames.

The fix

The firmware patch provided here fixes the software bug in the original firmware and sends the actual axes values at every frame. Here's the result:

Smooth graph

Smooth blackbox graph

Now the automatic RC filter achieves the desired effect and the F kicks are no longer present.

For more technical description of the fix see the source code

How to flash

  1. Head over to the releases section and download the bugfix updater program. Just in case, the original firmware is also provided.

  2. You need a special cable. It might be included in your box but mine, for example, came with no cable. In such a case you can either buy one or you can create one yourself. Unlike the FS-i6, which uses UART communication, the FS-i6X uses USB:

USB

  1. Connect the cable and open the System/Firmware update menu on your transmitter. Confirm that you want to enter the firmware update mode.

  2. Open the updater program. You should see the device detected:

Updater

If nothing appears in the updater you can try to put your radio in firmware updata mode by using this combination:

  1. Turn off your radio
  2. Hold simultaneously the left horizontal trimmer to the right and the left vertical trimmer down
  3. Turn on your radio

image

  1. Click Update

  2. After the transmitter is restarted you can make sure the new version is active from the System/Firmware ver. menu:

Version

  1. Enjoy!

Like it?

If having the full potential of your device brought a smile on your face, you may shine back if you feel like it: Donate
Thank you!!!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].