Skip to content

Encoder: Add mechanical slip detection - #892

Merged
vedderb merged 1 commit into
vedderb:masterfrom
fbg-jpg:feature/as5047-spi-loose-magnet-detect
Apr 29, 2026
Merged

Encoder: Add mechanical slip detection #892
vedderb merged 1 commit into
vedderb:masterfrom
fbg-jpg:feature/as5047-spi-loose-magnet-detect

Conversation

@fbg-jpg

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

Copy link
Copy Markdown
Contributor

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

vedderb commented Mar 20, 2026

Copy link
Copy Markdown
Owner

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

fbg-jpg commented Mar 23, 2026

Copy link
Copy Markdown
Contributor Author

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?

@fbg-jpg
fbg-jpg force-pushed the feature/as5047-spi-loose-magnet-detect branch from 5791768 to d57cef6 Compare April 28, 2026 09:16
@fbg-jpg

fbg-jpg commented Apr 28, 2026

Copy link
Copy Markdown
Contributor Author

I added new changes to match your suggestions. Now, the logic is configurable from the VESC Tool under the FOC -> Advanced tab. Also, the logic is now common for all encoders.

@fbg-jpg fbg-jpg changed the title encoder_as5047: Add SPI loose magnet detection logic Encoder: Add mechanical slip detection Apr 28, 2026
@vedderb
vedderb merged commit 94e2442 into vedderb:master Apr 29, 2026
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