# How to choose appropriate discretization method for the state estimator?

Let's say I have following open loop state estimator of a dynamic system in the continuous time domain

$$\begin{bmatrix} \frac{\mathrm{d}\hat{\psi}_{r_\alpha}}{\mathrm{d}t} \\ \frac{\mathrm{d}\hat{\psi}_{r_\beta}}{\mathrm{d}t} \end{bmatrix} = \begin{bmatrix} -\frac{R_R}{L_L + L_M} & -p_p\cdot\omega_m \\ p_p\cdot\omega_m & -\frac{R_R}{L_L + L_M} \end{bmatrix} \cdot \begin{bmatrix} \hat{\psi}_{r_\alpha} \\ \hat{\psi}_{r_\beta} \end{bmatrix} + \begin{bmatrix} \frac{LM\cdot R_R}{L_L + L_M} & 0 \\ 0 & \frac{LM\cdot R_R}{L_L + L_M} \end{bmatrix} \cdot \begin{bmatrix} i_{s_\alpha} \\ i_{s_\beta} \end{bmatrix}$$

$$\dot{\mathbf{x}}(t) = \mathbf{A}\cdot\mathbf{x}(t) + \mathbf{B}\cdot\mathbf{u}(t)$$

I need to calculate the state estimate in my DSP so I have to discretize the above mentioned continuous estimator. Let's say I have decided to use the forward rectangular rule due to its simplicity without any previous analysis i.e. I have following discrete version of the estimator

$$\begin{bmatrix} \hat{\psi}_{r_\alpha}(k) \\ \hat{\psi}_{r_\beta}(k) \end{bmatrix} = \begin{bmatrix} 1-\frac{R_R}{L_L + L_M}\cdot T & -p_p\cdot\omega_m\cdot T \\ p_p\cdot\omega_m \cdot T & 1-\frac{R_R}{L_L + L_M}\cdot T \end{bmatrix} \cdot \begin{bmatrix} \hat{\psi}_{r_\alpha}(k-1) \\ \hat{\psi}_{r_\beta}(k-1) \end{bmatrix} + \begin{bmatrix} \frac{LM\cdot R_R}{L_L + L_M}\cdot T & 0 \\ 0 & \frac{LM\cdot R_R}{L_L + L_M}\cdot T \end{bmatrix} \cdot \begin{bmatrix} i_{s_\alpha}(k-1) \\ i_{s_\beta}(k-1) \end{bmatrix}$$

$$\mathbf{x}(k) = \mathbf{\Phi}\cdot\mathbf{x}(k-1) + \mathbf{\Gamma}\cdot\mathbf{u}(k-1)$$

(I have exploited following approximations: $$\mathbf{\Phi}\approx\mathbf{I}+\mathbf{A}\cdot T$$, $$\mathbf{\Gamma}\approx\mathbf{B}\cdot T$$)

The estimator is refreshed each sampling period i.e. $$T = 100\,\mu s$$. I am going to use that estimator for estimation of the unmeasurable state variables of a dynamic system i.e. I don't know exactly the actual values of the estimated variables $$\psi_{r_\alpha}, \psi_{r_\beta}$$. Despite that I know approximately their magnitudes in the steady state. I have implemented the estimator and let him to calculate the estimates of the state variables. Unfortunately I have found the the magnitudes of the estimated state variables are approximately three times higher than the magnitudes I have expected.

• System input

• State estimate

My question is whether that behavior can be caused by the inappropriate discretization method (the forward rectangular rule) for my case i.e. the set of differential equations, sampling period and level of noise present on the input signals?

• You do not show your measurement matrix, nor have you given us a sense of the scale of your matrix elements. In general, if the eigenvalues of $\mathbf \Phi$ are close to the eigenvalues of $e^{\mathbf A T}$ then you have some other problem in your state estimation. Dec 7, 2021 at 16:18