关于 kalman filter 中的参数整定

ref:

  • http://blog.sina.com.cn/s/blog_40edfdc90102ww2o.html
  • http://blog.sina.com.cn/s/blog_40edfdc90102xfex.html
  • http://blog.sina.com.cn/s/blog_40edfdc90102vhmw.html
  • http://blog.sina.com.cn/s/blog_40edfdc90102v5oa.html
  • https://en.wikipedia.org/wiki/Kalman_filter

状态与协方差的更新方式

  • 从 Kalman 滤波的公式中可以看出,状态与协方差的更新是相互独立的;所以在实现的过程中需要注意保证其协方差与状态的匹配;

Predict

  • Predicted (a priori) state estimate

x ^ k ∣ k − 1 = F k x ^ k − 1 ∣ k − 1 + B k u k x ^ k ∣ k − 1 = F k x ^ k − 1 ∣ k − 1 + B k u k {\displaystyle {\hat {\mathbf {x} }}_{k\mid k-1}=\mathbf {F} _{k}{\hat {\mathbf {x} }}_{k-1\mid k-1}+\mathbf {B} _{k}\mathbf {u} _{k}} {\displaystyle {\hat {\mathbf {x} }}_{k\mid k-1}=\mathbf {F} _{k}{\hat {\mathbf {x} }}_{k-1\mid k-1}+\mathbf {B} _{k}\mathbf {u} _{k}} x^kk1=Fkx^k1k1+Bkukx^kk1=Fkx^k1k1+Bkuk

  • Predicted (a priori) error covariance

P k ∣ k − 1 = F k P k − 1 ∣ k − 1 F k T + Q k P k ∣ k − 1 = F k P k − 1 ∣ k − 1 F k T + Q k {\displaystyle \mathbf {P} _{k\mid k-1}=\mathbf {F} _{k}\mathbf {P} _{k-1\mid k-1}\mathbf {F} _{k}^{\textsf {T}}+\mathbf {Q} _{k}} {\displaystyle \mathbf {P} _{k\mid k-1}=\mathbf {F} _{k}\mathbf {P} _{k-1\mid k-1}\mathbf {F} _{k}^{\textsf {T}}+\mathbf {Q} _{k}} Pkk1=FkPk1k1FkT+QkPkk1=FkPk1k1FkT+Qk

Update

  • Innovation or measurement pre-fit residual

y ~ k = z k − H k x ^ k ∣ k − 1 y ~ k = z k − H k x ^ k ∣ k − 1 {\displaystyle {\tilde {\mathbf {y} }}_{k}=\mathbf {z} _{k}-\mathbf {H} _{k}{\hat {\mathbf {x} }}_{k\mid k-1}} {\displaystyle {\tilde {\mathbf {y} }}_{k}=\mathbf {z} _{k}-\mathbf {H} _{k}{\hat {\mathbf {x} }}_{k\mid k-1}} y~k=zkHkx^kk1y~k=zkHkx^kk1

  • Innovation (or pre-fit residual) covariance

S k = R k + H k P k ∣ k − 1 H k T S k = R k + H k P k ∣ k − 1 H k T {\displaystyle \mathbf {S} _{k}=\mathbf {R} _{k}+\mathbf {H} _{k}\mathbf {P} _{k\mid k-1}\mathbf {H} _{k}^{\textsf {T}}} {\displaystyle \mathbf {S} _{k}=\mathbf {R} _{k}+\mathbf {H} _{k}\mathbf {P} _{k\mid k-1}\mathbf {H} _{k}^{\textsf {T}}} Sk=Rk+HkPkk1HkTSk=Rk+HkPkk1HkT

  • Optimal Kalman gain

