AM243x Motor Control SDK  09.02.00
motor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2024 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 
33 #ifndef MOTOR_H
34 #define MOTOR_H
35 
36 #ifdef __cplusplus
37 extern "C"
38 {
39 #endif
40 
51 // the includes
52 #include "math_types.h"
53 
54 
55 // **************************************************************************
56 // the defines
57 
58 
59 // **************************************************************************
60 // the typedefs
61 
62 
63 //
66 typedef enum
67 {
69  MOTOR_TYPE_PM = 1
71 
72 //
74 //
75 typedef enum
76 {
80 
81 
82 //
84 //
85 typedef enum
86 {
93 
94 //
96 //
97 typedef enum
98 {
103  OPERATE_MODE_POWER = 4
105 
107 //
108 typedef enum
109 {
115  SAMPLE_MODE_SDFM = 5
117 
118 // State machine typedef for motor running status
119 typedef enum
120 {
134  MOTOR_RS_RECALC = 13
136 
138 //
139 typedef enum
140 {
152  MOTOR_CTRL_RSCALC = 11
154 
157 typedef struct _MOTOR_Params_
158 {
160 
161  uint_least16_t numPolePairs;
162 
166 
169 
172 
174 } MOTOR_Params;
175 
176 //*****************************************************************************
177 //
178 // Close the Doxygen group.
180 //
181 //*****************************************************************************
182 
183 //*****************************************************************************
184 //
185 // Mark the end of the C bindings section for C++ compilers.
186 //
187 //*****************************************************************************
188 #ifdef __cplusplus
189 }
190 #endif
191 
192 #endif // end of MOTOR_LIB_H definition
193 
194 
195 
196 
197 
OPERATE_MODE_SCALAR
@ OPERATE_MODE_SCALAR
V/f scalar control.
Definition: motor.h:99
SAMPLE_Mode_e
SAMPLE_Mode_e
Enumeration for the estimator mode.
Definition: motor.h:109
MOTOR_CL_RUNNING
@ MOTOR_CL_RUNNING
Definition: motor.h:130
MOTOR_RUN_FWC
@ MOTOR_RUN_FWC
Definition: motor.h:132
MOTOR_Params::ratedFlux_Wb
float32_t ratedFlux_Wb
Defines the rated flux, Wb.
Definition: motor.h:173
MOTOR_FAULT_STOP
@ MOTOR_FAULT_STOP
Definition: motor.h:122
MOTOR_BRAKE_STOP
@ MOTOR_BRAKE_STOP
Definition: motor.h:123
MOTOR_IPD_HFI
@ MOTOR_IPD_HFI
Definition: motor.h:128
MOTOR_CTRL_RUN
@ MOTOR_CTRL_RUN
Definition: motor.h:131
MOTOR_Status_e
MOTOR_Status_e
Definition: motor.h:120
MOTOR_Params::Rr_d_Ohm
float32_t Rr_d_Ohm
Defines the direct rotor resistance, Ohm.
Definition: motor.h:167
MOTOR_CTRL_TORQUE_CW
@ MOTOR_CTRL_TORQUE_CW
(0100), CW spin with torque control
Definition: motor.h:145
FlyingStart_Mode_e
FlyingStart_Mode_e
Enumeration for the Flying Start Mode.
Definition: motor.h:76
OPERATE_MODE_TORQUE
@ OPERATE_MODE_TORQUE
Torque control running mode.
Definition: motor.h:101
MOTOR_RS_RECALC
@ MOTOR_RS_RECALC
Definition: motor.h:134
MOTOR_TYPE_INDUCTION
@ MOTOR_TYPE_INDUCTION
induction
Definition: motor.h:68
MOTOR_CTRL_IDENTIFy
@ MOTOR_CTRL_IDENTIFy
(1010), Motor parameters identification
Definition: motor.h:151
MOTOR_CTRL_FREQ_CW
@ MOTOR_CTRL_FREQ_CW
(0010), CW spin with speed closed-loop (Hz)
Definition: motor.h:143
MOTOR_SEEK_POS
@ MOTOR_SEEK_POS
Definition: motor.h:126
MOTOR_CTRL_TORQUE_CCW
@ MOTOR_CTRL_TORQUE_CCW
(0101), CCW spin with torque control
Definition: motor.h:146
MOTOR_Params::Ls_d_H
float32_t Ls_d_H
Defines the direct stator inductance, H.
Definition: motor.h:164
SAMPLE_MODE_SDFM
@ SAMPLE_MODE_SDFM
sdfm
Definition: motor.h:115
MOTOR_CTRL_SPEED_CCW
@ MOTOR_CTRL_SPEED_CCW
(0111), CCW spin with speed closed-loop (rpm)
Definition: motor.h:148
SAMPLE_MODE_DCLINK
@ SAMPLE_MODE_DCLINK
dclink_ss
Definition: motor.h:112
OPERATE_MODE_SPEED
@ OPERATE_MODE_SPEED
Speed closed-loop running mode.
Definition: motor.h:102
MOTOR_CHARGE
@ MOTOR_CHARGE
Definition: motor.h:125
BRAKE_Mode_e
BRAKE_Mode_e
Enumeration for the braking Mode.
Definition: motor.h:86
FREE_STOP_MODE
@ FREE_STOP_MODE
Free stop mode without braking.
Definition: motor.h:87
SAMPLE_MODE_DCSS4
@ SAMPLE_MODE_DCSS4
dclink_ss4
Definition: motor.h:111
MOTOR_Params::type
MOTOR_Type_e type
Defines the motor type.
Definition: motor.h:159
MOTOR_IDENTIFICATION
@ MOTOR_IDENTIFICATION
Definition: motor.h:133
MOTOR_Params::Rr_q_Ohm
float32_t Rr_q_Ohm
Defines the quadrature rotor resistance, Ohm.
Definition: motor.h:168
MOTOR_Params::Lmag_H
float32_t Lmag_H
Defines the magnetizing inductance, H.
Definition: motor.h:163
MOTOR_Type_e
MOTOR_Type_e
Enumeration for the motor types.
Definition: motor.h:67
SAMPLE_MODE_3LSR
@ SAMPLE_MODE_3LSR
three_shunt
Definition: motor.h:113
FLYINGSTART_MODE_STANDBY
@ FLYINGSTART_MODE_STANDBY
Standby Mode.
Definition: motor.h:78
MOTOR_CTRL_URGENT_STOP
@ MOTOR_CTRL_URGENT_STOP
(1001), urgent stop
Definition: motor.h:150
OPERATE_MODE_POWER
@ OPERATE_MODE_POWER
Constant power running mode.
Definition: motor.h:103
MOTOR_STOP_IDLE
@ MOTOR_STOP_IDLE
Definition: motor.h:121
MOTOR_CTRL_SPEED_CW
@ MOTOR_CTRL_SPEED_CW
(0110), CW spin with speed closed-loop (rpm)
Definition: motor.h:147
MOTOR_Params::Ls_q_H
float32_t Ls_q_H
Defines the quadrature stator inductance, H.
Definition: motor.h:165
MOTOR_CTRL_BRAKE_STOP
@ MOTOR_CTRL_BRAKE_STOP
(0001), Stop the motor with braking mode
Definition: motor.h:142
MOTOR_NORM_STOP
@ MOTOR_NORM_STOP
Definition: motor.h:124
MOTOR_Params::numPolePairs
uint_least16_t numPolePairs
Defines the number of pole pairs.
Definition: motor.h:161
MOTOR_OL_START
@ MOTOR_OL_START
Definition: motor.h:129
MOTOR_CTRL_FREQ_CCW
@ MOTOR_CTRL_FREQ_CCW
(0011), CCW spin with speed closed-loop (Hz)
Definition: motor.h:144
MOTOR_CTRL_DEBUG_CHECK
@ MOTOR_CTRL_DEBUG_CHECK
(1000), debug monitor
Definition: motor.h:149
DYNAMIC_BRAKE_MODE
@ DYNAMIC_BRAKE_MODE
N/A, Dynamic braking mode.
Definition: motor.h:90
SAMPLE_MODE_3INL
@ SAMPLE_MODE_3INL
inline
Definition: motor.h:114
FLYINGSTART_MODE_HALT
@ FLYINGSTART_MODE_HALT
Halt Mode.
Definition: motor.h:77
MOTOR_CtrlMode_e
MOTOR_CtrlMode_e
Enumeration for the motor drive control state.
Definition: motor.h:140
HARDSWITCH_BRAKE_MODE
@ HARDSWITCH_BRAKE_MODE
Hard switch braking mode.
Definition: motor.h:88
MOTOR_Params::Rs_d_Ohm
float32_t Rs_d_Ohm
Defines the direct stator resistance, Ohm.
Definition: motor.h:170
MOTOR_CTRL_FREE_STOP
@ MOTOR_CTRL_FREE_STOP
(0000), Stop the motor with free mode
Definition: motor.h:141
MOTOR_Params
Defines the motor parameters.
Definition: motor.h:158
SAMPLE_MODE_DCSS2
@ SAMPLE_MODE_DCSS2
dclink_ss2
Definition: motor.h:110
MOTOR_ALIGNMENT
@ MOTOR_ALIGNMENT
Definition: motor.h:127
MOTOR_TYPE_PM
@ MOTOR_TYPE_PM
permanent magnet
Definition: motor.h:69
float32_t
float float32_t
Definition: dcl_common.h:58
REGENERATION_BRAKE_MODE
@ REGENERATION_BRAKE_MODE
N/A, Regeneration braking mode.
Definition: motor.h:91
OPERATE_MODE_VQCL
@ OPERATE_MODE_VQCL
Vq direction control.
Definition: motor.h:100
OPERATE_Mode_e
OPERATE_Mode_e
Enumeration for the control mode.
Definition: motor.h:98
MOTOR_CTRL_RSCALC
@ MOTOR_CTRL_RSCALC
(1011), Rs recalculation
Definition: motor.h:152
FORCESTOP_BRAKE_MODE
@ FORCESTOP_BRAKE_MODE
Force alignment braking mode.
Definition: motor.h:89
MOTOR_Params::Rs_q_Ohm
float32_t Rs_q_Ohm
Defines the quadrature stator resistance, Ohm.
Definition: motor.h:171