HefnyCopter firmware for Quadcopters & Tricopters - RC Groups
Thread Tools
Sep 19, 2012, 01:11 AM
MHefny's Avatar
New Product

HefnyCopter firmware for Quadcopters & Tricopters

HefnyCopter Firmware

version 1.1.0 11 Aug 2013 version 1.1.0

version 1.0.2 14 June 2013 version 1.0.2

version 1.0.1 7 June 2013 version 1.0.1

version 0.9.9: 14 May 2013 version 0.9.9

version 0.9.8: 13 Apr 2013 version 0.9.8

version 0.9.7: 24 Mar 2013 version 0.9.7

version 0.9.7 BETA: 19 Mar 2013 version 0.9.7 BETA

version 0.9.6: 02 Mar 2013 version 0.9.6
New screen for Sonar PID.

version 0.9.5: 18 Feb 2013 version 0.9.5
I added a new flying mode called ALTHLD can be find in home page.

version 0.9.4: 14 Feb 2013 version 0.9.4
The main feature of this version is the support of SONAR for altitude hold on KK2.

version 0.9.3: 31 Jan 2013 version 0.9.3

This version contain minor UI updates based on feedback.

version 0.9.2 : 22 Jan 2013 version 0.9.2

This is a major version with alot of features.... I appreciate trying it.

Please note that motor order now is exactly as KK2 board firmware so you dont need to change sockets on the board for motor.
but you need to change sockets of RX as in www.HefnyCopter.Net

X-QUAD vs Quadcopter Switching Modes

using Hefny Copter you can simply switch your Quadcopter mode from +Quad to X-Quad withOUT changing board orientation or re-compile the code. You simply disarm and pull roll-stick to right then arm and fly as X-Quad.
for complete features please check HefnyCopter.Net
Files can be found here:

HefnyCopter -II for KK2 boards version 0.9.2 is available. Release Notes

HefnyCopter - II Setting Up Board (0 min 0 sec)

KK2.0 HefnyCopter 0.9.1 (1 min 54 sec)

A very nice feature is SmartSticks. This can be handy in the field where u can cover your board and still able to access it.

HefnyCopter2 Smart Sticks (0 min 25 sec)

Menu Structure can be found here

A FAQ & Troubleshooting link is here.

Also New Help Videos are Here
Last edited by MHefny; Aug 11, 2013 at 01:59 PM. Reason: updating
Sign up now
to remove ads between posts
Sep 19, 2012, 01:13 AM
MHefny's Avatar
Main idea about quad stabilization and separation between stabilization & control that lead to easily switching modes without complicating the stabilization system.


1. Developing Concepts & Ideas
2. User Manual
Last edited by MHefny; Feb 15, 2013 at 08:24 AM. Reason: updating
Sep 29, 2012, 08:31 AM
MHefny's Avatar
HefnyCopter Ground Station Playback Video.avi (1 min 21 sec)

This is a video for HefnyCopter2 beta.
I test the support of XBEE connection to link quadcopter with PC using normal KK2 board with no hardware modification. WHat you see is the monitor screen, where there are two programs running..one of them is a stream from an IP cam that shoot my quadcopter and the other is the Application "HefnyCopter Monitor App" that communicates wirlessly with quad to receive data. I fly the quad using my normal TX. The main purpose of this is to study sensors actual values and enhance stability algorithms.
Last edited by MHefny; Jul 19, 2013 at 06:49 AM.
Oct 06, 2012, 04:29 AM
MHefny's Avatar

Study Gyro noise using HefnyCopter Data

This is a study of gyro noise and how can be handled.

Oct 12, 2012, 11:51 AM
MHefny's Avatar

Complementary Filters

I worked on analysing received data from my quadcopter.
I found that adding a complementary filter will greatly remove noise.

I updated HefnyCopter2 to include this filter.

Read this topic about gyro noise filtering to get more detailed info
Last edited by MHefny; Oct 12, 2012 at 11:52 AM. Reason: adding link
Oct 12, 2012, 12:02 PM
MHefny's Avatar

Motor Limiting

There is a famous line of code in almost all quadcopter firmwares that trim the motor if its values is under a certain limit. This is useful to avoid stopping the motor into the air

Well the side effect of this action is that the total full throttle is increased, not only but it may cause a YAW also. Consider this:

Motor (front) = 100
Motor (back) = 100
Motor (left) = 100
Motor (right) = 100

Total throttle is 400

