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

Fix for #415 sin/cos integer overflow on 16-bit CPUs #416

Merged
merged 7 commits into from
Jul 18, 2024

Commits on Jan 14, 2024

  1. LinearHall improvements and move to main repository

    Changes compared to the original pull request in the drivers repository simplefoc/Arduino-FOC-drivers#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.
    dekutree64 committed Jan 14, 2024
    Configuration menu
    Copy the full SHA
    241e8c0 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    aeb9238 View commit details
    Browse the repository at this point in the history

Commits on Feb 14, 2024

  1. Moving LinearHall back to drivers repository

    As requested by runger
    dekutree64 committed Feb 14, 2024
    Configuration menu
    Copy the full SHA
    41de6b6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3a84021 View commit details
    Browse the repository at this point in the history

Commits on Jun 29, 2024

  1. Fix for simplefoc#415 sin/cos integer overflow on 16-bit CPUs

    Terrible bug in the fast sin/cos added last year, resulting in rough sine waves and a spike from +1 to -1 at pi/2
    dekutree64 committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    e81af5d View commit details
    Browse the repository at this point in the history
  2. Removed accidental addition of LinearHall.h

    I thought I discarded this change after moving LinearHall back to drivers, but somehow it got included anyway
    dekutree64 committed Jun 29, 2024
    Configuration menu
    Copy the full SHA
    bf75d20 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b203b83 View commit details
    Browse the repository at this point in the history