mirror of https://github.com/rusefi/bldc.git
Increased the temperature limit a bit
This commit is contained in:
parent
f7cda79d1b
commit
978363ce51
8
mcpwm.c
8
mcpwm.c
|
@ -1595,14 +1595,14 @@ void mcpwm_adc_int_handler(void *p, uint32_t flags) {
|
|||
v_diff = 0;
|
||||
}
|
||||
|
||||
static int zero_diff_iterations = 0;
|
||||
static int neg_diff_iterations = 0;
|
||||
|
||||
if (v_diff > 0) {
|
||||
cycle_integrator += (float)v_diff / switching_frequency_now;
|
||||
zero_diff_iterations = 0;
|
||||
neg_diff_iterations = 0;
|
||||
} else {
|
||||
zero_diff_iterations++;
|
||||
if (zero_diff_iterations >= 2) {
|
||||
neg_diff_iterations++;
|
||||
if (neg_diff_iterations >= 2) {
|
||||
cycle_integrator = 0;
|
||||
}
|
||||
}
|
||||
|
|
4
mcpwm.h
4
mcpwm.h
|
@ -99,8 +99,8 @@ extern volatile int mcpwm_vzero;
|
|||
#define MCPWM_CURRENT_LIMIT_GAIN 1.0 // The error gain of the current limiting algorithm
|
||||
#define MCPWM_CMD_STOP_TIME 0 // Ignore commands for this duration in msec after a stop has been sent
|
||||
#define MCPWM_DETECT_STOP_TIME 500 // Ignore commands for this duration in msec after a detect command
|
||||
#define MCPWM_OVERTEMP_LIM_START 80.0 // Temperature where current limiting should begin
|
||||
#define MCPWM_OVERTEMP_LIM_END 100.0 // Temperature where everything should be shut off
|
||||
#define MCPWM_OVERTEMP_LIM_START 90.0 // Temperature where current limiting should begin
|
||||
#define MCPWM_OVERTEMP_LIM_END 110.0 // Temperature where everything should be shut off
|
||||
|
||||
// Speed PID parameters
|
||||
#define MCPWM_PID_TIME_K 0.001 // Pid controller sample time in seconds
|
||||
|
|
Loading…
Reference in New Issue