and quad is flying stable, now you want it to increase pitch to move forward so values changed to:

Motor (front) = 40
Motor (back) = 160
Motor (left) = 100
Motor (right) = 100

still Total throttle is 400

Now suppose that the lowest allowed value for a motor is 50 then Motor (front) will be 50... That means the total throttle will be 410 instead of 400
so quad must start to fall down slowly, not only this but the torque also is not equal now, because Motor(front) + Motor (back) > Motor (Left) + Motor (Right).

So I updated the equation to:

// Save motors from turning-off
if (MotorOut[0]<MOTORS_IDLE_VALUE)
MotorOut[3]-=MOTORS_IDLE_VALUE - MotorOut[0];
if (MotorOut[3]<MOTORS_IDLE_VALUE)
MotorOut[0]-=MOTORS_IDLE_VALUE - MotorOut[3];

if (MotorOut[1]<MOTORS_IDLE_VALUE)
MotorOut[2]-=MOTORS_IDLE_VALUE - MotorOut[1];
if (MotorOut[2]<MOTORS_IDLE_VALUE)
MotorOut[1]-=MOTORS_IDLE_VALUE - MotorOut[2];

This should keep the total thrust and yaw fixed in such situation....

In normal situation you normally don't touch the limits to keep your quad stable, so it is not expected to affect stabilization in other situations.
Oct 14, 2012, 07:15 AM
Suspended Account
a bit above my intelligence level but very nice work bruv keep it up
Oct 14, 2012, 11:56 AM
Registered User
hi bruv,

you seem to be very clever and your work is great but as @neobot said : it's above my intelligence as well!!!

please make things simple and please provide me with the best KK 2 firmware, please forget about X and + and please have a look to the autolevel part on the FW.

this is what i need, please keep your good job up bro'
Oct 14, 2012, 11:58 AM
Registered User
FYI i've never switch from X to +, i'm always flying x but sometimes i have to switch from front to back.

BTW thanks for sharing
Oct 14, 2012, 12:07 PM
MHefny's Avatar
Thanks @Oyibox & @Neobot for your feedback.... it encourages and guides me.

HefnyCopter2 that I am currently working on for KK2 does include stuff for autoleveling and even emergency landing... still in the beginning but it should be a powerful firmware I hope
Oct 14, 2012, 12:17 PM
Registered User
i wish to upgrade my KK2 board with you FW asap but please try to keep a single thread as i'm trying to follow your work but it's not easy in multiple thread

again, thanks for sharing your work bruv

what do you mean by "emergency landing"? how is it working?
Oct 14, 2012, 12:28 PM
MHefny's Avatar
"emergency landing" is that I detect that the TX signal is lost so instead of losing ur quad in the air, it starts to land as slowly as possible.
Oct 14, 2012, 12:44 PM
Registered User
Originally Posted by MHefny
"emergency landing" is that I detect that the TX signal is lost so instead of losing ur quad in the air, it starts to land as slowly as possible.
Yes, but how are you detecting 'loss of Tx signal' ?
Oct 14, 2012, 12:59 PM
Registered User
I've seen that my KK2 is showing "no throttle input" when my Tx is off, so it should easy for MHefny to do it
Oct 14, 2012, 01:28 PM
Registered User
Originally Posted by oyibox
I've seen that my KK2 is showing "no throttle input" when my Tx is off, so it should easy for MHefny to do it
OK now turn your Tx on - FC correctly sees Tx.
Now turn your Tx off - what happens ? (<- please don't do this with propellers attached!)
does FC say 'no throttle input' ?

Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion NEW KK Multicopter Core Board V5.5 Quadcopter and firmware loader terriwang Multirotor Drone Talk 1 Apr 05, 2016 05:21 AM
Mini-HowTo Update Firmware for Devo TX - Import/Export Devo TX Models - Update Devo RX Firmware Tom Z Micro Helis 22 Jun 28, 2015 01:20 AM
Sold To trade or sell: my new firmware DL rx for your old firmware DL rx signflyer FPV Equipment (FS/W) 4 Apr 24, 2012 10:49 PM
Sold KK Multicopter Core Board V5.5 Quadcopter and firmware loader $95 Shipped terriwang Aircraft - Electric - Multirotor (FS/W) 20 Jun 06, 2011 12:34 AM
Cool KK Multicopter Core Board V5.5 Quadcopter and firmware loader $95 Shipped terriwang Hot Online Deals 0 May 26, 2011 01:28 AM