Conversation
* Fixed enable/disable code for the bldc driver so that it starts/stops the timer in the enable/disable function and does not use the force since that was preventing the driver from working after the disable was called once. * Removed extra / unused logging * Removed mutexes around gpio * Added check on enable pin number before setting enable pin in enable()
* Enable the motor explicitly in the constructor to initialize foc, then disable it before leaving constructor * Added function to get enabled state of motor
* added additional named method is_running as alternative for is_started * Ensure when breaking loop for bad callback function the started_ member is set to false.
* Added destructor to stop haptics when destroyed * Updated start/stop functions to enable/disable motor as well * Added API to see if the haptics are running/active or not
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Motivation and Context
Right now the bldc components did not support being reenabled after being disabled - everything would appear to work, but the actual output would continue as if the driver were disabled. This resulted from the fact that we were calling the force output functions on the generators in the disable call. Removing those calls from the enable and disable functions and replacing them with timer start and timer stop calls has the same intended effect (ensuring power/no power to the motor) in a way that allows for as much cycling of enabled / disabled state as you like. Additionally, ensuring that the container / higher level classes maintained enabled/disabled state of the underlying classes simplifies the interfaces / API. Finally, we want to ensure that the motor control classes are in a safe (no power) state after initialization / construction is finished.
How has this been tested?
Building and running the bldc haptics test.
Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
Types of changes
Checklist:
Software
.github/workflows/build.ymlfile to add my new test to the automated cloud build github action.