diff --git a/crazyflow/control/mellinger/params.toml b/crazyflow/control/mellinger/params.toml index e4270c01..83342bfc 100644 --- a/crazyflow/control/mellinger/params.toml +++ b/crazyflow/control/mellinger/params.toml @@ -157,3 +157,43 @@ kw = [20000.0, 20000.0, 12000.0] ki_m = [0.0, 0.0, 500.0] kd_omega = [200.0, 200.0, 0.0] int_err_max = [1.0, 1.0, 1500.0] + +[hb_x500] +[hb_x500.core] +gravity_vec = [0.0, 0.0, -9.81] +mass = 2.28 +L = 0.17678 # Distance from axis to rotor, i.e., arm / sqrt(2) +rpm2thrust = [0.0, 1e-6, 1e-9] # Unknown +rpm2torque = [0.0, 1e-9, 1e-12] # Unknown +thrust2torque = 0.01 # Unknown +mixing_matrix = [ + [-1.0, -1.0, 1.0, 1.0], + [-1.0, 1.0, 1.0, -1.0], + [-1.0, 1.0, -1.0, 1.0] +] +pwm_min = 0 +pwm_max = 1 +thrust_min = 1 # in N per motor +thrust_max = 12.13 # in N per motor +mass_thrust = 0.02061006 +torque_pwm_max = [0.4882887, 0.4882887, 0.4882887] + +[hb_x500.state2attitude] +kp = [12.0, 12.0, 35.0] +kd = [6.0, 6.0, 8.0] +ki = [1.0, 1.0, 1.0] +int_err_max = [4.0, 4.0, 2.0] + +[hb_x500.attitude2force_torque] +kR = [1.068132, 1.068132, 0.9155413] +kw = [0.3051804, 0.3051804, 0.1831083] +ki_m = [0.0, 0.0, 0.007629511] +kd_omega = [0.003051804, 0.003051804, 0.0] +int_err_max = [1.0, 1.0, 1500.0] + +[hb_x500.body_rate2force_torque] +kR = [1.068132, 1.068132, 0.9155413] +kw = [0.3051804, 0.3051804, 0.1831083] +ki_m = [0.0, 0.0, 0.007629511] +kd_omega = [0.003051804, 0.003051804, 0.0] +int_err_max = [1.0, 1.0, 1500.0] diff --git a/crazyflow/drones/__init__.py b/crazyflow/drones/__init__.py index 935fcef1..cde0d69d 100644 --- a/crazyflow/drones/__init__.py +++ b/crazyflow/drones/__init__.py @@ -19,6 +19,7 @@ class Drone(StrEnum): cf2x_L250 = "cf2x_L250" cf2x_P250 = "cf2x_P250" cf2x_T350 = "cf2x_T350" + hb_x500 = "hb_x500" # Sanity check at startup diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_PropHub.stl b/crazyflow/drones/assets/hb_x500/hb_x500_PropHub.stl new file mode 100644 index 00000000..bafa6246 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_PropHub.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_PropL.stl b/crazyflow/drones/assets/hb_x500/hb_x500_PropL.stl new file mode 100644 index 00000000..62b02ce0 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_PropL.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_PropR.stl b/crazyflow/drones/assets/hb_x500/hb_x500_PropR.stl new file mode 100644 index 00000000..375dada8 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_PropR.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_arm_plastics.stl b/crazyflow/drones/assets/hb_x500/hb_x500_arm_plastics.stl new file mode 100644 index 00000000..0336fa76 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_arm_plastics.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_battery_holder.stl b/crazyflow/drones/assets/hb_x500/hb_x500_battery_holder.stl new file mode 100644 index 00000000..d79bdf83 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_battery_holder.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_frame.stl b/crazyflow/drones/assets/hb_x500/hb_x500_frame.stl new file mode 100644 index 00000000..aeebb9de Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_frame.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_fused.stl b/crazyflow/drones/assets/hb_x500/hb_x500_fused.stl new file mode 100644 index 00000000..5086ff58 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_fused.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_gps_antenna.stl b/crazyflow/drones/assets/hb_x500/hb_x500_gps_antenna.stl new file mode 100644 index 00000000..c5bf4db6 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_gps_antenna.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_gps_mount.stl b/crazyflow/drones/assets/hb_x500/hb_x500_gps_mount.stl new file mode 100644 index 00000000..dec09fc3 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_gps_mount.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_gps_sma.stl b/crazyflow/drones/assets/hb_x500/hb_x500_gps_sma.stl new file mode 100644 index 00000000..97607709 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_gps_sma.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_gps_tube.stl b/crazyflow/drones/assets/hb_x500/hb_x500_gps_tube.stl new file mode 100644 index 00000000..1e2c1fcd Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_gps_tube.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_leg.stl b/crazyflow/drones/assets/hb_x500/hb_x500_leg.stl new file mode 100644 index 00000000..903840f9 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_leg.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_motors.stl b/crazyflow/drones/assets/hb_x500/hb_x500_motors.stl new file mode 100644 index 00000000..11d3f206 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_motors.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_propguard_arm.stl b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_arm.stl new file mode 100644 index 00000000..12071615 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_arm.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_propguard_center.stl b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_center.stl new file mode 100644 index 00000000..85af1454 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_center.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_propguard_left.stl b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_left.stl new file mode 100644 index 00000000..a2d86297 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_left.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_propguard_right.stl b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_right.stl new file mode 100644 index 00000000..a566885f Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_propguard_right.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_screws.stl b/crazyflow/drones/assets/hb_x500/hb_x500_screws.stl new file mode 100644 index 00000000..0c5a04ca Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_screws.stl differ diff --git a/crazyflow/drones/assets/hb_x500/hb_x500_tubes.stl b/crazyflow/drones/assets/hb_x500/hb_x500_tubes.stl new file mode 100644 index 00000000..66845609 Binary files /dev/null and b/crazyflow/drones/assets/hb_x500/hb_x500_tubes.stl differ diff --git a/crazyflow/drones/hb_x500.xml b/crazyflow/drones/hb_x500.xml new file mode 100644 index 00000000..c97e670d --- /dev/null +++ b/crazyflow/drones/hb_x500.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/crazyflow/dynamics/so_rpy/params.toml b/crazyflow/dynamics/so_rpy/params.toml index c13ab3ca..44f40317 100644 --- a/crazyflow/dynamics/so_rpy/params.toml +++ b/crazyflow/dynamics/so_rpy/params.toml @@ -80,3 +80,18 @@ cmd_f_coef = 0.96836458 rpy_coef = [-188.9910, -188.9910, -138.3109] rpy_rates_coef = [-12.7803, -12.7803, -16.8485] cmd_rpy_coef = [138.0834, 138.0834, 198.5161] + +[hb_x500] +mass = 2.28 +J = [ # approximated + [24e-3, 0.0, 0.0], + [0.0, 24e-3, 0.0], + [0.0, 0.0, 44e-3] +] +thrust_min = 1.0 # in N per motor +thrust_max = 12.13 # in N per motor +acc_coef = 0.0 +cmd_f_coef = 0.9121643489648786 +rpy_coef = [-51.42302192586755, -51.42302192586755, -26.929070173696157] +rpy_rates_coef = [-8.93635377240008, -8.93635377240008, -8.646484332625702] +cmd_rpy_coef = [47.3447720777806, 47.3447720777806, 25.310886504404653] diff --git a/crazyflow/dynamics/so_rpy_rotor/params.toml b/crazyflow/dynamics/so_rpy_rotor/params.toml index 3d6c3dca..2cdab943 100644 --- a/crazyflow/dynamics/so_rpy_rotor/params.toml +++ b/crazyflow/dynamics/so_rpy_rotor/params.toml @@ -85,3 +85,19 @@ thrust_time_coef = 0.02055366 rpy_coef = [-188.9910, -188.9910, -138.3109] rpy_rates_coef = [-12.7803, -12.7803, -16.8485] cmd_rpy_coef = [138.0834, 138.0834, 198.5161] + +[hb_x500] +mass = 2.28 +J = [ # approximated + [24e-3, 0.0, 0.0], + [0.0, 24e-3, 0.0], + [0.0, 0.0, 44e-3] +] +thrust_min = 1.0 # in N per motor +thrust_max = 12.13 # in N per motor +acc_coef = 0.0 +cmd_f_coef = 0.9122876298664497 +thrust_time_coef = 0.04493428195421334 +rpy_coef = [-51.42302192586755, -51.42302192586755, -26.929070173696157] +rpy_rates_coef = [-8.93635377240008, -8.93635377240008, -8.646484332625702] +cmd_rpy_coef = [47.3447720777806, 47.3447720777806, 25.310886504404653] diff --git a/crazyflow/dynamics/so_rpy_rotor_drag/params.toml b/crazyflow/dynamics/so_rpy_rotor_drag/params.toml index 0afecc52..7ed93725 100644 --- a/crazyflow/dynamics/so_rpy_rotor_drag/params.toml +++ b/crazyflow/dynamics/so_rpy_rotor_drag/params.toml @@ -110,3 +110,24 @@ drag_matrix = [ rpy_coef = [-188.9910, -188.9910, -138.3109] rpy_rates_coef = [-12.7803, -12.7803, -16.8485] cmd_rpy_coef = [138.0834, 138.0834, 198.5161] + +[hb_x500] +mass = 2.28 +J = [ # approximated + [24e-3, 0.0, 0.0], + [0.0, 24e-3, 0.0], + [0.0, 0.0, 44e-3] +] +thrust_min = 1.0 # in N per motor +thrust_max = 12.13 # in N per motor +acc_coef = 0.0 +cmd_f_coef = 0.9234799918739313 +thrust_time_coef = 0.07111262651857447 +drag_matrix = [ + [-0.8031707417931839, 0.0, 0.0 ], + [0.0, -0.8031707417931839, 0.0 ], + [0.0, 0.0, -1.013867567938818 ] +] +rpy_coef = [-51.423019722268464, -51.423019722268464, -26.92907102709692] +rpy_rates_coef = [-8.9363626451314, -8.9363626451314, -8.646483972362423] +cmd_rpy_coef = [47.34477305534468, 47.34477305534468, 25.310887633982862] diff --git a/docs/user-guide/control/parametrize.md b/docs/user-guide/control/parametrize.md index 2c9c6da2..bed0767a 100644 --- a/docs/user-guide/control/parametrize.md +++ b/docs/user-guide/control/parametrize.md @@ -61,6 +61,7 @@ The following configurations ship with pre-fitted parameters: | `"cf2x_P250"` | Crazyflie 2.x, plus propellers | | `"cf2x_T350"` | Crazyflie 2.x, thrust upgrade kit | | `"cf21B_500"` | Crazyflie 2.1 Brushless | +| `"hb_x500"` | Holybro X500 V2 | Pass the drone name as a plain string: