mcconf_sten.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_sten.h
20  *
21  * Created on: 14 apr 2014
22  * Author: benjamin
23  */
24 
25 #ifndef MCCONF_STEN_H_
26 #define MCCONF_STEN_H_
27 
28 /*
29  * Parameters
30  */
31 #define MCPWM_CURRENT_MAX 35.0 // Current limit in Amperes (Upper)
32 #define MCPWM_CURRENT_MIN -30.0 // Current limit in Amperes (Lower)
33 #define MCPWM_MAX_ABS_CURRENT 100.0 // The maximum absolute current above which a fault is generated
34 #define MCPWM_SLOW_ABS_OVERCURRENT 1 // Use the filtered (and hence slower) current for the overcurrent fault detection
35 #define MCPWM_IN_CURRENT_MAX 25.0 // Input current limit in Amperes (Upper)
36 #define MCPWM_IN_CURRENT_MIN -20.0 // Input current limit in Amperes (Lower)
37 #define MCPWM_RPM_MAX 80000.0 // The motor speed limit (Upper)
38 #define MCPWM_RPM_MIN -80000.0 // The motor speed limit (Lower)
39 #define MCPWM_MIN_VOLTAGE 20.0 // Minimum input voltage
40 #define MCPWM_MAX_VOLTAGE 50.0 // Maximum input voltage
41 #define MCPWM_CURRENT_STARTUP_BOOST 0.02 // The lowest duty cycle to use in current control mode (has to be > MCPWM_MIN_DUTY_CYCLE)
42 #define MCPWM_RPM_LIMIT_NEG_TORQUE 0 // Use negative torque to limit the RPM
43 #define MCPWM_CURR_MAX_RPM_FBRAKE 1500 // Maximum electrical RPM to use full brake at
44 
45 // Sensorless settings
46 #define MCPWM_SENSOR_MODE SENSOR_MODE_SENSORLESS // Sensor mode
47 #define MCPWM_MIN_RPM 250 // Auto-commutate below this RPM
48 #define MCPWM_CYCLE_INT_LIMIT_MIN_RPM 500.0 // Minimum RPM to calculate the BEMF coupling from
49 #define MCPWM_CYCLE_INT_LIMIT 80.0 // Flux integrator limit 0 ERPM
50 #define MCPWM_CYCLE_INT_LIMIT_HIGH_FAC 0.8 // Flux integrator limit percentage at MCPWM_CYCLE_INT_START_RPM_BR ERPM
51 #define MCPWM_BEMF_INPUT_COUPLING_K 750.0 // Input voltage to bemf coupling constant
52 
53 // Speed PID parameters
54 #define MCPWM_PID_KP 0.0001 // Proportional gain
55 #define MCPWM_PID_KI 0.002 // Integral gain
56 #define MCPWM_PID_KD 0.0 // Derivative gain
57 #define MCPWM_PID_MIN_RPM 1200.0 // Minimum allowed RPM
58 
59 // Position PID parameters
60 #define MCPWM_P_PID_KP 0.0001 // Proportional gain
61 #define MCPWM_P_PID_KI 0.002 // Integral gain
62 #define MCPWM_P_PID_KD 0.0 // Derivative gain
63 
64 // Current control parameters
65 #define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain
66 #define MCPWM_CURRENT_CONTROL_MIN 0.05 // Minimum allowed current
67 
68 #endif /* MCCONF_STEN_H_ */