Changeset 38 for trunk/fw_g473rct/SES/src
- Timestamp:
 - Nov 1, 2025, 5:29:27 PM (2 days ago)
 - Location:
 - trunk/fw_g473rct/SES/src
 - Files:
 - 
          
- 6 edited
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
        
trunk/fw_g473rct/SES/src/ads1260.c
r25 r38 45 45 #include "ads1260.h" 46 46 #include "spi.h" 47 #include "math.h"47 //#include "math.h" 48 48 #include "main.h" 49 49 #include "eeprom.h" 50 50 #include <stdio.h> 51 #include "iwdg.h" 51 52 // --- EXTERNE VARIABLEN -------------------------------------------------------- 52 53 … … 765 766 /* 3*/ HAL_GPIO_WritePin(ADC_START_CONV_GPIO_Port, ADC_START_CONV_Pin, GPIO_PIN_SET); 766 767 HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9) 768 HAL_IWDG_Refresh(&hiwdg); 767 769 /* 1*/ //HAL_GPIO_WritePin(ADC_POWER_DOWN_GPIO_Port, ADC_POWER_DOWN_Pin, GPIO_PIN_RESET); 768 770 //HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9) … … 771 773 /* 2*/ HAL_GPIO_WritePin(ADC_RESET_GPIO_Port, ADC_RESET_Pin, GPIO_PIN_RESET); 772 774 HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9) 775 HAL_IWDG_Refresh(&hiwdg); 773 776 /* 2*/ HAL_GPIO_WritePin(ADC_RESET_GPIO_Port, ADC_RESET_Pin, GPIO_PIN_SET); 774 777 HAL_Delay(150); // Delay weil die Vref braucht zeit um sich zu stabilisieren (siehe Datenblatt Seite 9) 778 HAL_IWDG_Refresh(&hiwdg); 775 779 /* 3*/ HAL_GPIO_WritePin(ADC_START_CONV_GPIO_Port, ADC_START_CONV_Pin, GPIO_PIN_RESET); 776 780 … … 781 785 /* 5*/ ADS_1260_SetExternalReference(&hspi3); 782 786 HAL_Delay(150); 787 HAL_IWDG_Refresh(&hiwdg); 783 788 /* 6*/ ADS_1260_SetDataRate(&hspi3, DATA_RATE_20); 784 789 // /* 7*/ ADS_1260_SetDigitalFilter(&hspi1, FILTER_SINC4); … … 789 794 790 795 ADS_1260_ActivateStatusData(); 796 HAL_IWDG_Refresh(&hiwdg); 791 797 ADS_1260_ActivateLock(); 798 HAL_IWDG_Refresh(&hiwdg); 792 799 793 800 /*10*/ //ADS_1260_SelfOffsetCalibration(&hspi1); 794 801 HAL_Delay(150); 802 HAL_IWDG_Refresh(&hiwdg); 795 803 /*x*/ ads1260DataCoversionState = ADC_STATE_READY_FOR_CONVERSION; 796 804 ADS1260_StartConversion(); 805 HAL_IWDG_Refresh(&hiwdg); 797 806 } 798 807  - 
        
trunk/fw_g473rct/SES/src/battery_voltage.c
r25 r38 17 17 18 18 // --- LOKALE DEFINES - bitte hier dokumentieren -------------------------------- 19 19 20 #define BATTERY_VOLTAGE_FILTER 32 20 21 21 22 22  - 
        
