mcconf_outrunner2.h
Go to the documentation of this file.
1 /*
2  Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se
3 
4  This program is free software: you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation, either version 3 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 /*
19  * mcconf_outrunner2.h
20  *
21  * A configuration for my scorpion 225kv outrunner.
22  *
23  * Created on: 14 apr 2014
24  * Author: benjamin
25  */
26 
27 #ifndef MCCONF_OUTRUNNER2_H_
28 #define MCCONF_OUTRUNNER2_H_
29 
30 /*
31  * Parameters
32  */
33 #define MCPWM_CURRENT_MAX 60.0 // Current limit in Amperes (Upper)
34 #define MCPWM_CURRENT_MIN -60.0 // Current limit in Amperes (Lower)
35 #define MCPWM_IN_CURRENT_MAX 60.0 // Input current limit in Amperes (Upper)
36 #define MCPWM_IN_CURRENT_MIN -20.0 // Input current limit in Amperes (Lower)
37 #define MCPWM_MAX_ABS_CURRENT 130.0 // The maximum absolute current above which a fault is generated
38 #define MCPWM_SLOW_ABS_OVERCURRENT 1 // Use the filtered (and hence slower) current for the overcurrent fault detection
39 
40 // Sensorless settings
41 #define MCPWM_SENSOR_MODE SENSOR_MODE_SENSORLESS // Sensor mode
42 #define MCPWM_MIN_RPM 150 // Auto-commutate below this RPM
43 #define MCPWM_CYCLE_INT_LIMIT_MIN_RPM 1100.0 // Minimum RPM to calculate the BEMF coupling from
44 #define MCPWM_CYCLE_INT_LIMIT 62.0 // Flux integrator limit 0 ERPM
45 #define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.8 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM
46 #define MCPWM_BEMF_INPUT_COUPLING_K 600.0 // Input voltage to bemf coupling constant
47 
48 // Speed PID parameters
49 #define MCPWM_PID_KP 0.0001 // Proportional gain
50 #define MCPWM_PID_KI 0.002 // Integral gain
51 #define MCPWM_PID_KD 0.0 // Derivative gain
52 #define MCPWM_PID_MIN_RPM 900.0 // Minimum allowed RPM
53 
54 // Position PID parameters
55 #define MCPWM_P_PID_KP 0.0001 // Proportional gain
56 #define MCPWM_P_PID_KI 0.002 // Integral gain
57 #define MCPWM_P_PID_KD 0.0 // Derivative gain
58 
59 // Current control parameters
60 #define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain
61 #define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current
62 
63 #endif /* MCCONF_OUTRUNNER2_H_ */