K k = P k ∣ k − 1 H k T S k − 1 K k = P k ∣ k − 1 H k T S k − 1 {\displaystyle \mathbf {K} _{k}=\mathbf {P} _{k\mid k-1}\mathbf {H} _{k}^{\textsf {T}}\mathbf {S} _{k}^{-1}} {\displaystyle \mathbf {K} _{k}=\mathbf {P} _{k\mid k-1}\mathbf {H} _{k}^{\textsf {T}}\mathbf {S} _{k}^{-1}} Kk=Pkk1HkTSk1Kk=Pkk1HkTSk1

  • Updated (a posteriori) state estimate
    x ^ k ∣ k = x ^ k ∣ k − 1 + K k y ~ k x ^ k ∣ k = x ^ k ∣ k − 1 + K k y ~ k {\displaystyle {\hat {\mathbf {x} }}_{k\mid k}={\hat {\mathbf {x} }}_{k\mid k-1}+\mathbf {K} _{k}{\tilde {\mathbf {y} }}_{k}} {\hat {\mathbf {x} }}_{k\mid k}={\hat {\mathbf {x} }}_{k\mid k-1}+\mathbf {K} _{k}{\tilde {\mathbf {y} }}_{k} x^kk=x^kk1+Kky~kx^kk=x^kk1+Kky~k

  • Updated (a posteriori) estimate covariance

P k ∣ k = ( I − K k H k ) P k ∣ k − 1 P k ∣ k = ( I − K k H k ) P k ∣ k − 1 {\displaystyle \mathbf {P} _{k|k}=\left(\mathbf {I} -\mathbf {K} _{k}\mathbf {H} _{k}\right)\mathbf {P} _{k|k-1}} {\displaystyle \mathbf {P} _{k|k}=\left(\mathbf {I} -\mathbf {K} _{k}\mathbf {H} _{k}\right)\mathbf {P} _{k|k-1}} Pkk=(IKkHk)Pkk1Pkk=(IKkHk)Pkk1

  • Updated (a posteriori) estimate covariance Joseph form 数值稳定

P k ∣ k = ( I − K k H k ) P k ∣ k − 1 ( I − K k H k ) T + K k R k K k T P k ∣ k = ( I − K k H k ) P k ∣ k − 1 ( I − K k H k ) T + K k R k K k T {\displaystyle \mathbf {P} _{k|k}=\left(\mathbf {I} -\mathbf {K} _{k}\mathbf {H} _{k}\right)\mathbf {P} _{k|k-1}\left(\mathbf {I} -\mathbf {K} _{k}\mathbf {H} _{k}\right)^{\textsf {T}}+\mathbf {K} _{k}\mathbf {R} _{k}\mathbf {K} _{k}^{\textsf {T}}} {\displaystyle \mathbf {P} _{k|k}=\left(\mathbf {I} -\mathbf {K} _{k}\mathbf {H} _{k}\right)\mathbf {P} _{k|k-1}\left(\mathbf {I} -\mathbf {K} _{k}\mathbf {H} _{k}\right)^{\textsf {T}}+\mathbf {K} _{k}\mathbf {R} _{k}\mathbf {K} _{k}^{\textsf {T}}} Pkk=(IKkHk)Pkk1(IKkHk)T+KkRkKkTPkk=(IKkHk)Pkk1(IKkHk)T+KkRkKkT

  • Measurement post-fit residual

y ~ k ∣ k = z k − H k x ^ k ∣ k y ~ k ∣ k = z k − H k x ^ k ∣ k {\displaystyle {\tilde {\mathbf {y} }}_{k\mid k}=\mathbf {z} _{k}-\mathbf {H} _{k}{\hat {\mathbf {x} }}_{k\mid k}} {\displaystyle {\tilde {\mathbf {y} }}_{k\mid k}=\mathbf {z} _{k}-\mathbf {H} _{k}{\hat {\mathbf {x} }}_{k\mid k}} y~kk=zkHkx^kky~kk=zkHkx^kk

残差校验

  • 残差校验部分主要的作用是排除掉有害数据的影响;
  • 对于野值、或者某些模态下的有害数据,应该通过 残差校验 或其他方式,防止其进入滤波器;
  • 主要方法包括 χ 2 \chi^2 χ2 校验、观测残差、残差导数等。

噪声模型的限制

  • 对于有残差校验的滤波器,应该限制噪声上限,防止大噪声量测污染状态量;
  • 对于某些有害的量测数据,应防止其进入滤波器;(某些状态下的量测对状态有害无益)
  • 考虑使用信噪比描述量测,从而切除有害量测;

KeyPoint

  • 不要迷信状态协方差对状态的不确定性描述,如果没有相应的自适应措施,协方差对状态的描述越精确,精度越高,鲁棒性越差;
  • 参数的整定主要保证量测更新时,状态和协方差能够合理的分配新息,同时,需注意保证适量的过程噪声以保证系统鲁棒性。

你可能感兴趣的:(算法)