Update main.c fix sim charging current bug

fc-a
Alan Johnston 11 months ago committed by GitHub
parent c4a0ae01ff
commit 4a283318c5
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -772,7 +772,8 @@ int main(int argc, char * argv[]) {
// 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));
current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging;
// current[map[BAT]] = ((current[map[BAT2]] * voltage[map[BAT2]]) / batt) - charging;
current[map[BAT]] = ((rnd_float(158, 171) * rnd_float(5.0, 5.005)) / batt) - charging;
printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BAT2]], batt, voltage[map[BAT2]]);

Loading…
Cancel
Save

Powered by TurnKey Linux.