1
$\begingroup$

I try to implement a state observer (Luenberg Observer) to estimate the speed of my motor. Only the absolute position of the motor can be measured and I want to take into account also the target velocity as the input.

So my derived state space model looks like this:

The states are position, velocity and acceleration $$ x = \begin{pmatrix} p \\ v \\ a \end{pmatrix} $$

The Input is the velocity target vi minus the estimated velocity state:

$$ u=(v_i-v) $$

The system matrices looks like this (T is the sampling time): $$ A = \begin{pmatrix} 1 & T & \frac{T^2}{2} \\ 0 & 1 & T \\ 0 & 0 & 0 \end{pmatrix} $$

$$ B = \begin{pmatrix} T \\ 1 \\ \frac{1}{T} \end{pmatrix} $$

$$ C = \begin{pmatrix} 1 & 0 & 0 \end{pmatrix} $$

$$ D=0 $$

When I move the input -v into the A matrix, it looks like this:

$$ x_{k+1} = \begin{pmatrix} 1 & 0 & \frac{T^2}{2} \\ 0 & 0 & T \\ 0 & -\frac{1}{T} & 0 \end{pmatrix} x_k + \begin{pmatrix} T \\ 1 \\ \frac{1}{T} \end{pmatrix} v_i $$

$$ y_k= \begin{pmatrix} 1 & 0 & 0 \end{pmatrix} x_k $$

So I tried to place the poles of the error dynamics with a Luenberg observer by choosen L for:

$$ A-LC = \begin{pmatrix} 1-L_1 & 0 & \frac{T^2}{2} \\ -L2 & 0 & T \\ -L3 & -\frac{1}{T} & 0 \end{pmatrix} $$

I placed the poles in matlab as follows: $$ |\lambda_i|<1$$ at [-0.5,-0.55,-0.6]

Which gave me for L:

$$ L = \begin{pmatrix} 2.65 \\ 2.92 \times 10^3 \\ -1.9 \times 10^5 \end{pmatrix} $$

So I embedded this observer in the real system, but the results are actually very bad. So I think I did something wrong with the state space model, especially the input u seems not to be a good idea. Has anyone an idea how else I can model this system, especially about the input u I'm very unsure. Should I use the actual current as input for u, since this is proportional to the torque and so the acceleration?

Edit: What i further see is, that state a is not observable (Observability matrix has determinante different from zero), but since I don't want to observe the acceleration (I give this directly as an input), I think this should not be a problem, right?

Edit 2 Well, my Luenberger gains are pretty high, so I think that might be a problem. I update the state as follows:

$$ x_{k+1}=(A-LC)x_k + B v_i + Ly_k $$

y is my measured position at instance k, so let's say this is 4000 (12 bit encode resolution). Initially my states are zero. Then the acceleration will be directly 4000*(-1.9 * 10^5), huge! So I think I really messed up something here.

$\endgroup$
3
  • $\begingroup$ Is the observer fast enough? Rule of thumb for a Luenberg observer is, to place its poles about 10 times as fast as the system poles $\endgroup$ Sep 19 '18 at 14:17
  • $\begingroup$ Good question, I'm not sure about this. I need a bandwidth of 2kHz, how can I calculate the bandwidth of poles for a discrete transfer function? $\endgroup$ Sep 19 '18 at 14:20
  • $\begingroup$ Careful, at low speeds encoder based speed estimators can break down. If you are using a counter to measure time between encoder line, the counter size will limit your low end speed estimate. And the counter rate your upper end. $\endgroup$
    – docscience
    Oct 26 '18 at 1:06
1
$\begingroup$

Acceleration shouldn't be part of the state unless you jerk would be your input. And tracking a target velocity seems more of a job for the controller using feedback. So your system input is more likely a force, which induces an acceleration, and the states position and velocity.

Inorder for an observer to work well you need to provide it with a good model of your system. Namely the motor will likely have some friction and maybe even some delay. For obtaining a model you could for example try to fit a ARIMA model onto measured data or use ERA. The state space representation of a (minimal) LTI system is not unique, namely they are equivalent under a similarity transformation. So if it is desired to have a state vector with position and velocity, you could obtain this by using a similarity transformation.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.