first bits of cleanup
Some checks failed
EIVE/eive-obsw/pipeline/pr-main There was a failure building this commit

This commit is contained in:
2023-07-28 11:36:20 +02:00
parent 88a8969142
commit a0025030f1
4 changed files with 99 additions and 48 deletions

View File

@ -43,15 +43,19 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
void performControlOperation() override;
void calculateStateOfCharge();
void calculateOpenCircuitVoltageCharge();
void calculateCoulombCounterCharge();
ReturnValue_t updateEpsData();
float charge2stateOfCharge(float capacity);
float linearInterpolation(float x, float x0, float x1, float y0, float y1);
// Parameters
float batteryInternalResistance = 70 / 2 / 1000; // [Ohm]
float batteryMaximumCapacity = 2.6 * 2; // [Ah]
float batteryInternalResistance = 70.0 / 2.0 / 1000.0; // [Ohm]
float batteryMaximumCapacity = 2.6 * 2; // [Ah]
float coulombCounterVoltageUpperThreshold = 16.2e3; // [mV]
// OCV Look-up-Table
float lookUpTableOcv[2][25] = {
float lookUpTableOcv[2][100] = {
{0.00000000e+00, 3.16227766e-04, 4.52809661e-04, 6.48382625e-04, 9.28425483e-04,
1.32942162e-03, 1.90361194e-03, 2.72580074e-03, 3.90310099e-03, 5.58888885e-03,
8.00278514e-03, 1.14592671e-02, 1.64086377e-02, 2.34956903e-02, 3.36437110e-02,
@ -89,7 +93,12 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
16.67249918, 16.74926904}};
// Variables
timeval now;
timeval oldTime;
int16_t iBat = 0.0; // [mA]
float openCircuitVoltageCharge = 0.0; // [mC]
float coulombCounterCharge = 0; // [mC]
float coulombCounterChargeUpperThreshold = 0.0; // [mC]
// HK Datasets for Calculation
BpxBatteryHk bpxBatteryHk = BpxBatteryHk(objects::BPX_BATT_HANDLER);
@ -98,7 +107,7 @@ class PowerController : public ExtendedControllerBase, public ReceivesParameterM
PDU2::Pdu2CoreHk pdu2CoreHk = PDU2::Pdu2CoreHk(objects::PDU2_HANDLER);
ACU::CoreHk acuCoreHk = ACU::CoreHk(objects::ACU_HANDLER);
// Output Dataset
pwrctrl::StateOfChargedData stateOfChargeData;
pwrctrl::CoreHk pwrCtrlCoreHk;
};
#endif /* MISSION_CONTROLLER_POWERCONTROLLER_H_ */