bldc/mcconf/mcconf_sten.h

60 lines
2.5 KiB
C
Raw Normal View History

2014-04-14 14:02:45 -07:00
/*
Copyright 2012-2014 Benjamin Vedder benjamin@vedder.se
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
/*
* mcconf_sten.h
*
* Created on: 14 apr 2014
* Author: benjamin
*/
#ifndef MCCONF_STEN_H_
#define MCCONF_STEN_H_
/*
* Parameters
*/
2014-05-06 09:50:41 -07:00
#define MCPWM_CURRENT_MAX 40.0 // Current limit in Amperes (Upper)
2014-06-13 05:35:34 -07:00
#define MCPWM_CURRENT_MIN -30.0 // Current limit in Amperes (Lower)
2014-05-01 12:20:53 -07:00
#define MCPWM_IN_CURRENT_MAX 25.0 // Input current limit in Amperes (Upper)
2014-04-14 14:02:45 -07:00
#define MCPWM_IN_CURRENT_MIN -25.0 // Input current limit in Amperes (Lower)
2014-06-13 05:35:34 -07:00
#define MCPWM_RPM_MAX 36250.0 // The motor speed limit (Upper) (29000 = 20kmh)
2014-06-07 12:11:02 -07:00
#define MCPWM_RPM_MIN -10000.0 // The motor speed limit (Lower)
2014-06-09 03:35:50 -07:00
#define MCPWM_MIN_VOLTAGE 15.0 // Minimum input voltage
2014-06-07 12:11:02 -07:00
#define MCPWM_MAX_VOLTAGE 50.0 // Maximum input voltage
#define MCPWM_CURRENT_CONTROL_NO_REV 1 // Do not reverse the direction in current control mode, brake only
2014-06-07 12:11:02 -07:00
#define MCPWM_CURRENT_STARTUP_BOOST 0.035 // The lowest duty cycle to use in current control mode (has to be > MCPWM_MIN_DUTY_CYCLE)
2014-06-09 03:35:50 -07:00
#define MCPWM_RPM_LIMIT_NEG_TORQUE 0 // Do not brake when going to fast, just stop applying torque
2014-04-14 14:02:45 -07:00
// Sensorless settings
#define MCPWM_IS_SENSORLESS 1 // Use sensorless commutation
2014-05-06 09:50:41 -07:00
#define MCPWM_MIN_RPM 300 // Auto-commutate below this RPM
2014-04-14 14:02:45 -07:00
#define MCPWM_CYCLE_INT_LIMIT_LOW 250.0 // Flux integrator limit 0 ERPM
#define MCPWM_CYCLE_INT_LIMIT_HIGH 30.0 // Flux integrator limit 50K ERPM
// Speed PID parameters
#define MCPWM_PID_KP 0.0001 // Proportional gain
#define MCPWM_PID_KI 0.002 // Integral gain
#define MCPWM_PID_KD 0.0 // Derivative gain
#define MCPWM_PID_MIN_RPM 1200.0 // Minimum allowed RPM
// Current control parameters
2014-05-06 09:50:41 -07:00
#define MCPWM_CURRENT_CONTROL_GAIN 0.0016 // Current controller error gain
2014-04-14 14:02:45 -07:00
#define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current
#endif /* MCCONF_STEN_H_ */