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