trunk/fw_g473rct/SES/src/eeprom.c
r35 r38 223 223 /* iBatFull */ 10, // I-batt full 10%, 10A bei 100Ah akku 224 224 /* tBatFull */ 2, // t-batt full 2 Sekunden 225 /* uBatFull */ 0, // 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 226 /* uBatEmpty */ 11312, // 11,312V Ubatt Empty 225 #if defined SYSTEM_VOLTAGE_12V 226 /* uBatFull */ 14000, // 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 227 /* uBatEmpty */ 12400, // 11,312V Ubatt Empty 228 #elif defined SYSTEM_VOLTAGE_24V 229 /* uBatFull */ 28000, // 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 230 /* uBatEmpty */ 24800, // 11,312V Ubatt Empty 231 #elif defined SYSTEM_VOLTAGE_48V 232 /* uBatFull */ 56000, // 14V olt Ubatt full, Neu: Bei 0: Erkung von Lipro LVP als 0% 233 /* uBatEmpty */ 49600, // 11,312V Ubatt Empty 234 #else 235 #error "System voltage not defined" 236 #endif 237 238 227 239 /* socCalcMode */ 1, // SoC calculation mode: 0(default) 228 240 /* cellRatedDischargeTime */ 2, // cell rated current discharge time [C/x]. For example, if 40Ah cell is rated as 0.5c, then rated discharge time is 2 229 241 #if defined SYSTEM_VOLTAGE_12V 230 242 /* lvpStart */ 12000, // uint16_t lvpStart; Spannung ab der die LOW Voltage Protection aktiv wird in mV 231 243 /* lvpStop */ 12500, // uint16_t lvpStop; Spannung ab der die LOW Voltage Protection wieder inaktiv wird 232 244 /* ovpStart */ 14800, // uint16_t ovpStart; Spannung ab der die OVER Voltage Protection aktiv wird in mV 233 245 /* ovpStop */ 14000, // uint16_t ovpStop; Spannung ab der die OVER Voltage Protection wieder inaktiv wird 246 #elif defined SYSTEM_VOLTAGE_24V 247 /* lvpStart */ 24000, // uint16_t lvpStart; Spannung ab der die LOW Voltage Protection aktiv wird in mV 248 /* lvpStop */ 25000, // uint16_t lvpStop; Spannung ab der die LOW Voltage Protection wieder inaktiv wird 249 /* ovpStart */ 29600, // uint16_t ovpStart; Spannung ab der die OVER Voltage Protection aktiv wird in mV 250 /* ovpStop */ 28000, // uint16_t ovpStop; Spannung ab der die OVER Voltage Protection wieder inaktiv wird 251 252 #elif defined SYSTEM_VOLTAGE_48V 253 /* lvpStart */ 48000, // uint16_t lvpStart; Spannung ab der die LOW Voltage Protection aktiv wird in mV 254 /* lvpStop */ 50000, // uint16_t lvpStop; Spannung ab der die LOW Voltage Protection wieder inaktiv wird 255 /* ovpStart */ 59200, // uint16_t ovpStart; Spannung ab der die OVER Voltage Protection aktiv wird in mV 256 /* ovpStop */ 56000, // uint16_t ovpStop; Spannung ab der die OVER Voltage Protection wieder inaktiv wird 257 #else 258 #error "System voltage not defined" 259 #endif 260 261 234 262 235 263 #if (DEVICETYPE == 500) … … 247 275 /* chargeStopHighTemperatureStart */ 6000, // 80°C int16_t chargeStopHighTemperatureStart; Abschalttemperatur Ladung wegen zu hoher Temperatur 248 276 /* chargeStopHighTemperatureStop */ 5500, // 75°C int16_t chargeStopHighTemperatureStop; Wiedereinschalttemperatur 249 /* chargeStopLowTemperatureStart */ - 3000, // -35°C int16_t chargeStopLowTemperatureStart; Abschalttemperatur Ladung wegen zu niedriger Temperatur250 /* chargeStopLowTemperatureStop */ -2 500, // -30°C int16_t chargeStopLowTemperatureStop; Wiedereinschalttemperatur277 /* chargeStopLowTemperatureStart */ -2500, // -35°C int16_t chargeStopLowTemperatureStart; Abschalttemperatur Ladung wegen zu niedriger Temperatur 278 /* chargeStopLowTemperatureStop */ -2000, // -30°C int16_t chargeStopLowTemperatureStop; Wiedereinschalttemperatur 251 279 /* dischargeStopHighTemperatureStart*/ 6000, // 80°C int16_t dischargeStopHighTemperatureStart; Abschalttemperatur Entladung wegen zu hoher Temperatur 252 280 /* dischargeStopHighTemperatureStop */ 5500, // 75°C int16_t dischargeStopHighTemperatureStop; Wiedereinschalttemperatur … … 256 284 /* uBatEmptyCompStartTemp */ 50, // 5°C We start calculating uBatEmpty compensations only when cell temperature is lower than this value 257 285 /* uBatEmptyCompStopTemp */ -200, // -20°C We stop calculating uBatEmpty compensations when cell temperature is lower than this value 286 #if defined SYSTEM_VOLTAGE_12V 258 287 /* uBatEmptyCompStopVolt */ 10000, // 10V uBatEmpty voltage at temperatures lower than -20°C 288 #elif defined SYSTEM_VOLTAGE_24V 289 /* uBatEmptyCompStopVolt */ 20000, // 10V uBatEmpty voltage at temperatures lower than -20°C 290 #elif defined SYSTEM_VOLTAGE_48V 291 /* uBatEmptyCompStopVolt */ 40000, // 10V uBatEmpty voltage at temperatures lower than -20°C 292 #else 293 #error "System voltage not defined" 294 #endif 259 295 260 296 /* extraDischargeStrom_mA */ 7, // mA, current that LiPro consumes itself … … 262 298 /* Battery Empty Detection Mode*/ 1, // Auto, from BMS 263 299 /* AUX MODE */ AUX_MODE_HEATER,// Heizung 300 #if defined SYSTEM_VOLTAGE_12V 264 301 /* AUX SETPOINT ON */ 13600, // Erkennung Ladegerät ab 13,6V 302 #elif defined SYSTEM_VOLTAGE_24V 303 /* AUX SETPOINT ON */ 27200, // Erkennung Ladegerät ab 13,6V 304 #elif defined SYSTEM_VOLTAGE_48V 305 /* AUX SETPOINT ON */ 54400, // Erkennung Ladegerät ab 13,6V 306 #else 307 #error No valid device type 308 #endif 265 309 /* AUX SETPOINT OFF */ 100, // Batterie Entladung wird erkannt bei -100mA 266 310 /* AUX Inverted */ 0, // Nicht invertiert  - 
        
