simplefoc / Arduino-FOC

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library
https://docs.simplefoc.com
MIT License
1.94k stars 510 forks source link

LinearHall improvements and move to main repository #367

Closed dekutree64 closed 4 months ago

dekutree64 commented 5 months ago

Changes compared to the original pull request in the drivers repository https://github.com/simplefoc/Arduino-FOC-drivers/pull/12

  1. Added a version of init which turns the motor one revolution to find the center values of the sensors.
  2. Moved the calls to analogRead into a weakly bound function ReadLinearHalls so it can be overridden with custom ADC code on platforms with poor analogRead performance.
  3. Commented out the pinMode calls in init, which makes it possible to pass in ADC channel numbers for custom ReadLinearHalls to use without having to remap them every update.
  4. Changed to use the much faster _atan2 function that was added to foc_utils recently.
  5. Added examples.
runger1101001 commented 5 months ago

Hey, from my point of view I think we should add the LinearHall code in the drivers repository, and not the main repository... While it's very cool, at the moment it's something that only very few of our users will be able to use.

dekutree64 commented 4 months ago

Closing this and opening a new PR in drivers repository