Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The temperature algorithm with ARTERY mcu maybe wrong #9

Open
ymzcdg opened this issue Feb 13, 2024 · 5 comments
Open

The temperature algorithm with ARTERY mcu maybe wrong #9

ymzcdg opened this issue Feb 13, 2024 · 5 comments

Comments

@ymzcdg
Copy link

ymzcdg commented Feb 13, 2024

In "main.c", when my mcu is from ARTERY, the function to calc temp is "getConvertedDegrees() in ADC.c".In datasheet of AT32F421 ,the algorithm is "temp(°C) = {(V25 – VTS) / Avg_Slope} + 25"and Typ_Avg_Slope = -4.3mV, V25=1.28mV.
So if my mcu is AT32F421K8U7,I will use "(12800 - (int32_t)adcrawtemp * 33000 / 4096) / -43 + 25;" to calc temperature inside mcu.
Please answer my doubts, thanks.

@DJ-URAN
Copy link

DJ-URAN commented Feb 16, 2024

4096? Are you sure? Maybe, 4095?

@ymzcdg
Copy link
Author

ymzcdg commented Feb 17, 2024

4096? Are you sure? Maybe, 4095?

In ”Mcu/f421/Src/ADC.c“ it's 4096. Maybe 4096 is the correct value, so I did not change it. I think 4095 is correct value in math ,but in computer, calculate /4096 is faster then /4095 (/4096 can use bit shift not division), and the error is very small.

@AlkaMotors
Copy link
Collaborator

It doesn't really matter anyway since the temperature sensors are not calibrated like stm32. Many vendors use a external ntc for artery mcus.

@ymzcdg
Copy link
Author

ymzcdg commented Feb 18, 2024

It doesn't really matter anyway since the temperature sensors are not calibrated like stm32. Many vendors use a external ntc for artery mcus.

I want design a hardware, what type of sensor does your formula correspond to?My NTC sensor calculation formulas all have logarithmic functions, but your formula does not have logarithmic functions.I think the sensor corresponding to your formula is easy to use, and I would like to know its model.
Thanks.

@lida2003
Copy link

lida2003 commented Aug 8, 2024

Many vendors use a external ntc for artery mcus.

Are there any recommended constraints or suggested positions for placing the NTC (Negative Temperature Coefficient) sensor?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants