Kinetis SDK v.1.2 Demo Applications User's Guide  Rev. 0
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
motor_structure.h
Go to the documentation of this file.
1 /******************************************************************************
2 *
3 * Copyright (c) 2008 Freescale Semiconductor;
4 * All Rights Reserved
5 *
6 *******************************************************************************
7 *
8 * THIS SOFTWARE IS PROVIDED BY FREESCALE "AS IS" AND ANY EXPRESSED OR
9 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
10 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
11 * IN NO EVENT SHALL FREESCALE OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
12 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
13 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
14 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
15 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
16 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
17 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
18 * THE POSSIBILITY OF SUCH DAMAGE.
19 *
20 ***************************************************************************/
37 #ifndef _MCSTRUC_H_
38 #define _MCSTRUC_H_
39 
41 // Includes
43 
44 #include "SWLIBS_Defines.h"
45 
47 // Definitions
49 
51 #define UPDATE_TIME_EVENT_REQ 0x0001
52 #define UPDATE_DUTYCYCLE_REQ 0x0002
54 #define UPDATE_PWM_CONFIG_REQ 0x0004
56 #define UPDATE_PWM_DISABLE_REQ 0x0008
58 #define UPDATE_PWM_ALIGNMENT_REQ 0x0010
60 #define UPDATE_BRAKE_RESISTOR_ON_REQ 0x0020
62 
63 #define FAULT_UNDERVOLTAGE_F 0x0001
64 #define FAULT_OVERVOLTAGE_F 0x0002
65 #define FAULT_OVERCURRENT_F 0x0004
66 
70 typedef struct
71 {
72  GFLIB_CONTROLLER_PIAW_P_T_F16 trSpeedPI;
73  GFLIB_CONTROLLER_PIAW_P_T_F16 trCurrentPI;
74  GDFLIB_FILTER_MA_T_F16 trCurrentMaFilter;
75  GFLIB_RAMP_T_F32 f32trSpeedRamp;
76 
77  UInt16 uw16PeriodCmt[6];
78 
83 
87 
92  Frac16 f16SpeedPiErr;
103 
104 
106  Frac16 f16PhaseBemf;
108  Frac16 f16DutyCycle;
109 
110 
118 
119 
123 
125 
127 
131 
135 
137 
139 
146 
147 #endif /* _MCSTRUC_H_ */
148 
150 // EOF
152 
UInt16 uw16TimeCurrent
Definition: motor_structure.h:111
UInt16 uw16CurrentLimiting
Definition: motor_structure.h:134
Frac16 f16DcBusCurrent
Definition: motor_structure.h:95
Frac16 f16DcbVoltage
Definition: motor_structure.h:107
Frac16 f16SpeedRampOutput
Definition: motor_structure.h:91
UInt16 uw16Direction
Definition: motor_structure.h:132
Frac16 f16SpeedMinimal
Definition: motor_structure.h:90
Frac16 f16DutyCycle
Definition: motor_structure.h:108
Frac16 f16McatStartCmtAcceleration
Definition: motor_structure.h:141
GFLIB_CONTROLLER_PIAW_P_T_F16 trSpeedPI
Definition: motor_structure.h:72
Frac16 f16SpeedPiErr
Definition: motor_structure.h:92
Frac16 f16SpeedRequired
Definition: motor_structure.h:89
Frac16 f16CurrentPiErr
Definition: motor_structure.h:102
Frac32 f32IntegralBemfSum
Definition: motor_structure.h:80
GFLIB_RAMP_T_F32 f32trSpeedRamp
Definition: motor_structure.h:75
Frac32 f32IntegralBemfThreshold
Definition: motor_structure.h:81
Frac16 f16SpeedPiOutput
Definition: motor_structure.h:93
UInt16 uw16PeriodToff
Definition: motor_structure.h:117
UInt16 uw16CmtErrorCnt
Definition: motor_structure.h:129
UInt32 uw32McatCurrentScale
Added to be modifiable by MCAT.
Definition: motor_structure.h:84
Frac16 f16DcBusCurrentLimit
Definition: motor_structure.h:99
Frac32 f32DcBusCurrentAcc
Definition: motor_structure.h:79
UInt16 uw16PeriodCmtNext
Definition: motor_structure.h:116
UInt16 uw16CalibCounter
Definition: motor_structure.h:130
UInt16 uw16McatStartCmtCounter
Definition: motor_structure.h:142
UInt16 uw16FreewheelPeriodCurrentMs
Definition: motor_structure.h:120
UInt16 uw16McatPeriodToff
Definition: motor_structure.h:144
UInt32 uw32McatVoltageScale
Added to be modifiable by MCAT.
Definition: motor_structure.h:85
UInt16 uw16StartCmtCounter
Definition: motor_structure.h:126
Frac16 f16CurrentPiOutput
Definition: motor_structure.h:101
UInt32 uw32McatSpeedScale
Added to be modifiable by MCAT.
Definition: motor_structure.h:86
Frac16 f16DcBusCurrentAlign
Definition: motor_structure.h:98
UInt16 uw16McatAlignmentPeriodMs
Added to be modifiable by MCAT.
Definition: motor_structure.h:140
UInt16 uw16FreewheelPeriodLongMs
Definition: motor_structure.h:121
Int16 w16CmtSector
Definition: motor_structure.h:128
UInt16 uw16McatPeriodCmtNext
Definition: motor_structure.h:143
UInt16 uw16FreewheelPeriodShortMs
Definition: motor_structure.h:122
UInt16 uw16TimeNextEvent
Definition: motor_structure.h:113
UInt16 uw16TimeOfCommutationOld
Definition: motor_structure.h:115
UInt16 uw16TimeOfCommutation
Definition: motor_structure.h:114
UInt16 uw16AlignmentPeriodMs
Definition: motor_structure.h:124
BLDC Sensor-less with BEMF integration method.
Definition: motor_structure.h:70
Frac16 f16DcBusCurrentNoFiltered
Definition: motor_structure.h:94
UInt16 uw16TimeCurrentEvent
Definition: motor_structure.h:112
UInt16 uw16HwUpdateRequests
Definition: motor_structure.h:136
Frac16 f16DcBusCurrentOffset
Definition: motor_structure.h:97
UInt16 uw16FaultStatus
Definition: motor_structure.h:138
Frac16 f16PhaseVoltage
Definition: motor_structure.h:105
GFLIB_CONTROLLER_PIAW_P_T_F16 trCurrentPI
Definition: motor_structure.h:73
UInt16 uw16CommutatedSensorless
Definition: motor_structure.h:133
Frac16 f16DcBusCurrentRaw
Definition: motor_structure.h:96
GDFLIB_FILTER_MA_T_F16 trCurrentMaFilter
Definition: motor_structure.h:74
UInt32 uw32Period6CmtSum
Definition: motor_structure.h:82
Frac16 f16PhaseBemf
Definition: motor_structure.h:106
Frac16 f16DcBusCurrentZC
Definition: motor_structure.h:100
Frac16 f16SpeedMeasured
Definition: motor_structure.h:88