trunk/fw_g473rct/SES/src/esr.c
r26 r38 12 12 int32_t current_buffer[SAMPLE_ARRAY_SIZE]; 13 13 int32_t voltage_buffer[SAMPLE_ARRAY_SIZE]; 14 //int32_t current_buffer_fast[SAMPLE_ARRAY_SIZE]; 15 //int32_t voltage_buffer_fast[SAMPLE_ARRAY_SIZE]; 14 16 15 17 16 extern uint16_t adc12Data[SAMPLE_ARRAY_SIZE][2];  - 
        
trunk/fw_g473rct/SES/src/outputs.c
r28 r38 118 118 //Temperabschaltung Start 80°C 119 119 //Temperaturabschaltung Stop -99°C 120 if ( sys_data.s.values.lvpState != OUTPUTS_LVP_OVERCURRENT)120 if ((sys_data.s.values.lvpState != OUTPUTS_LVP_OVERCURRENT) && (sys_data.s.values.lvpState != OUTPUTS_LVP_SHORT_PROTECTION)) 121 121 { 122 122 //Andere Fehler, automatisches zurücksetzen, wenn keine Fehlerbedingungen mehr vorliegen … … 209 209 //Wenn Abschaltung aufgrund zu hohem Lade/Lastrom erfolgt ist, dann muss Rücksetzen durch Reset Button erfolgen 210 210 //Andere Fehler, automatisches zurücksetzen, wenn keine Fehlerbedingungen mehr vorliegen 211 if ( sys_data.s.values.ovpState != OUTPUTS_OVP_OVERCURRENT)211 if ((sys_data.s.values.ovpState != OUTPUTS_OVP_OVERCURRENT) && (sys_data.s.values.ovpState != OUTPUTS_OVP_SHORT_PROTECTION) ) 212 212 { 213 213 printf("OUTPUT OVP OK\n");  - 
        
trunk/fw_g473rct/SES/src/shunt_voltage.c
r24 r38 19 19 #define ADC_RESOLUTION 32768 //65536/2 da im differential mode 20 20 #define ADC_OFFSET 32768 21 #define SHUNT_VOLTAGE_DIVIDER 6 21 22 #if defined SYSTEM_VOLTAGE_12V 23 #define SHUNT_VOLTAGE_DIVIDER 6.0 24 #elif defined SYSTEM_VOLTAGE_24V 25 #define SHUNT_VOLTAGE_DIVIDER 11.0 26 #elif defined SYSTEM_VOLTAGE_48V 27 #define SHUNT_VOLTAGE_DIVIDER 21.0 28 #else 29 #error "System voltage not defined" 30 #endif 31 32 33 22 34 // --- LOKALE TYPE DEFS - bitte hier dokumentieren------------------------------- 23 35  
Note: See TracChangeset
          for help on using the changeset viewer.
      