Browse Source

Slower transition from CV voltage to FLT voltage

master
Thomas Kolb 2 years ago
parent
commit
c87a72f988
  1. 6
      src/main.c

6
src/main.c

@ -28,6 +28,8 @@
#define ADC_VALUE_AT_ZERO_CURRENT 90
#define TIME_FROM_CV_TO_FLT 300000
enum OperState {
Bootstrap,
ConvConstVoltage,
@ -848,10 +850,10 @@ int main(void)
break;
case ConvFloat:
if(time_in_state < 120000) {
if(time_in_state < TIME_FROM_CV_TO_FLT) {
setPoint =
fxp_add(CONST_VOLTAGE,
fxp_mult(fxp_sub(CONST_FLOAT_VOLTAGE, CONST_VOLTAGE), fxp_div(time_in_state, 120000)));
fxp_mult(fxp_sub(CONST_FLOAT_VOLTAGE, CONST_VOLTAGE), fxp_div(time_in_state, TIME_FROM_CV_TO_FLT)));
} else {
setPoint = CONST_FLOAT_VOLTAGE;
}

Loading…
Cancel
Save