|
|
|
|
@ -1078,14 +1078,14 @@ if (firstTime != ON)
|
|
|
|
|
|
|
|
|
|
printf("IHUcpuTemp: %d \n", IHUcpuTemp);
|
|
|
|
|
|
|
|
|
|
voltage[map[BUS]] = rnd_float(4.99, 5.01);
|
|
|
|
|
voltage[map[BUS]] = rnd_float(4.995, 5.005);
|
|
|
|
|
current[map[BUS]] = rnd_float(158, 171);
|
|
|
|
|
|
|
|
|
|
// float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]];
|
|
|
|
|
float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0));
|
|
|
|
|
printf("Charging: %f \n", charging);
|
|
|
|
|
current[map[BAT]] = (current[map[BUS]] * voltage[map[BUS]] / (voltage[map[BAT]] * 0.95)) - charging;
|
|
|
|
|
batt -= (batt > 3.5) ? current[map[BAT]]/20000: current[map[BAT]]/2000;
|
|
|
|
|
batt -= (batt > 3.5) ? current[map[BAT]]/40000: current[map[BAT]]/4000;
|
|
|
|
|
if (batt < 3.0)
|
|
|
|
|
batt = 3.0;
|
|
|
|
|
if (batt > 4.5)
|
|
|
|
|
|