Update main.c fix sim current

fc-a
Alan Johnston 11 months ago committed by GitHub
parent 003c3f7f01
commit 1c836a2ba6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -773,7 +773,7 @@ int main(int argc, char * argv[]) {
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]] = ((rnd_float(158, 171) * rnd_float(5.0, 5.005)) / batt) - charging;
current[map[BAT]] = rnd_float(285, 410) - current[map[PLUS_X]] - current[map[MINUS_X]] - current[map[PLUS_Y]] - current[map[MINUS_Y]] - current[map[PLUS_Z]] - current[map[MINUS_Z]];
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.