Project

General

Profile

Actions

Bug #367

open

Incoherence of drag constant in motor dynamics / wrench computation

Added by Martin Jacquet about 2 years ago. Updated about 2 years ago.

Status:
New
Priority:
Normal

Description

The drag constant used in the motor equation (motor->b) should be the same quantity as the drag coefficient of the motor used to compute the body wrench from the motor speeds.

It seems that there is an unconsistency in these values: in libmrsim, the default drag for the motor and the default allocation matrix G do not seem to match.
Also, in mrsim-gazebo, there are two different default values (ct=1e-5 ; b=5e-4)

The way to fix this is probably to compute the G explicitely from ct, cf and the propeller geometry, using the GTMR model as in nhfc (557e70ba). mrsim-gazebo reads those from the model file, while mrsim-genom3 should use a set_geom similar to nhfc.

Actions #1

Updated by Martin Jacquet about 2 years ago

Martin Jacquet wrote:

the default drag for the motor and the default allocation matrix G do not seem to match.

To be more explicit, the allocation matrix is computed using c=0.0154=cf/ct, hence cf=6.5e-4 implies ct=1e-5:
https://git.openrobots.org/projects/libmrsim/repository/libmrsim/revisions/master/entry/src/sim.c#L84

Also, the default value for cf in mrsim-gazebo is 6e-5:
https://git.openrobots.org/projects/mrsim-gazebo/repository/mrsim-gazebo/revisions/master/entry/src/plugin.cc#L150

Is it doable to set those default values in libmrsim, and have mrsim-gazebo and mrsim-genom3 rely on those?

Actions #2

Updated by Anthony Mallet about 2 years ago

Before merging the two constants, I would like to understand the
following discrepancy in the models:

  • In the motor model, the friction is 'b.w' (linear in w)
  • In the dynamic model, the Z torque is 'Kt.w²' (quadratic in w)

This is puzzling me ... shouldn't those two torques be similar?

Actions #3

Updated by Anthony Mallet about 2 years ago

Thinking about it, I think the motor model is missing was is called
the 'load torque' in the models, which is precisely the torque in
'Ct.w²' created by the propeller blades.

Furthermore, maybe the 'b.w' term can be neglected, and thus the motor
eq. would become:

dw/dt = -Ct.w² + K/2PI.i

What do you think?

Actions #4

Updated by Martin Jacquet about 2 years ago

Oh right, I actually assumed the drag coefficient in the motor equation to be the one induced by the air friction, but it should actually be quadratic en w given our models...
If b describes the solid friction internal to the motor, then I believe that both should be considered in our model since the dominant term is function of the motor speed:
Assuming b=5e-4 and ct=1e-5 (current default values), we have
  • for w=20Hz: (b.w)/(ct.w²) = 2.5
  • for w=1000Hz: (b.w)/(ct.w²) = 0.5
Actions #5

Updated by Antonio Franchi about 2 years ago

Actions #6

Updated by Anthony Mallet about 2 years ago

I pushed a number of commits in libmrsim, mrsim-gazebo
and mrsim-genom3 to address (hopefully) all the issues.

  • the rotor model has gained a quadratic drag term matching what is
    used in the rest of the software and also in the ref. above. The
    linear term is kept but set to 0. by default.

If you can test it and it works for you, I'll make a release of those
projects soon.

Actions #7

Updated by Martin Jacquet about 2 years ago

I did some tests with both mrsim-genom3 and mrsim-gazebo, it seems to work fine, at least for the overall drone behavior.

So, in your opinion we should neglect the viscous friction term b*w? We can probably measure b empirically on the motor (removing the blade) if we can measure the current sent to the motor for rotating in steady state.
Anyhow, I agree that it's most likely less impactful than the aerodynamic drag term.

Actions #8

Updated by Antonio Franchi about 2 years ago

Martin Jacquet wrote in #note-7:

I did some tests with both mrsim-genom3 and mrsim-gazebo, it seems to work fine, at least for the overall drone behavior.

So, in your opinion we should neglect the viscous friction term b*w? We can probably measure b empirically on the motor (removing the blade) if we can measure the current sent to the motor for rotating in steady state.
Anyhow, I agree that it's most likely less impactful than the aerodynamic drag term.

it depends on the speeds, there is for sure a low enough speed for which is more impactful, if Bangura has it there is probably a reason, the best would be identify from real data and check if it is needed to estimate well the behavior

Actions #9

Updated by Anthony Mallet about 2 years ago

On Monday 26 Sep 2022, at 15:45, Martin Jacquet wrote:

So, in your opinion we should neglect the viscous friction term b*w?

In the simulator, I think this term is mostly irrelevant.
And if it's not, then it should be considered in the control software
as well :)

We can probably measure b empirically on the motor (removing the
blade) if we can measure the current sent to the motor for rotating
in steady state.

As a first approximation, you can check the current drawn on a power
supply by spinning the rotors (without props). Remove the ~100mA of
the odroid (you can also check that when not spinning the rotors),
divide by 4 and you're done :)

Actions

Also available in: Atom PDF