AM243x Motor Control SDK  09.02.00
dcl_stability.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 Texas Instruments Incorporated - https://www.ti.com/
3  *
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
34 #ifndef _DCL_STABILITY_H_
35 #define _DCL_STABILITY_H_
36 
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40 
49 //--- Polynomial stability functions -----------------------------------------
50 
59 {
60  return ((a1 * a1) < 1.0f);
61 }
62 
73 {
74  float32_t b0, b1, c0;
75 
76  b0 = a0 - a2 * a2 / a0;
77  b1 = a1 - a1 * a2 / a0;
78  c0 = b0 - b1 * b1 / b0;
79 
80  return ((a0 > 0.0f) && (b0 > 0.0f) && (c0 > 0.0f));
81 }
82 
94 {
95  float32_t b0, b1, b2, c0, c1, d0;
96 
97  b0 = a0 - a3 * a3 / a0;
98  b1 = a1 - a2 * a3 / a0;
99  b2 = a2 - a1 * a3 / a0;
100  c0 = b0 - b2 * b2 / b0;
101  c1 = b1 - b1 * b2 / b0;
102  d0 = c0 - c1 * c1 / c0;
103 
104  return ((a0 > 0.0f) && (b0 > 0.0f) && (c0 > 0.0f) && (d0 > 0.0f));
105 }
106 
107 /*
110 extern bool DCL_isStableZpk3(DCL_ZPK3 *q);
111 */
112 
115 #ifdef __cplusplus
116 }
117 #endif // extern "C"
118 
119 #endif // _DCL_STABILITY_H_
DCL_isStablePn3
_DCL_CODE_ACCESS bool DCL_isStablePn3(float32_t a0, float32_t a1, float32_t a2, float32_t a3)
Determines stability of a third order polynomial with real coefficients P(z) = a0 z^3 + a1 z^2 + a2 z...
Definition: dcl_stability.h:93
DCL_isStablePn2
_DCL_CODE_ACCESS bool DCL_isStablePn2(float32_t a0, float32_t a1, float32_t a2)
Determines stability of a second order polynomial with real coefficients P(z) = a0 z^2 + a1 z + a2.
Definition: dcl_stability.h:72
_DCL_CODE_ACCESS
#define _DCL_CODE_ACCESS
Defines the scope of dcl functions.
Definition: dcl_common.h:63
DCL_isStablePn1
_DCL_CODE_ACCESS bool DCL_isStablePn1(float32_t a1)
Determines stability of a first order real polynomial P(z) = z + a1.
Definition: dcl_stability.h:58
float32_t
float float32_t
Definition: dcl_common.h:58