Increased the temperature limit a bit

This commit is contained in:
Benjamin Vedder 2014-10-19 22:46:18 +02:00
parent f7cda79d1b
commit 978363ce51
2 changed files with 6 additions and 6 deletions

View File

@ -1595,14 +1595,14 @@ void mcpwm_adc_int_handler(void *p, uint32_t flags) {
v_diff = 0; v_diff = 0;
} }
static int zero_diff_iterations = 0; static int neg_diff_iterations = 0;
if (v_diff > 0) { if (v_diff > 0) {
cycle_integrator += (float)v_diff / switching_frequency_now; cycle_integrator += (float)v_diff / switching_frequency_now;
zero_diff_iterations = 0; neg_diff_iterations = 0;
} else { } else {
zero_diff_iterations++; neg_diff_iterations++;
if (zero_diff_iterations >= 2) { if (neg_diff_iterations >= 2) {
cycle_integrator = 0; cycle_integrator = 0;
} }
} }

View File

@ -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_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_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_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_START 90.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_END 110.0 // Temperature where everything should be shut off
// Speed PID parameters // Speed PID parameters
#define MCPWM_PID_TIME_K 0.001 // Pid controller sample time in seconds #define MCPWM_PID_TIME_K 0.001 // Pid controller sample time in seconds