Seems to calculate correctly now. I need to implement the plot script to verify operation against LT_spice.

This commit is contained in:
Christian Lind Vie Madsen
2025-10-14 14:04:51 +02:00
parent 9db03e2da4
commit 5c9ede9e85
2 changed files with 8 additions and 4 deletions

10
main.c
View File

@@ -7,7 +7,7 @@
#include "cm_heatsink_emulator/cm_heatsink_emulator.h" #include "cm_heatsink_emulator/cm_heatsink_emulator.h"
#define POWER 600 // Watts #define POWER 600 // Watts
#define AMBIENT_TEMPERATURE 25 // degC #define AMBIENT_TEMPERATURE 23 // degC
#define C_TH 32688.36649 // Thermal capacity #define C_TH 32688.36649 // Thermal capacity
cm_heatsink_thermalElement_t thermElements[3] = { cm_heatsink_thermalElement_t thermElements[3] = {
@@ -28,7 +28,11 @@ cm_heatsinkEmul_t thermEmul;
int main(void ){ int main(void ){
// Init Thermal emulator // Init Thermal emulator
cm_heatsinkEmul_init(&thermEmul, thermElements, 1/*(sizeof(thermElements) / sizeof(thermElements[0]))*/, POWER, AMBIENT_TEMPERATURE); cm_heatsinkEmul_init(&thermEmul, thermElements,(sizeof(thermElements) / sizeof(thermElements[0])), C_TH, POWER, AMBIENT_TEMPERATURE);
cm_heatsinkEmul_iterate(&thermEmul, 32688.36649);
float t = cm_heatsinkEmul_getElementTemp(&thermEmul, 2);
printf("temp: %f\r\n", t);
return 0;
cm_heatsinkEmul_getRespon(&thermEmul, 0.1);
} }