Skip to content

Commit

Permalink
rename parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
dagar committed Apr 29, 2019
1 parent e4cc889 commit fc30f09
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
14 changes: 7 additions & 7 deletions src/modules/commander/Commander.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4094,7 +4094,7 @@ void Commander::battery_status_check()

void Commander::airspeed_use_check()
{
if (_airspeed_fail_action.get() < 1 || _airspeed_fail_action.get() > 4) {
if (_tas_fs_action.get() < 1 || _tas_fs_action.get() > 4) {
// disabled
return;
}
Expand Down Expand Up @@ -4239,12 +4239,12 @@ void Commander::airspeed_use_check()
}
}

// Do actions based on value of COM_ASPD_FS_ACT parameter
// Do actions based on value of COM_TAS_FS_ACT parameter
status.aspd_fault_declared = false;
status.aspd_use_inhibit = false;
status.aspd_fail_rtl = false;

switch (_airspeed_fail_action.get()) {
switch (_tas_fs_action.get()) {
case 4: { // log a message, warn the user, switch to non-airspeed TECS mode, switch to Return mode if not in a pilot controlled mode.
if (fault_declared) {
status.aspd_fault_declared = true;
Expand All @@ -4260,18 +4260,18 @@ void Commander::airspeed_use_check()
// don't RTL if pilot is in control
mavlink_log_critical(&mavlink_log_pub, "ASPD DATA %s - stopping use", _airspeed_fault_type);

} else if (hrt_elapsed_time(&_time_tas_good_declared) < (_airspeed_rtl_delay.get() * 1_s)) {
} else if (hrt_elapsed_time(&_time_tas_good_declared) < (_tas_fs_rtl_delay.get() * 1_s)) {
// Wait for timeout and issue message
mavlink_log_critical(&mavlink_log_pub, "ASPD DATA %s - stopping use, RTL in %i sec", _airspeed_fault_type,
_airspeed_rtl_delay.get());
_tas_fs_rtl_delay.get());

} else if (TRANSITION_DENIED != main_state_transition(status, commander_state_s::MAIN_STATE_AUTO_RTL, status_flags,
&internal_state)) {

// Issue critical message even if already in RTL
status.aspd_fail_rtl = true;

if (_airspeed_rtl_delay.get() == 0) {
if (_tas_fs_rtl_delay.get() == 0) {
mavlink_log_critical(&mavlink_log_pub, "ASPD DATA %s - stopping use and returning", _airspeed_fault_type);

} else {
Expand All @@ -4281,7 +4281,7 @@ void Commander::airspeed_use_check()
} else {
status.aspd_fail_rtl = true;

if (_airspeed_rtl_delay.get() == 0) {
if (_tas_fs_rtl_delay.get() == 0) {
mavlink_log_critical(&mavlink_log_pub, "ASPD DATA %s - stopping use, return failed", _airspeed_fault_type);

} else {
Expand Down
8 changes: 4 additions & 4 deletions src/modules/commander/Commander.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ class Commander : public ModuleBase<Commander>, public ModuleParams

(ParamFloat<px4::params::COM_TAS_FS_INNOV>) _tas_innov_threshold,
(ParamFloat<px4::params::COM_TAS_FS_INTEG>) _tas_innov_integ_threshold,
(ParamInt<px4::params::COM_TAS_FS_T1>) _tas_use_stop_delay,
(ParamInt<px4::params::COM_TAS_FS_T2>) _tas_use_start_delay,
(ParamInt<px4::params::COM_ASPD_FS_ACT>) _airspeed_fail_action,
(ParamInt<px4::params::COM_TAS_FS_DLY>) _tas_use_stop_delay,
(ParamInt<px4::params::COM_TAS_FS_END>) _tas_use_start_delay,
(ParamInt<px4::params::COM_TAS_FS_ACT>) _tas_fs_action,
(ParamFloat<px4::params::COM_ASPD_STALL>) _airspeed_stall,
(ParamInt<px4::params::COM_ASPD_FS_DLY>) _airspeed_rtl_delay
(ParamInt<px4::params::COM_TAS_FS_D_RTL>) _tas_fs_rtl_delay

)

Expand Down
24 changes: 12 additions & 12 deletions src/modules/commander/commander_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -821,7 +821,7 @@ PARAM_DEFINE_INT32(COM_OA_BOOT_T, 100);
/**
* Airspeed failsafe consistency threshold (Experimental)
*
* This specifies the minimum airspeed test ratio as logged in estimator_status.tas_test_ratio required to trigger a failsafe. Larger values make the check less sensitive, smaller values make it more sensitive. Start with a value of 1.0 when tuning. When estimator_status.tas_test_ratio is > 1.0 it indicates the inconsistency between predicted and measured airspeed is large enough to cause the navigation EKF to reject airspeed measurements. The time required to detect a fault when the threshold is exceeded depends on the size of the exceedance and is controlled by the COM_TAS_FS_INTEG parameter. The subsequent failsafe response is controlled by the COM_ASPD_FS_ACT parameter.
* This specifies the minimum airspeed test ratio as logged in estimator_status.tas_test_ratio required to trigger a failsafe. Larger values make the check less sensitive, smaller values make it more sensitive. Start with a value of 1.0 when tuning. When estimator_status.tas_test_ratio is > 1.0 it indicates the inconsistency between predicted and measured airspeed is large enough to cause the navigation EKF to reject airspeed measurements. The time required to detect a fault when the threshold is exceeded depends on the size of the exceedance and is controlled by the COM_TAS_FS_INTEG parameter. The subsequent failsafe response is controlled by the COM_TAS_FS_ACT parameter.
*
* @min 0.5
* @max 3.0
Expand All @@ -833,7 +833,7 @@ PARAM_DEFINE_FLOAT(COM_TAS_FS_INNOV, 1.0f);
/**
* Airspeed failsafe consistency delay (Experimental)
*
* This sets the time integral of airspeed test ratio exceedance above COM_TAS_FS_INNOV required to trigger a failsafe. For example if COM_TAS_FS_INNOV is 100 and estimator_status.tas_test_ratio is 2.0, then the exceedance is 1.0 and the integral will rise at a rate of 1.0/second. A negative value disables the check. Larger positive values make the check less sensitive, smaller positive values make it more sensitive. The failsafe response is controlled by the COM_ASPD_FS_ACT parameter.
* This sets the time integral of airspeed test ratio exceedance above COM_TAS_FS_INNOV required to trigger a failsafe. For example if COM_TAS_FS_INNOV is 100 and estimator_status.tas_test_ratio is 2.0, then the exceedance is 1.0 and the integral will rise at a rate of 1.0/second. A negative value disables the check. Larger positive values make the check less sensitive, smaller positive values make it more sensitive. The failsafe response is controlled by the COM_TAS_FS_ACT parameter.
*
* @unit s
* @max 30.0
Expand All @@ -845,33 +845,33 @@ PARAM_DEFINE_FLOAT(COM_TAS_FS_INTEG, -1.0f);
/**
* Airspeed failsafe stop delay (Experimental)
*
* Delay before stopping use of airspeed sensor if checks indicate sensor is bad. The failsafe response is controlled by the COM_ASPD_FS_ACT parameter.
* Delay before stopping use of airspeed sensor if checks indicate sensor is bad. The failsafe response is controlled by the COM_TAS_FS_ACT parameter.
*
* @unit s
* @group Commander
* @category Developer
* @min 1
* @max 10
*/
PARAM_DEFINE_INT32(COM_TAS_FS_T1, 3);
PARAM_DEFINE_INT32(COM_TAS_FS_DLY, 3);

/**
* Airspeed failsafe start delay (Experimental)
*
* Delay before switching back to using airspeed sensor if checks indicate sensor is good. The failsafe response is controlled by the COM_ASPD_FS_ACT parameter.
* Delay before switching back to using airspeed sensor if checks indicate sensor is good. The failsafe response is controlled by the COM_TAS_FS_ACT parameter.
*
* @unit s
* @group Commander
* @category Developer
* @min 10
* @max 1000
*/
PARAM_DEFINE_INT32(COM_TAS_FS_T2, 100);
PARAM_DEFINE_INT32(COM_TAS_FS_END, 100);

/**
* Airspeed fault detection stall airspeed. (Experimental)
*
* This is the minimum indicated airspeed at which the wing can produce 1g of lift. It is used by the airspeed sensor fault detection and failsafe calculation to detect a significant airspeed low measurement error condition and should be set based on flight test for reliable operation. The failsafe response is controlled by the COM_ASPD_FS_ACT parameter.
* This is the minimum indicated airspeed at which the wing can produce 1g of lift. It is used by the airspeed sensor fault detection and failsafe calculation to detect a significant airspeed low measurement error condition and should be set based on flight test for reliable operation. The failsafe response is controlled by the COM_TAS_FS_ACT parameter.
*
* @group Commander
* @category Developer
Expand All @@ -888,22 +888,22 @@ PARAM_DEFINE_FLOAT(COM_ASPD_STALL, 10.0f);
* @value 1 log a message
* @value 2 log a message, warn the user
* @value 3 log a message, warn the user, switch to non-airspeed TECS mode
* @value 4 log a message, warn the user, switch to non-airspeed TECS mode, switch to Return mode after COM_ASPD_FS_DLY seconds
* @value 4 log a message, warn the user, switch to non-airspeed TECS mode, switch to Return mode after COM_TAS_FS_D_RTL seconds
* @group Commander
* @category Developer
*/
PARAM_DEFINE_INT32(COM_ASPD_FS_ACT, 0);
PARAM_DEFINE_INT32(COM_TAS_FS_ACT, 0);

/**
* Airspeed fault detection RTL delay (Experimental)
* Airspeed fault detection delay before RTL (Experimental)
*
* RTL delay after bad airspeed measurements are detected if COM_ASPD_FS_ACT is set to 4. Ensure the COM_ASPD_STALL parameter is set correctly before use. The failsafe start and stop delays are controlled by the COM_TAS_FS_T1 and COM_TAS_FS_T2 parameters. Additional protection against persistent airspeed sensor errors can be enabled using the COM_TAS_FS_INNOV parameter, but these addtional checks are more prone to false positives in windy conditions.
* RTL delay after bad airspeed measurements are detected if COM_TAS_FS_ACT is set to 4. Ensure the COM_ASPD_STALL parameter is set correctly before use. The failsafe start and stop delays are controlled by the COM_TAS_FS_DLY and COM_TAS_FS_END parameters. Additional protection against persistent airspeed sensor errors can be enabled using the COM_TAS_FS_INNOV parameter, but these addtional checks are more prone to false positives in windy conditions.
*
* @min 0
* @max 300
* @unit s
* @group Commander
* @category Developer
*/
PARAM_DEFINE_INT32(COM_ASPD_FS_DLY, 0);
PARAM_DEFINE_INT32(COM_TAS_FS_D_RTL, 0);

0 comments on commit fc30f09

Please sign in to comment.