0
$\begingroup$

I have a dsp algorithm which is based on the below given state space model 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{L_M\cdot R_R}{L_L + L_M} & 0 \\ 0 & \frac{L_M\cdot R_R}{L_L + L_M} \end{bmatrix} \cdot \begin{bmatrix} i_{s_{\alpha}} \\ i_{s_{\beta}} \end{bmatrix} $$

It is basically a model of a dynamic system, where the variables $i_{s_{\alpha}}$, $i_{s_{\beta}}$ and $\omega_m$ are the inputs of the dynamic system and the $\hat{\psi}_{r_{\alpha}}$, $\hat{\psi}_{r_{\beta}}$ are its outputs (the unmeasurable state variables of the system). This model is intended to be used as a state observer. I know that there are much more robust approaches for estimation of the unmeasurable state variables of a dynamic system but I would like to do a comparison between several methods. As far as the parameters of the state space model: $R_S = 7.400\cdot 10^{-3}$, $R_R = 7.548\cdot 10^{-3}$, $L_M = 4.265\cdot 10^{-3}$, $L_L = 0.231\cdot 10^{-3}$, $p_p = 3.0$.

For the software implementation purposes it is necessary to discretize the continuous-time domain model (sampling period is $T = 100\cdot 10^{-6}\,\mathrm{s}$). I have been thinking about the simple Euler method (i.e. the state transition matrix $\Phi$ approximated only via the first two terms of the series expansion) usage. But I have noticed that the above given system is probably much more complex for computation than it seems at first glance. I have calculated the eigen values of the system matrix (i.e. poles of the system) in respect to the input $\omega_m$ and I have found that the poles are pretty near to the stability boundary in the s-plane.

enter image description here

If I transformed the system into the discrete form via the ZOH method I found that the system poles (in respect to the input $\omega_m$) are even nearly on the stability boundary.

enter image description here

My question is how I can implement this system in a software (in the single precision floating point) to be sure that the solution (the system state variables) will be stable?

Edit:

The idea behind my question is that I have noticed that the poles of the discretized system (zero-order hold discretization) are very close to the unit circle boundary (the "reserve" is only a couple of ten thousandths). Source of my doubt is that in case I implement the discrete system in a control software it is from my point of view very good chance that due to the limited precision the poles can move outside the unit circle and the system can become very easily unstable. On the other side the poles of the original continuous time domain system has its poles a little more far from the stability boundary. I have basically though about a discretization method which will preserve this reserve. The idea which I have is to use more terms of the approximation of the state transition matrix $\Phi$ which is used in the discretization process.

$\endgroup$
5
  • $\begingroup$ Well, the continuous-time poles are "nearly on" the stability boundary, too. Both continuous-time and discrete poles have a $Q$ of 25 or so. $\endgroup$
    – TimWescott
    Jan 18, 2023 at 16:23
  • $\begingroup$ What is this for? I.e., are you trying to design an observer for a real object, are you simulating something for science, are you simulating something for a game or training purposes, or what? This has bearing on how accurate the model needs to be and thus, how hard you need to try to get the model right. $\endgroup$
    – TimWescott
    Jan 18, 2023 at 16:27
  • $\begingroup$ @TimWescott thank you for your reaction. I have been trying to design an observer for a real object - namely a three phase induction motor. $\endgroup$
    – Steve
    Jan 18, 2023 at 18:14
  • $\begingroup$ I should have included this in my question -- edit your question to state this. It's a Stackexchange thing. $\endgroup$
    – TimWescott
    Jan 18, 2023 at 18:24
  • $\begingroup$ So, you've completely changed the thrust of the question -- it may be best to leave the original question standing and ask another one. I'll happily give you the long answer if you do. But the short answer is (A) no, you have not substantially changed the level of stability of your system; so (B) you're stuck with determining if it's good enough (likely), deliberately using a model with more damping, or using more precision (32-bit fixed numbers or double-precision floats). $\endgroup$
    – TimWescott
    Jan 19, 2023 at 15:27

1 Answer 1

1
$\begingroup$

Before you ask "will this model work?" you need to have answered "what is this model for?", and as part of that, "how accurate does this model need to be?".

In the case of a control system, part of that last question is "how accurate will this model ever be?"

In my personal experience, I've found that, usually, the errors introduced into the model by using the forward Euler method are significantly smaller than modeling errors introduced by going from the real system to the underlying differential equations. So while you can use the ZOH method, it just introduces complexity to the design process without adding relevant accuracy.

Note that I put all sorts of qualifiers in there -- it's never a bad thing to check for yourself. I have -- very occasionally -- needed to wrap control around some inner loop where (A) the necessary control dynamics were fast compared to the achievable sampling rate (usually because of constraints on the sensors or actuators), and (B) the inner loop was already precise enough that I could trust it not to vary much. In these rare cases I have used the ZOH method to model the inner loop.

Putting those corner cases aside, I've found that for this sort of thing you usually want to start with a rough model to get the loop working, then do system identification on actual hardware, from the perspective of the controller. This means building some measurement primitives into your software to gather responses to stimuli (step, swept-sine, or random), then taking measurements and analyzing the results. Then you want to estimate how much variation you'll see over aging, temperature, and manufacturing variations, and make your controller robust to those changes.

$\endgroup$
1
  • $\begingroup$ Thank you very much for your answer. Please see the edit section of my question. $\endgroup$
    – Steve
    Jan 19, 2023 at 8:12

This site is temporarily in read-only mode and not accepting new answers.

Not the answer you're looking for? Browse other questions tagged .