Update main.c fix simulated current

pacsat-v2.2-tlm3
Alan Johnston 4 weeks ago committed by GitHub
parent e1b25b9aad
commit 50c51e8993
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -745,7 +745,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(320, 510) - 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.