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

STM32F1 Adc calibration #327

Merged
merged 1 commit into from
Oct 29, 2023
Merged

Conversation

Candas1
Copy link
Collaborator

@Candas1 Candas1 commented Oct 23, 2023

Adding ADC calibration for STM32F1.

Before:
RAM: [= ] 9.0% (used 4444 bytes from 49152 bytes)
Flash: [=== ] 26.6% (used 69712 bytes from 262144 bytes)

offset_ia = 1.574506
offset_ib = 1.566360

After:
RAM: [= ] 9.0% (used 4444 bytes from 49152 bytes)
Flash: [=== ] 26.8% (used 70208 bytes from 262144 bytes)

offset_ia = 1.630240
offset_ib = 1.623240

Slightly increases memory usage because of the use of an additional hal function, but should make all the adc measurements closer to reality.
The only risk I see are:

  • a user has saved the phase current offsets without adc calibration in the code or in eeprom and would measure phase current with adc calibration, but I don't think it's common practice
  • a user tweaked the gains to match an internal measurement, now the measurements won't match anymore

@Candas1 Candas1 changed the title Adc calibration STM32F1 Adc calibration Oct 23, 2023
@runger1101001
Copy link
Member

I will merge it, the STM32 tests like it :-)

@runger1101001 runger1101001 merged commit 2ba2e43 into simplefoc:dev Oct 29, 2023
13 of 16 checks passed
@runger1101001 runger1101001 added this to the 2.3.2_Release milestone Dec 1, 2023
@Candas1 Candas1 deleted the f1_adc_calibration branch February 6, 2024 21:16
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

Successfully merging this pull request may close these issues.

2 participants