Skip to content

Fix overflow in STM32 dead-time calculation #265

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

Merged
merged 2 commits into from
Mar 30, 2023

Conversation

runger1101001
Copy link
Member

In some cases, when PWM frequency is low and dead_zone is set to a high value the max dead-time is exceeded and the calculations result in a dead_time of 0.
This adds a check and sets the dead_time to max value (255) if it gets calculated as 0 but dead_zone is non-zero.

@runger1101001 runger1101001 merged commit 4c8ea20 into simplefoc:dev Mar 30, 2023
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.

1 participant