mirror of https://github.com/rusefi/bldc.git
Some flux integrator fixes and current gain adjustment
This commit is contained in:
parent
d87247bfee
commit
7b7db67506
|
@ -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
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
|
@ -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_ */
|
||||
|
|
4
mcpwm.c
4
mcpwm.c
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue