Skip to content

encoder_as5047: Add SPI loose magnet detection logic#892

Open
fbg-jpg wants to merge 1 commit intovedderb:masterfrom
fbg-jpg:feature/as5047-spi-loose-magnet-detect
Open

encoder_as5047: Add SPI loose magnet detection logic#892
fbg-jpg wants to merge 1 commit intovedderb:masterfrom
fbg-jpg:feature/as5047-spi-loose-magnet-detect

Conversation

@fbg-jpg
Copy link
Copy Markdown

@fbg-jpg fbg-jpg commented Mar 11, 2026

This code is meant to fix situations where the magnet gets loose and causes the motor to rotate very fast. The solution is for encoders of type AS5047 and it compares the FOC observer phase against the physical encoder phase at high speeds and if they are not in sync than a loose magnet fault is displayed and the motor will stop.
vedderb/vesc_tool#453

@vedderb
Copy link
Copy Markdown
Owner

vedderb commented Mar 20, 2026

This is an interesting and useful addition, but there are a few things I would like to change:

  • There should be some way to disable it as you can have motors where the observer does not track well at all under heavy load even at high speed.
  • All encoder have a chance of slipping, so this should really be used on all encoders when enabled. Some extra care probably has to be taken for encoders that use an index-pulse.

@fbg-jpg
Copy link
Copy Markdown
Author

fbg-jpg commented Mar 23, 2026

Hi,
Thank you for your feedback!
Before I add the changes you suggested, do you have a preference where I should add this options in the Vesc tool?

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