Ignore:
Timestamp:
Aug 4, 2026, 1:53:58 PM (29 hours ago)
Author:
f.jahn
Message:

Delta Sigma ADC auf 10Channel geändert.

Location:
trunk/fw_g473rct/SES/inc
Files:
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/fw_g473rct/SES/inc/ads1260.h

    r20 r73  
    137137void ADS_1260_SetDataRate(SPI_HandleTypeDef * hspi, uint8_t dataRate);
    138138
     139void ADS1260_BatteryVoltageZeroCal(void);
     140void ADS1260_ShuntVoltageZeroCal(void);
    139141#endif // !_ADS_1260_H
  • trunk/fw_g473rct/SES/inc/battery_voltage_fast.h

    r72 r73  
    1616
    1717//--- GLOBALE DEFINES ----------------------------------------------------------
    18 #if defined SYSTEM_VOLTAGE_12V
    19   #define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       6.0
    20 #elif defined SYSTEM_VOLTAGE_24V
    21   #define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       11.0
    22 #elif defined SYSTEM_VOLTAGE_48V
    23   #define BATTERY_VOLTAGE_VOLTAGE_DIVIDER       21.0
    24 #else
    25   #error "System voltage not defined"
    26 #endif
    2718
    2819
    29 
    30 #define BATTERY_VOLTAGE_ADC_RESOLUTION            32768.0 //65536/2 da im differential mode
    31 #define BATTERY_VOLTAGE_ADC_OFFSET                        32768.0
     20#define BATTERY_VOLTAGE_FAST_ADC_RESOLUTION               65536
     21#define BATTERY_VOLTAGE_FAST_ADC_OFFSET                   32768
    3222
    3323//--- GLOBALE VARIABLEN PROTOTYPEN ---------------------------------------------
    3424
    3525//--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
    36 void BATTERY_VOLTAGE_Exec(int32_t newvalP );
    37 void BATTERY_VOLTAGE_ZeroCal(void);
     26void BATTERY_VOLTAGE_FAST_Exec(int32_t newvalP );
     27void BATTERY_VOLTAGE_FAST_ZeroCal(void);
     28
    3829
    3930#endif //
  • trunk/fw_g473rct/SES/inc/chip_temperature.h

    r20 r73  
    3333* @retval       kein
    3434*/
    35 void CHIP_TEMPERATURE_Exec(uint32_t chiptemperature);
     35void CHIP_TEMPERATURE_Exec(int32_t chiptemperature);
    3636#endif // !__CHIP_TEMPERATURE_H
  • trunk/fw_g473rct/SES/inc/esr.h

    r20 r73  
     1#ifndef __ESR_H
     2#define __ESR_H
     3
    14#include <inttypes.h>
    25
    3 int16_t ESR_Exec(void);
     6
    47int16_t ESR_FAST_Exec(void);
     8#endif
  • trunk/fw_g473rct/SES/inc/fast_current.h

    r26 r73  
    3636
    3737//--- GLOBALE FUNKTIONS PROTOTYPEN ---------------------------------------------
    38 void FAST_CURRENT_Exec(uint32_t newVal );
    39 void CurrentOffsetCal(uint32_t newVal);
    40 void CurrentGainCal(uint32_t newVal);
     38void FAST_CURRENT_Exec(int32_t newVal );
     39void CurrentOffsetCal(int32_t newVal);
     40void CurrentGainCal(int32_t newVal);
    4141
    4242#endif //
  • trunk/fw_g473rct/SES/inc/int_bat_voltage.h

    r24 r73  
    1212
    1313//--- INCLUDEs -----------------------------------------------------------------
    14 
     14#include "inttypes.h"
    1515//--- GLOBALE TYPE DEFS --------------------------------------------------------       
    1616
     
    2626* @retval       kein
    2727*/
    28 void INT_BAT_VOLTAGE_Exec(uint32_t newval);
     28void INT_BAT_VOLTAGE_Exec(int32_t newval);
    2929
    3030#endif // __REF_VOLTAGE_H
  • trunk/fw_g473rct/SES/inc/shunt_voltage_fast.h

    r72 r73  
    2626* @retval       kein
    2727*/
    28 void SHUNT_VOLTAGE_Exec(int32_t voltage);
    29 
     28void SHUNT_VOLTAGE_FAST_Exec(int32_t voltage);
     29void SHUNT_VOLTAGE_FAST_ZeroCal(void);
    3030#endif // !__SHUNT_VOLTAGE_H
  • trunk/fw_g473rct/SES/inc/sysdata.h

    r69 r73  
    127127        int32_t batteryCurrentGainTemperatureCompensationShuntFactor;                           // 82-83        Berechneter Faktor für Gain Temperatur kompensation. Pro 1/100 C * 1000000000
    128128        int16_t batteryCurrentGainTemperatureCalibrationChipTemperature;                        // 84           Gesicherte Chip Temperatur bei Start der Gain Temperatur Kompensation
    129         int16_t UNIQUE_NAME(reserved);                                                                                          // 85           reserviert
     129        int16_t shuntVoltageFastOffset;                                                                                         // 85           reserviert
    130130        int32_t batteryCurrentGainTemperatureCompensationChipFactor;                            // 86-87        zuszätzlicher Kalibrierungsfaktor, nicht in Verwendung
    131131        int32_t batteryCurrentOffsetFast;                                                                                       // 88-89        Korrektur in STM32 ADC Messung Gain, Strommessung
     
    136136        uint16_t auxOutputSetpointOff;                                                                                          // 95           SOC in Prozent für SOC mode
    137137        uint16_t auxOutputInverted;                                                                                                     // 96           0= NORMAL, 1=INVERTED
    138         uint16_t UNIQUE_NAME(reserved)[3];
     138        int16_t batteryVoltageFastOffset;                                                                                       // 97           Offset für Spannungsmessung
     139        int16_t batteryVoltageOffset;                                                                                           // 98           Offset für Spannungsmessung
     140        int16_t shuntVoltageOffset;                                                                                                     // 99           Offset für Spannungsmessung
     141       
    139142
    140143} device_parameter_t;
     
    150153        /* 2 of 8 */ int16_t  shuntTemperatureMax;                                                                      // 104          Höchste Shunttemperatur seit Programmstart, kann durch Schreiben von Int16-Min (-32.768) in das Register zurückgesetzt werden
    151154        /* 4 of 8 */ int16_t  shuntTemperatureMin;                                                                      // 105          Niedrigste Shunttemperatur seit Programmstart, kann durch Schreiben von  Int16_Max (+32.767) in das Register zurückgesetzt werden
    152         /* 8 of 8 */ uint32_t shuntVoltage;                                                                                     // 106-107      Shuntspannung in mV (Common Mode Voltage) gemessen von dem STM32G0. Spannung zwischen Shunt B und GND Versorgung
     155        /* 8 of 8 */ int32_t shuntVoltage;                                                                                     // 106-107      Shuntspannung in mV (Common Mode Voltage) gemessen von dem STM32G0. Spannung zwischen Shunt B und GND Versorgung
    153156        /* 4 of 8 */ int32_t  batteryVoltage;                                                                           // 108-109!     Gemessenen Batteriespannung in mV. Es kann in beide Richtungen gemessen werden (mindestens von -60V bis +60V). Es muss darauf geachtet werden, dass die gemessen Spannung positiv ist (+ an Batterieplus und - an Batterieminus)
    154157        /* 8 of 8 */ int32_t  batteryVoltageMax;                                                                        // 110-111      Hchster Spannungswert in mV (Batteriespannung) seit Programmstart. Kann durch schreiben von int32-Min (-2,147,483,648) in das Register zurckgesetzt werden
     
    170173        /* 2 of 8 */ int16_t  selfDischarge;                                                                            // 140          [mA]
    171174        /* 4 of 8 */ int16_t  selfDischargeAvg;                                                                         // 141          [mA]
    172         /* 6 of 8 */ int16_t  esr;                                                                                                      // 142          [mOhm]
    173         /* 8 of 8 */ int16_t  esr_fast;                                                                                         // 143          [mOhm]
    174         /* 6 of 8 */ uint32_t lastTimeVbatFull;                                                                         // 144-145      [s]
     175        /* 6 of 8 */ int16_t  esr_batt;                                                                                         // 142          [mOhm]
     176        /* 8 of 8 */ int16_t  esr_shunt;                                                                                        // 143          [mOhm]
     177        /* 4 of 8 */ uint32_t lastTimeVbatFull;                                                                         // 144-145      [s]
    175178        /* 8 of 8 */ uint32_t lastTimeVbatEmpty;                                                                        // 146-147      [s]
    176179        /* 4 of 8 */ uint32_t onTime;                                                                                           // 148-149      [s] Runtime Zähler zum speichern der Statistik Werte im EEPROM und als Betriebszeitzähler
     
    185188        /* 8 of 8 */ int16_t  calculatedCEFWh;                                                                          // 163
    186189        /* 4 of 8 */ int32_t  mWh_AutoMode;                                                                                     // 164-165
    187         /* 2 of 8 */ int16_t  overcurrentMeasurement;                                                           // 166
    188         /* 4 of 8 */ int16_t  overcurrentMaxValue;                                                                      // 167 /reserviert
     190        /* 6 of 8 */ int16_t  overcurrentMeasurement;                                                           // 166
     191        /* 8 of 8 */ int16_t  overcurrentMaxValue;                                                                      // 167 /reserviert
    189192        /* 2 of 8 */ uint16_t ovp_sense;                                            // 168 reserviert
    190193        /* 4 of 8 */ uint16_t lvp_sense;                                            // 169
    191194        /* 6 of 8 */ uint16_t overcurrentRetryCounter;                                                          // 170
    192195        /* 8 of 8 */ uint16_t overcurrentEventsTotal;                                                           // 171
    193         /* 6 of 8 */ uint32_t detectedCapacityAtActualCRate;                                            // 272,273
    194         /* 8 of 8 */ uint32_t detectedEnergyAtActualCRate;                                                      // 274,275
     196        /* 4 of 8 */ uint32_t detectedCapacityAtActualCRate;                                            // 172,173
     197        /* 8 of 8 */ uint32_t detectedEnergyAtActualCRate;                                                      // 174,175
    195198
    196199
     
    207210        /* 8 of 8 */ int32_t  batteryCurrentOffsetCommonModeCorrectionADCSteps;         // 198-199      Offset Korrektur Wert aufgrund Common Mode Error
    208211        /* 4 of 8 */ int32_t  fast_current;                                                                                     // 200-201
    209         /* 4 of 8 */ int32_t  fast_voltage;                                                                                     // 202-203
    210         /* 8 of 8 */ int16_t  esrCalcStatus;                                                                            // 204
    211         /* 2 of 8 */ uint16_t esrCalcTime;                                                                                      // 205
    212         /* 4 of 8 */ int16_t  selfDischargeStatus;                                                                      // 206
    213         /* 6 of 8 */ uint16_t selfDischargeTime;                                                                        // 207
     212        /* 8 of 8 */ int32_t  batteryVoltageFast;                                                                       // 202-203
     213        /* 2 of 8 */ int16_t  esrCalcStatus;                                                                            // 204
     214        /* 4 of 8 */ uint16_t esrCalcTime;                                                                                      // 205
     215        /* 6 of 8 */ int16_t  selfDischargeStatus;                                                                      // 206
     216        /* 8 of 8 */ uint16_t selfDischargeTime;                                                                        // 207
    214217        /* 8 of 8 */ uint8_t  message[24];                                                                                      // 208-219      ASCII-char message, limited to 20 letters
    215218        /* 8 of 8 */ int64_t  mWsCounterUncorrected;                                                            // 220-223      [mWs]
    216219        /* 8 of 8 */ int64_t  mAsCounterUncorrected;                                                            // 224-227      [mAs]
    217         /* 2 of 8 */ int32_t  mAhCounterUncorrected;                                                            // 228-229
     220        /* 4 of 8 */ int32_t  mAhCounterUncorrected;                                                            // 228-229
    218221        /* 6 of 8 */ uint16_t soc0;                                                                                                     // 230
    219222        /* 8 of 8 */ uint16_t soc1;                                                                                                     // 231
     
    225228        /* 6 of 8 */ uint16_t ltc_charge_current;                                                                       // 238
    226229        /* 8 of 8 */ uint16_t ltc_charge_current_max;                                                           // 239
    227         /* 4 of 8 */ int64_t  mAs_AutoModeU;                                                                            // 240-243
    228         /* 6 of 8 */ uint16_t ramCRCErrCnt;                                                                                     // 244
    229         /* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);                                                            // 245
    230         /* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);                                                            // 246
    231         /* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);                                                            // 247
    232         /* 6 of 8 */ uint16_t ltc_discharge_current;                                                            // 248
    233         /* 8 of 8 */ uint16_t ltc_discharge_current_max;                                                        // 249
    234         /* 8 of 8 */ int16_t  current_buffer[SAMPLE_ARRAY_SIZE];                                        // 250-313
    235         /* 8 of 8 */ int16_t  voltage_buffer[SAMPLE_ARRAY_SIZE];                                        // 314-377
    236         /* 8 of 8 */ int16_t  current_buffer_fast[SAMPLE_ARRAY_SIZE];                           // 378-441
    237         /* 8 of 8 */ int16_t  voltage_buffer_fast[SAMPLE_ARRAY_SIZE];                           // 442-505
     230        /* 8 of 8 */ int64_t  mAs_AutoModeU;                                                                            // 240-243
     231        /* 2 of 8 */ uint16_t ramCRCErrCnt;                                                                                     // 244
     232        /* 4 of 8 */ int16_t  UNIQUE_NAME(reserved);                                                                    // 245
     233       
     234        /* 8 of 8 */ int32_t shuntVoltageFast;                                                          // 246
     235        /* 2 of 8 */ uint16_t ltc_discharge_current;                                                            // 248
     236        /* 4 of 8 */ uint16_t ltc_discharge_current_max;                                                        // 249
     237        /* 6 of 8 */ uint16_t UNIQUE_NAME(reserved);                                                            // 250
     238        /* 8 of 8 */ int16_t pos_I_peak;                                                                                        // 251
     239        /* 2 of 8 */ int16_t neg_I_peak;                                                                                        // 252
     240        /* 4 of 8 */ int16_t pos_U_Batt_peak;                                                                           // 253
     241        /* 6 of 8 */ int16_t neg_U_Batt_peak;                                                                           // 254
     242        /* 8 of 8 */ int16_t pos_U_Shunt_peak;                                                                          // 255
     243        /* 2 of 8 */ int16_t neg_U_Shunt_peak;                                                                          // 256
     244        /* 4 of 8 */ uint16_t pos_I_Buffer_pos;                                                                         // 257
     245        /* 6 of 8 */ uint16_t neg_I_Buffer_pos;                                                                         // 258
     246        /* 8 of 8 */ uint16_t UNIQUE_NAME(reserved);                                                            // 259
     247        /* 8 of 8 */ int16_t  current_buffer[SAMPLE_ARRAY_SIZE];                                        // 260-323
     248        /* 8 of 8 */ int16_t  voltage_buffer_batt[SAMPLE_ARRAY_SIZE];                           // 324-387
     249        /* 8 of 8 */ int16_t  voltage_buffer_shunt[SAMPLE_ARRAY_SIZE];                          // 388-451
    238250
    239251} device_values_t;
Note: See TracChangeset for help on using the changeset viewer.