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
BLDC_appconfig.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 - 2014, Freescale Semiconductor, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without modification,
6  * are permitted provided that the following conditions are met:
7  *
8  * o Redistributions of source code must retain the above copyright notice, this list
9  * of conditions and the following disclaimer.
10  *
11  * o Redistributions in binary form must reproduce the above copyright notice, this
12  * list of conditions and the following disclaimer in the documentation and/or
13  * other materials provided with the distribution.
14  *
15  * o Neither the name of Freescale Semiconductor, Inc. nor the names of its
16  * contributors may be used to endorse or promote products derived from this
17  * software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
20  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
21  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
23  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
24  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
25  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
28  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 /**********************************************************************/
32 // File Name: {FM_project_loc}/../../src/projects/kv10/BLDC_Sensorless/BLDC_appconfig.h
33 //
34 // Date: 18. February, 2014
35 //
36 // Automatically generated file for static configuration of the BLDC application
37 /**********************************************************************/
38 
39 #ifndef __BLDC_CONFIG_SETUP_H
40 #define __BLDC_CONFIG_SETUP_H
41 
42 
43 //Motor Parameters
44 //----------------------------------------------------------------------
45 //Pole-pair number = 2 [-]
46 //Back-EMF constant = 0.028648 [V.sec/rad]
47 //Phase current nominal FRAC16(0.208750000000)
48 //Phase voltage nominal FRAC16(0.661157024793)
49 //----------------------------------------------------------------------
50 
51 //Application scales
52 #define I_MAX (8.0)
53 #define U_DCB_MAX (36.3)
54 #define N_MAX (5000.0)
55 #define I_DCB_OVERCURRENT FRAC16(0.875000000000)
56 #define U_DCB_UNDERVOLTAGE FRAC16(0.220385674931)
57 #define U_DCB_OVERVOLTAGE FRAC16(0.826446280992)
58 #define I_DCB_LIMIT FRAC16(0.375000000000)
59 #define U_DCB_TRIP FRAC16(0.771349862259)
60 #define N_NOM FRAC16(0.800000000000)
61 #define I_PH_NOM FRAC16(0.208750000000)
62 #define U_PH_NOM FRAC16(0.661157024793)
63 //Mechanical Alignemnt
64 #define ALIGN_CURRENT FRAC16(0.250000000000)
65 #define ALIGN_DURATION (400)
66 
67 //BLDC Control Loop
68 //----------------------------------------------------------------------
69 //Loop sample time = 0.001 [sec]
70 //----------------------------------------------------------------------
71 //Control loop limits
72 #define CTRL_LOOP_LIM_HIGH FRAC16(0.900000000000)
73 #define CTRL_LOOP_LIM_LOW FRAC16(0.0)
74 
75 //Speed Controller - Parallel type
76 #define SPEED_LOOP_KP_GAIN FRAC16(0.502654824574)
77 #define SPEED_LOOP_KP_SHIFT (-7)
78 #define SPEED_LOOP_KI_GAIN FRAC16(0.502654824574)
79 #define SPEED_LOOP_KI_SHIFT (-7)
80 
81 //Speed ramp increments
82 #define SPEED_LOOP_RAMP_UP FRAC32(0.004000000000)
83 #define SPEED_LOOP_RAMP_DOWN FRAC32(0.004000000000)
84 
85 //Torque Controller - Parallel type
86 #define TORQUE_LOOP_KP_GAIN FRAC16(0.502126721763)
87 #define TORQUE_LOOP_KP_SHIFT (-7)
88 #define TORQUE_LOOP_KI_GAIN FRAC16(0.502126721763)
89 #define TORQUE_LOOP_KI_SHIFT (-7)
90 #define TORQUE_LOOP_MAF (5)
91 
92 //Sensoroless Control Module
93 //----------------------------------------------------------------------
94 //Timer Frequency = 562500 [Hz]
95 //----------------------------------------------------------------------
96 #define N_MIN FRAC16(0.050000000000)
97 #define N_START_TRH FRAC16(0.072000000000)
98 #define STARTUP_CMT_CNT (8)
99 #define STARTUP_CMT_PER (22500)
100 #define CMT_T_OFF FRAC16(0.220000000000)
101 #define FREEWHEEL_T_LONG (1000)
102 #define FREEWHEEL_T_SHORT (500)
103 #define SPEED_SCALE_CONST (3375)
104 #define CMT_PER_MIN (563)
105 #define START_CMT_ACCELER FRAC16(0.859750628053)
106 #define INTEG_TRH (40622)
107 
108 //FreeMASTER Scale Variables
109 //----------------------------------------------------------------------
110 //Note: Scaled at input = 1000
111 //----------------------------------------------------------------------
112 #define FM_I_SCALE (8000)
113 #define FM_U_DCB_SCALE (36300)
114 #define FM_N_SCALE (5000000)
115 
116 #endif
117 /**********************************************************************/
118 /**********************************************************************/