Pitch, roll compensated thrust.

Firmware/software/electronics/mechanics
Post Reply
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Pitch, roll compensated thrust.

Post by BillyBag2 »

I was considering correcting thrust for pitch and roll. This is to try and compensate for the virtical thrust dropping because of pitch and roll.
This would give level flight and would also allow a narrower thrust control range, as you would not need the upper part of the range to regain lost height.

I think the compensation for thrust should be T = T0 * (1/cos(angle))
I think this could posible be, or is approximatly T = T0 * (1/cos(pitch)) * (1/cos(roll))

Working in radians I think I can approximate 1/cos(x) to be 1 + ((x^2)/2)

So a cheap calculation could be T = T0 * (1 + (pitch * pitch * 0.5)) * (1 + (roll * roll * 0.5))

Or in degrees
C = (((2 *pi)/360)^2)/2
T = T0 * (1 + (pitch * pitch * C)) * (1 + (roll * roll * C))

I am unsure if I can equate thrust with the PWM setting. I think given all the approximations this is probably good enough.
I think it would be wise to limit the thrust to T <= T0 * 1.5. Just to stop extream thrusts at extreame angles.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Pitch, roll compensated thrust.

Post by tobias »

Sounds like a great thing to try, especially to assist the pilot or when doing more autonomous attempts!
BillyBag2
Member
Posts: 45
Joined: Wed Jul 10, 2013 8:54 am

Re: Pitch, roll compensated thrust.

Post by BillyBag2 »

I am not convinced I have mixed the two axis in the best way. Overall there was too much compensation. Probably two issues.
So I have reduced it using ((factor - 1.0)/2) + 1.0. This is alot cheper than a square root.
The RC news groups talk about mixing in the equivilent of pitch/roll demand into the throttle on the transmitter.
Given all the unknowns and aproximation a simple linear mix may be OK.
I am using actual pitch roll as this is available to me on the flie.
tobias
Bitcraze
Posts: 2339
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: Pitch, roll compensated thrust.

Post by tobias »

I've been thinking for a long time (as with a lot of things) to do a "PWM to actual thrust" plot so we can get a proper transfer function between PWM and thrust. That would be very useful in a case such as this and could probably improve stability as well. Should probably prioritise it higher.
omwdunkley
Expert
Posts: 162
Joined: Thu Jun 06, 2013 9:56 pm
Location: Munich

Re: Pitch, roll compensated thrust.

Post by omwdunkley »

Ive been thinking about this for a while, its actually really important and would solve so many problems...

As far as I can tell it strongly depends on the battery depletion too. Im not sure how to estimate this.

Ive played around with some data and found this:
Image
Full detail image: https://lh3.googleusercontent.com/-gLGH ... FAccGT.png
Important (red line ~= black line) is that the thrust theoretically can be mapped to the acceleration very welll

I just used matlab to minimise the function:

Code: Select all

voltage*m1 + PWM*m2 + n = ground truth acceleration.
Ground truth comes form an external tracking system.

The results above a quite promising...Im just not sure how to go from here ;)
marco.tognon
Member
Posts: 38
Joined: Mon Sep 16, 2013 10:22 am

Re: Pitch, roll compensated thrust.

Post by marco.tognon »

Hi!
Important (red line ~= black line) is that the thrust theoretically can be mapped to the acceleration very welll
Did you try it only in hovering mode?

I think that we are looking for the same thing: the relationship between the torque/sthrength/angural velocity and the value of motorPowerMX in the firmaware. I mean I want to find the function f() such that motorPowerMX = f(torque/strength/angular velocity). am I in wrong??

May be we can find the answer looking on the datasheet or asking at the crazyflie developers. The identification method shall be the last step!
Post Reply