Bug #367
openIncoherence of drag constant in motor dynamics / wrench computation
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.
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?
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?
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?
Updated by Martin Jacquet about 2 years ago
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
Updated by Antonio Franchi about 2 years ago
- best reference I know about motors and propellers is the PhD thesis by Bangura: https://openresearch-repository.anu.edu.au/bitstream/1885/112382/1/Bangura%20Thesis%202017.pdf
- for a quick shorter reference also the PhD Thesis by Tomic can be used https://elib.dlr.de/185788/1/2018_Teodor-Tomic_Thesis_Dissertation.pdf
- for an even quicker reference this ICRA 2014 paper by Bangura should be enough: https://openresearch-repository.anu.edu.au/bitstream/1885/11442/1/Bangura%20et%20al%20Aerodynamic%20power%20control%202014.pdf
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.
- a new set_gtmrp_geom in mrsim-genom3 was added, similar to
what is found in nhfc-genom3.
If you can test it and it works for you, I'll make a release of those
projects soon.
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.
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
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 :)