Experiment with Momentum Cancelling Code

Experimental Momentum Cancelling Turned On

In the above flight, Arducopter 2.3 is being used with stock PID, basically no tuning at all.  The INSTANT_PWM, is enabled.  The propellers are not balanced, and nicked up, from rough flying.  The framed use is my 3D Printed FireFly Mark One.  As you can see, I'm purposely flying it really hard.  Wish I could have recorded the stick movements.  Basically, I am pushing the stick in one direction, and then pushing it back to neutral, and then past it.  The feeling is that the quad is anticipating the direction change, and slowing down ahead of my movement, which is the type of behaviour that I'm expecting from the code.

Stock Arducopter 2.3 with No Momentum Cancelling

The above flight, is using the same code at the first, except the experimental Momentum Cancelling code is turned off.  Same as the first flight, stock PIDs, INSTANT_PWM is turned on, as well.  Again absolutely no tuning.  What I notice is that with no Momentum Cancelling, it's much harder to change directions.  The feeling of the quad responding ahead of the direction change is just not there, so I'm just not able to flick it around like with the experimental code.

Description of Momentum Cancelling

As you roll or pitch a quad, it will start moving in the direction of the stick input.  It will continue in the direction of roll or pitch until you use input the roll or pitch in the opposite direction to counteract that motion.  If the quad was a car, the equivalence would be applying the brakes to stop it.  That's manual Momentum Cancellation.

The code that I've added does this automatically, when the joystick goes back to the neutral centre position.  It's really that simple a concept.  It's not rocket science.  This very experimental code currently applies 2.5 degrees of pitch or roll, whenever the stick goes back to centre.  This is in fact, quite small.  Much more work needs to be done before it can be release to the general public.

The Ultimate Goal

I have a goal for the end game of this code.  Ultimately, if I'm successful, my quad will fly like a hummingbird or a bee instead of a regular bird, or airplane.  Many things need to be added to enable this to happen.

Details on building the Firefly Mark One Quad are available in my previous blog.

Of course the feel of a quad is a very subjective concept.  Would love to hear what people think of the comparison videos.

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Ok, for some comparison, here's my latest video of the Momentum Cancelling with "tuned" PID.  Really all I did was dial down STAB_PITCH, STAB_ROLL, and STAB_YAW to 90% of default. (Due mainly to the fact that my motor and props are too big for the small frame)

  • Yep, exactly.  But, that's just the experiment to see how it works.  Ultimately, the amount of brake will be a little more sophisticated, like being based on how much accumulated pitch and roll there was when the stick was centred.  it may even involve the amount of time the stick was pushed.

  • Ellison,

    I get the impression that you are putting in a fixed reverse tilt for some amount of time when you detect the cyclic stick return to 0,0?

    I thought of a more complicated but maybe closer to what you want to achieve but before I go ahead I wanted to sure you weren't doing something like what I had in mind already.


  • Grips, my other quad has the motor mounted in the middle of longer arms.  It protects the blades that way.  I'm not try to hard to protect this quad, because it's my prototype Firefly Mark One, frame.  Not only am I testing the experimental code, I'm also testing the durability of the 3D printed hub, and overall frame design.  So far it's holding up quite well.  The crashes that you see are a small subset of what goes on that doesn't get on camera.

  • Moderator

    I think another lesson can be learned from that video that was posted. The design for the blade protection looks rather simple but useful. I can imagine you would be saving on props with those. Maybe something to look at in the future..

  • Marco, yes many refinements need to be done before it's anywhere close to alpha testing.  Of course the more intelligence is added to it, the more usable it becomes under different flying conditions. But, I don't see it reaching the level of sophistication that the LMBPC system that Ramon was talking about above.

    Nicolas, I am working with the DCM system to achieve this.  The reverse pitch and roll angles used are based on the assumption that DCM has already stabilized the quad, and it's level.

  • Hey,

    quick idea, might be stupid: My understanding is, that as of now, the stick inputs are translated to a certain rotation of the quadcopter out of being level. This is controlled by, well, a conroller. Wouldn't be exactly what you want if you don't control attitude directly but insted velocities on a certain axis?


  • Developer

    Hi Ellison, I like the idea but i should test it with my thumbs, because I believe in pure flew this might disturb the pilot with flight experience when making turns, large or small is not important.
    I also believe
    that this "momentum cancelling" should not only be based on the amount of stick control but also on the slope and speed of the quad just to avoid the side effects that I described.

    However, it is
    to try! :-)

  • Nice, but not exactly it.  LBMPC seems to be a souped up control loop, where based on sensor data, they predict what the control parameters should be.  Still needs a lot of sophisticated sensors.

    I'm really only interested in one task, cancelling momentum.

  • I think that some I2C ESC's can help a lot, the thing is to make them work with the APM, I have seen this, it was implemented in a quad with a "Learning Based Model Predictive Control" algorithm

This reply was deleted.