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.

Views: 1026

Comment by Dany Thivierge on February 7, 2012 at 8:55pm

Wow doesn't look so subjective to me when I see the 2 videos... 

Looks quite sharp and seems way more responsive.  Plus when you return stick to center, for sure you want to go stop or go in a different direction so this small momentum cancelling (like the name!) helps. 

now question for you... will there be flying conditions where it would not help... like when the APM is fighting against wind.... will it overwrite the wind compensation? (hope not) 

Just looking at potential "issues" (not that your idea is not geat, just want to be constructive) would this stop the momentum on a very long radius turn? meaning that what if you are trying to chain 2 commands that would have looked very fluid without your fix... now would it over compensate and break the chain of command? 

This really needs to be tested outdoor where you will have more room! I hope it works fine or can be adapted to work fine as I really like the concept! 

Comment by AndrewF on February 7, 2012 at 9:05pm

What you're going for is known as "translational rate command" or TRC where aircraft velocity is proportional to the control input.  This is a step up from the current attitude-command response that is implemented in STABILIZE mode.  To truly do this would require precise aircraft velocity feedback, but your approach is an interesting way of approximating the TRC response without using aircraft velocity feedback.

Comment by Ellison Chan on February 7, 2012 at 9:10pm

Well, there a number of possible downsides to this.  For one, since I actively cancel momentum, by adding reverse roll and pitch it could be inefficient on battery life.  It's a trade off.  The other is that this current experimental code doesn't check to see if you are actually moving or not, it simply records the controls, and reverses it blindly.  Sitting on the ground where there quad is not moving, and moving the sticks, can result in cancelling of momentum, that doesn't exist.  Of course, any final code will have a clever way of solving this problem. ;-)

Wind cancellation is not going to be an issue with my current idea, since I'm only cancelling user inputted roll and pitch.  Cancelling wind induced motion is a whole different problem.  The idea is that we always know fully what the user input is, since we read the sticks, and drive the motors with that input.  So theoretically, we can cancel all motion caused by user input.

Comment by Ellison Chan on February 7, 2012 at 9:15pm

Yes, TRC.  I'll remember that.

If there was an accurate velocity sensor, I'd have this done by the weekend, along with position hold and 10 other things.  Someday. :-)

Comment by Ramon L on February 7, 2012 at 10:27pm

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

Comment by Ellison Chan on February 7, 2012 at 10:40pm

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.

Comment by Marco Robustini on February 7, 2012 at 11:58pm

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! :-)

Comment by Nicolas Brieger on February 8, 2012 at 2:41am


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?


Comment by Ellison Chan on February 8, 2012 at 6:23am

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.

Comment by Grips on February 8, 2012 at 6:57am

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..


You need to be a member of DIY Drones to add comments!

Join DIY Drones

© 2019   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service