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

Comments

  • 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. :-)

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

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

  • Distributor

    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! 

This reply was deleted.