-
Notifications
You must be signed in to change notification settings - Fork 12
Feature/bldc haptics #60
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
Conversation
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
* Added bldc_haptics component which templates on a motor concept (works with bldc_motor right now) - copied with modifications from smartknob as initial implementation. * Added bldc_haptics_example to showcase new component.
* Updated PID config api to allow user to specify whether they want to clear the state or not (default true) * Added `set_config` api to mirror `get_config`
* Updated docs to include bldc haptics info * Updated bldc_haptics comments for more complete docs and remove unused code * Updated bldc_motor to point to example usage (was missing)
* Added fault pin (optional) to bldc_driver as an input with associated API * Added mutex to protect en / fault pins (and check values before setting enable)
* Update bldc_motor example to use config for tinyS3 test stand (works!) * Update bldc_motor example to quit if the driver reports a fault * Update bldc_driver to configure the fault pin as pull-down (since fault is high) to prevent always triggering fault condition
* Update bldc_haptics example to use fault pin on motor driver and exit if the driver goes into fault condition
* Allow the kp/kd factors to be configured in the BldcHaptics::Config struct * Fix potential bug from smartknob project where min/max (lower/upper) kd factors were inverted
* Moved non-templated types into their own header files (now inside espp::detail namespace) and updated example accordingly
* Allow configuring the pid gain factors for detents of BldcHaptics * Update to use new espp::detail namespace for types in BldcMotor * Set motor to Torque control in BldcHaptics * Add motion control config api to concept requirement in BldcHaptics * Tuning the gain factors for the detent pid * Added another detent config (on/off) * Updated return to center detent config to have position width properly set
* Added missing parameter documentation to rtsp method
* Added missing parameter documentation * Send multiline response as multiline response (multiline=true) for FEAT
* Updated example to better indicate what config it is running (print it out completely) * Updated detent config to support libfmt printing * Added equality operator for detentconfig * Removed integrator for detent pid and increased output min/max * Updated gains for feeling of detents
* Remove integrator from detent PID * Add example for playing haptics to doc * Add API for getting current position from the haptics (for input)
* Update pid config for haptics * Shorten example * Run the haptic click / buzz test and add it to docs
12 tasks
* Run the loop_foc after calling the move command, instead of after the sleep like a dumbass. * Update logger to print higher precision
* Add phase inductance parameter to bldc_motor (not tested) * Update bldc_motor example to use motor for printing sensor data * Update bldc_motor example to have proper zero electrical angle for motor on new test stand. * Update bldc_motor example for less clamping
* updated haptics example to have correct zero electrical offset for this motor on this test stand * updated haptics example to have higher current limit * Updated to show more of the possible preconfigured detent configs and print them more cleanly * Updated bldc_haptics output min/max to be same as velocity pid was since they both operate on current * Updated logging for bldc_haptics * Updated how position is updated when changing detent configuration * Updated use of kd_factor_min/max to match how smartknob did it * Properly send the torque to the motor (not the negative torque) * Updated libfmt printing of DetentConfig structs
* Update gains in example * Update default gains
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
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
bldc_haptics
component which templates on a motor concept (works with bldc_motor right now) - copied with modifications from smartknob as initial implementation.bldc_haptics_example
to showcase new component.set_config
api to mirrorget_config
inPid
classPid::set_config
api to allow user to specify whether they want to clear the state or not (default true)gpio_fault
and fault detection toBldcDriver
class (and use it in examples)fast_math
espp::detail
namespace) and updated example accordinglyBldcMotor
KV
valuephase_inductance
inBldcMotor
rtsp
methodftp
methodMotivation and Context
Closes #7
We have support for haptics driven by specific haptic motor drivers (such as the DRV2605), but there are some use cases where directly integrating haptics into the user input device itself can provide a more configurable and interactive experience. One such example is shown by the smartknob project which uses a small BLDC gimbal motor as an input device (rotary encoder) with configurable detents, min/max ranges, haptic buzzes/clicks, and return to center functionality. Given that this is all controlled with a BLDC motor, the behavior of the input / haptics can change dynamically depending on the state of the program for more interesting user interfaces.
How has this been tested?
bldc_motor/example
with the new bldc motor test standbldc_haptics/example
with the new bldc motor test stand (design forthcoming in new repo).Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):
bldc_motor/example
updated-bldc-motor-example-compressed.mp4
bldc_haptics/example
coarse values strong detents (best with sound)
coarse_values_strong_detents.mp4
magnetic detents (best with sound)
magnetic_detents.mp4
On / Off Strong Detents (best with sound)
on_off_strong.mp4
Multi-rev no detents
multi_rev_no_detents.mp4
Types of changes
Checklist:
Software
.github/workflows/build.yml
file to add my new test to the automated cloud build github action.