From c5e4bcde996640bbaa425d0fcbf9c2cdd96b7f47 Mon Sep 17 00:00:00 2001 From: shota Date: Sat, 4 Feb 2023 21:35:45 +0900 Subject: [PATCH 1/2] ahrs parameter names change --- src/main/fc/settings.yaml | 16 ++++++++-------- src/main/flight/imu.c | 16 ++++++++-------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/main/fc/settings.yaml b/src/main/fc/settings.yaml index a089c01859..1c0613893e 100644 --- a/src/main/fc/settings.yaml +++ b/src/main/fc/settings.yaml @@ -1393,22 +1393,22 @@ groups: type: imuConfig_t headers: ["flight/imu.h"] members: - - name: imu_dcm_kp + - name: ahrs_dcm_kp description: "Inertial Measurement Unit KP Gain for accelerometer measurements" default_value: 2000 field: dcm_kp_acc max: UINT16_MAX - - name: imu_dcm_ki + - name: ahrs_dcm_ki description: "Inertial Measurement Unit KI Gain for accelerometer measurements" default_value: 50 field: dcm_ki_acc max: UINT16_MAX - - name: imu_dcm_kp_mag + - name: ahrs_dcm_kp_mag description: "Inertial Measurement Unit KP Gain for compass measurements" default_value: 2000 field: dcm_kp_mag max: UINT16_MAX - - name: imu_dcm_ki_mag + - name: ahrs_dcm_ki_mag description: "Inertial Measurement Unit KI Gain for compass measurements" default_value: 50 field: dcm_ki_mag @@ -1418,24 +1418,24 @@ groups: default_value: 25 min: 0 max: 180 - - name: imu_acc_ignore_rate + - name: ahrs_acc_ignore_rate description: "Total gyro rotation rate threshold [deg/s] before scaling to consider accelerometer trustworthy" default_value: 15 field: acc_ignore_rate min: 0 max: 30 - - name: imu_acc_ignore_slope + - name: ahrs_acc_ignore_slope description: "Half-width of the interval to gradually reduce accelerometer weight. Centered at `imu_acc_ignore_rate` (exactly 50% weight)" default_value: 5 field: acc_ignore_slope min: 0 max: 10 - - name: imu_gps_yaw_windcomp + - name: ahrs_gps_yaw_windcomp description: "Wind compensation in heading estimation from gps groundcourse(fixed wing only)" default_value: ON field: gps_yaw_windcomp type: bool - - name: imu_inertia_comp_method + - name: ahrs_inertia_comp_method description: "Inertia force compensation method when gps is avaliable, VELNED use the accleration from gps, TURNRATE calculates accleration by turnrate multiplied by speed, ADAPTIVE choose best result from two in each ahrs loop" default_value: VELNED field: inertia_comp_method diff --git a/src/main/flight/imu.c b/src/main/flight/imu.c index bdd69ba6d2..643773cebc 100644 --- a/src/main/flight/imu.c +++ b/src/main/flight/imu.c @@ -114,15 +114,15 @@ FASTRAM bool gpsHeadingInitialized; PG_REGISTER_WITH_RESET_TEMPLATE(imuConfig_t, imuConfig, PG_IMU_CONFIG, 2); PG_RESET_TEMPLATE(imuConfig_t, imuConfig, - .dcm_kp_acc = SETTING_IMU_DCM_KP_DEFAULT, // 0.20 * 10000 - .dcm_ki_acc = SETTING_IMU_DCM_KI_DEFAULT, // 0.005 * 10000 - .dcm_kp_mag = SETTING_IMU_DCM_KP_MAG_DEFAULT, // 0.20 * 10000 - .dcm_ki_mag = SETTING_IMU_DCM_KI_MAG_DEFAULT, // 0.005 * 10000 + .dcm_kp_acc = SETTING_AHRS_DCM_KP_DEFAULT, // 0.20 * 10000 + .dcm_ki_acc = SETTING_AHRS_DCM_KI_DEFAULT, // 0.005 * 10000 + .dcm_kp_mag = SETTING_AHRS_DCM_KP_MAG_DEFAULT, // 0.20 * 10000 + .dcm_ki_mag = SETTING_AHRS_DCM_KI_MAG_DEFAULT, // 0.005 * 10000 .small_angle = SETTING_SMALL_ANGLE_DEFAULT, - .acc_ignore_rate = SETTING_IMU_ACC_IGNORE_RATE_DEFAULT, - .acc_ignore_slope = SETTING_IMU_ACC_IGNORE_SLOPE_DEFAULT, - .gps_yaw_windcomp = 1, - .inertia_comp_method = COMPMETHOD_VELNED + .acc_ignore_rate = SETTING_AHRS_ACC_IGNORE_RATE_DEFAULT, + .acc_ignore_slope = SETTING_AHRS_ACC_IGNORE_SLOPE_DEFAULT, + .gps_yaw_windcomp = SETTING_AHRS_GPS_YAW_WINDCOMP_DEFAULT, + .inertia_comp_method = SETTING_AHRS_INERTIA_COMP_METHOD_DEFAULT ); STATIC_UNIT_TESTED void imuComputeRotationMatrix(void) From bdb9ac94945884792c0b9079e07a588b8bb42d0f Mon Sep 17 00:00:00 2001 From: shota Date: Sun, 5 Feb 2023 22:06:53 +0900 Subject: [PATCH 2/2] ahrs paramter name change --- docs/Settings.md | 160 +++++++++++++++++++++++------------------------ 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/docs/Settings.md b/docs/Settings.md index fa30e623d8..7cbba17cd8 100644 --- a/docs/Settings.md +++ b/docs/Settings.md @@ -182,6 +182,86 @@ Calculated value after '6 position avanced calibration'. See Wiki page. --- +### ahrs_acc_ignore_rate + +Total gyro rotation rate threshold [deg/s] before scaling to consider accelerometer trustworthy + +| Default | Min | Max | +| --- | --- | --- | +| 15 | 0 | 30 | + +--- + +### ahrs_acc_ignore_slope + +Half-width of the interval to gradually reduce accelerometer weight. Centered at `imu_acc_ignore_rate` (exactly 50% weight) + +| Default | Min | Max | +| --- | --- | --- | +| 5 | 0 | 10 | + +--- + +### ahrs_dcm_ki + +Inertial Measurement Unit KI Gain for accelerometer measurements + +| Default | Min | Max | +| --- | --- | --- | +| 50 | | 65535 | + +--- + +### ahrs_dcm_ki_mag + +Inertial Measurement Unit KI Gain for compass measurements + +| Default | Min | Max | +| --- | --- | --- | +| 50 | | 65535 | + +--- + +### ahrs_dcm_kp + +Inertial Measurement Unit KP Gain for accelerometer measurements + +| Default | Min | Max | +| --- | --- | --- | +| 2000 | | 65535 | + +--- + +### ahrs_dcm_kp_mag + +Inertial Measurement Unit KP Gain for compass measurements + +| Default | Min | Max | +| --- | --- | --- | +| 2000 | | 65535 | + +--- + +### ahrs_gps_yaw_windcomp + +Wind compensation in heading estimation from gps groundcourse(fixed wing only) + +| Default | Min | Max | +| --- | --- | --- | +| ON | OFF | ON | + +--- + +### ahrs_inertia_comp_method + +Inertia force compensation method when gps is avaliable, VELNED use the accleration from gps, TURNRATE calculates accleration by turnrate multiplied by speed, ADAPTIVE choose best result from two in each ahrs loop + +| Default | Min | Max | +| --- | --- | --- | +| VELNED | | | + +--- + ### airmode_throttle_threshold Defines airmode THROTTLE activation threshold when `airmode_type` **THROTTLE_THRESHOLD** is used @@ -1622,86 +1702,6 @@ Power draw at zero throttle used for remaining flight time/distance estimation i --- -### imu_acc_ignore_rate - -Total gyro rotation rate threshold [deg/s] before scaling to consider accelerometer trustworthy - -| Default | Min | Max | -| --- | --- | --- | -| 15 | 0 | 30 | - ---- - -### imu_acc_ignore_slope - -Half-width of the interval to gradually reduce accelerometer weight. Centered at `imu_acc_ignore_rate` (exactly 50% weight) - -| Default | Min | Max | -| --- | --- | --- | -| 5 | 0 | 10 | - ---- - -### imu_dcm_ki - -Inertial Measurement Unit KI Gain for accelerometer measurements - -| Default | Min | Max | -| --- | --- | --- | -| 50 | | 65535 | - ---- - -### imu_dcm_ki_mag - -Inertial Measurement Unit KI Gain for compass measurements - -| Default | Min | Max | -| --- | --- | --- | -| 50 | | 65535 | - ---- - -### imu_dcm_kp - -Inertial Measurement Unit KP Gain for accelerometer measurements - -| Default | Min | Max | -| --- | --- | --- | -| 2000 | | 65535 | - ---- - -### imu_dcm_kp_mag - -Inertial Measurement Unit KP Gain for compass measurements - -| Default | Min | Max | -| --- | --- | --- | -| 2000 | | 65535 | - ---- - -### imu_gps_yaw_windcomp - -Wind compensation in heading estimation from gps groundcourse(fixed wing only) - -| Default | Min | Max | -| --- | --- | --- | -| ON | OFF | ON | - ---- - -### imu_inertia_comp_method - -Inertia force compensation method when gps is avaliable, VELNED use the accleration from gps, TURNRATE calculates accleration by turnrate multiplied by speed, ADAPTIVE choose best result from two in each ahrs loop - -| Default | Min | Max | -| --- | --- | --- | -| VELNED | | | - ---- - ### inav_allow_dead_reckoning Defines if INAV will dead-reckon over short GPS outages. May also be useful for indoors OPFLOW navigation