diff options
author | Thomas Gubler <thomasgubler@gmail.com> | 2014-03-27 22:34:23 +0100 |
---|---|---|
committer | Thomas Gubler <thomasgubler@gmail.com> | 2014-03-27 22:34:23 +0100 |
commit | d3ca12f136c9a890f7289d69bd783840dc86cfba (patch) | |
tree | b5901740ff0efb753e835535b66749b162469ca0 /src/modules/fw_pos_control_l1 | |
parent | d102afba8bdb526b85dce6dc47034ddd170d7240 (diff) | |
download | px4-firmware-d3ca12f136c9a890f7289d69bd783840dc86cfba.tar.gz px4-firmware-d3ca12f136c9a890f7289d69bd783840dc86cfba.tar.bz2 px4-firmware-d3ca12f136c9a890f7289d69bd783840dc86cfba.zip |
mtecs: BlockPDLimited: make sure dt > 0
Diffstat (limited to 'src/modules/fw_pos_control_l1')
-rw-r--r-- | src/modules/fw_pos_control_l1/mtecs/mTecs_blocks.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/modules/fw_pos_control_l1/mtecs/mTecs_blocks.h b/src/modules/fw_pos_control_l1/mtecs/mTecs_blocks.h index a357b24e2..6e90a82ba 100644 --- a/src/modules/fw_pos_control_l1/mtecs/mTecs_blocks.h +++ b/src/modules/fw_pos_control_l1/mtecs/mTecs_blocks.h @@ -193,7 +193,7 @@ public: virtual ~BlockPDLimited() {}; float update(float input) { float difference = 0.0f; - float output = getKP() * input + getKD() * getDerivative().update(input); + float output = getKP() * input + (getDerivative().getDt() > 0.0f ? getKD() * getDerivative().update(input) : 0.0f); getOutputLimiter().limit(output, difference); return output; |