Open knmcguire opened 7 months ago
Just to add to the webots prop model, t2 is probably the 'rotor drag coefficient' equivalent of gazebo
Hi,
as a follow-up question, if we want to edit thrustConstants and torqueConstants in the Webots proto file, what values should we replace them with? Thank you!
@NarimanNiknejad Can you please start a discussion with this question. We handle support on https://discussions.bitcraze.io
UPDATE: Ofcourse I did the thrust constant calculation all wrong, it should be:
thrust_g = 2.5e-8 * RPM^2=2.5e-8 * ((60/2pi)*RAV)^2= 2.28e-6 * RAV^2
thrust (newton) = 2.28e-6*9.81/1000*RAV ^2= 2.2e-8 * RAV ^2
We have a Webots model (proto) and a Gazebo model (SDF) of the Crazyflie. These both have different variables indicating the thrust/motor constant, part in due of different system ID models being used in both simulators.
Current situation
Webots
Webots uses the propeller model given in their documentation: https://cyberbotics.com/doc/reference/propeller Namely
Pretty sure that t2 and q2 is difficult to determine for quadcoters, So practically q1 = t1 * the arm to generate Nm?
where t1, t2 are the thrust constants and q1 and q2 are the torque constants. and omega is the motor angular velocity (unit not given but we assumed rad/s since that is the unit they use in documentation)
These are the values currently in the proto, however, I don't think that these are correct and (tbh) I don't know where they came from and not knowing which unit it is in makes it a bit difficult...
https://github.com/bitcraze/crazyflie-simulation/blob/57a3ed39ec118d1ce182d7a5e84ef80857c8897b/simulator_files/webots/protos/Crazyflie.proto#L99-L100
Gazebo
Gazebo uses a rotor model given in their documentation: https://gazebosim.org/api/gazebo/6.7/structignition_1_1gazebo_1_1systems_1_1multicopter__control_1_1Rotor.html#details
Which says:
It sounds to me that the motor constant should be the arm length...
In the gz.msg.actuators I'm sure that they use rad/s: https://github.com/gazebosim/gz-msgs/blob/gz-msgs10/proto/gz/msgs/actuators.proto
In the sdf we now have the following parameters:
https://github.com/bitcraze/crazyflie-simulation/blob/57a3ed39ec118d1ce182d7a5e84ef80857c8897b/simulator_files/gazebo/crazyflie/model.sdf#L214-L215
These have been based on two sources:
Problem
These values seems to be way off for both webots and gazebo, but which one is accurate?
Current system ID
There has been a master thesis out that has system id' the crazyflie 2.0, which holds a lot for the 2.1.
System Identification of the Crazyflie 2.0 Nano Quadrocopter by Förster (2015). These are the values of the result:
cmd is input command (unit less) and RAV is rotor angular velocity in rad/s. The latter seems to be the values that was used in CrazyS and sim_cf and is also the standard unit for gazebo.
Also there has been some systsem ID done by Bitcraze itself, of which the date can be found in this repo by the IMRClab. An RPM to thrust fit came to these variables:
Which is
The last two factors don't influence the fit much so simplified it is (with rpm to rad/s ). Also, the thrust is in grams and not Newton
There seems to be a difference between 9.6e-8 (latest) and 1.28e-08 (old) thrust constants.
UPDATE: Ofcourse I did the calculation all wrong, it should be:
Solutions?
Webots variables seem to be way off.. it does fly but it isn't accurate, however, the gazebo model doesn't seem to fit either. So both need to be updated and the controllers need to be tuned but that will take time.
At least this issue has the problems nicely in a referenced order since I had to always find the references again every time I look into this again (and drop it because it's all over the place).