Some parameter tuning

This commit is contained in:
Thomas Kolb 2016-08-21 19:06:20 +02:00
parent 9e353c3248
commit 6fc5a0e2c9

View file

@ -383,7 +383,7 @@ struct MPPState {
#define MPP_TEST_DURATION 10 /* ms */
#define MPP_TEST_STEPS 4
const int32_t mpp_pwm_offsets[MPP_TEST_STEPS] = {-51, -4, 5, 50};
const int32_t mpp_pwm_offsets[MPP_TEST_STEPS] = {-3, 4, -21, 20};
static void mpp_run(
uint32_t time_in_state, struct MPPState *mpp_state,
@ -529,7 +529,7 @@ int main(void)
fxp_t CURRENT_OFFSET = fxp_from_float(0.049);
/* if power changes by more than this factor, MPP is tested again */
MPP_MAX_POWER_CHANGE_FACTOR = fxp_from_float(0.1f);
MPP_MAX_POWER_CHANGE_FACTOR = fxp_from_float(0.2f);
power_state.vin_avg = 0;
power_state.vout_avg = 0;
@ -623,7 +623,7 @@ int main(void)
// disable converter
// enable bootstrap pulse with very low duty cycle
timer_set_oc_value(TIM1, TIM_CH_CONV, 0);
timer_set_oc_value(TIM1, TIM_CH_BOOTSTRAP, 48);
timer_set_oc_value(TIM1, TIM_CH_BOOTSTRAP, 24);
if(time_in_state >= 5) { // bootstrap duration in ms
iErr = fxp_div(IERR_LIMIT, fxp_from_int(2));