Some flux integrator fixes and current gain adjustment

This commit is contained in:
Benjamin Vedder 2014-08-07 19:52:07 +02:00
parent d87247bfee
commit 7b7db67506
5 changed files with 6 additions and 6 deletions

View File

@ -52,7 +52,7 @@
#define MCPWM_PID_MIN_RPM 1200.0 // Minimum allowed RPM
// Current control parameters
#define MCPWM_CURRENT_CONTROL_GAIN 0.0036 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current
// Hall sensor

View File

@ -51,7 +51,7 @@
#define MCPWM_PID_MIN_RPM 900.0 // Minimum allowed RPM
// Current control parameters
#define MCPWM_CURRENT_CONTROL_GAIN 0.0036 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current
#endif /* MCCONF_OUTRUNNER2_H_ */

View File

@ -58,7 +58,7 @@
#define MCPWM_PID_MIN_RPM 950.0 // Minimum allowed RPM
// Current control parameters
#define MCPWM_CURRENT_CONTROL_GAIN 0.0036 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_MIN 1.0 // Minimum allowed current
#endif /* MCCONF_RCCAR1_H_ */

View File

@ -56,7 +56,7 @@
#define MCPWM_PID_MIN_RPM 1200.0 // Minimum allowed RPM
// Current control parameters
#define MCPWM_CURRENT_CONTROL_GAIN 0.0036 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_GAIN 0.0046 // Current controller error gain
#define MCPWM_CURRENT_CONTROL_MIN 0.05 // Minimum allowed current
#endif /* MCCONF_STEN_H_ */

View File

@ -1434,10 +1434,10 @@ void mcpwm_adc_int_handler(void *p, uint32_t flags) {
if (has_commutated) {
limit = rpm_dep.cycle_int_limit_running * 0.0005;
} else {
limit = rpm_dep.cycle_int_limit * 0.0005;
limit = rpm_dep.cycle_int_limit * 0.0002;
}
if ((cycle_integrator >= MCPWM_CYCLE_INT_LIMIT_START * 0.0005 || pwm_cycles_sum > last_pwm_cycles_sum / 3.0 || !has_commutated)
if ((cycle_integrator >= (MCPWM_CYCLE_INT_LIMIT_START * 0.0005) || pwm_cycles_sum > last_pwm_cycles_sum / 3.0 || !has_commutated)
&& cycle_integrator >= limit) {
commutate();
cycle_integrator = CYCLE_INT_START;