Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Software defined haptics which can run on a MotorGo-Mini or on a test stand built with a little gimbal BLDC and some off the shelf dev boards

License

NotificationsYou must be signed in to change notification settings

esp-cpp/software-defined-haptics

Repository files navigation

This project contains the MCAD and source files for a BLDC motor test stand,designed to enable running various experiments in openloop control, closed loopcontrol, and user interface / haptics using a small BLDC motor that's commonlyused in camera gimbals.

The code supports running on the custom BLDC Test Stand (TinyS3 Test Stand),as well as on theMotorGo-Mini. You can select which hardware you want to runon viamenuconfig.

Hardware

Either:

  • TinyS3 Test Stand:
    • TinyS3
    • BLDC Motor (I usedthese A and B motors from aliexpress)
    • MT6701 Magnetic Encoder Breakout (I usedthis purple one (color B) from aliexpress)
    • TMC6300 BOB
    • Mini solderless breadboard
    • 3d printed test stand enclosure (.stl and source files in themcad directory)
    • Benchtop power supply (currently running at 5V 1A so many things should work)or:
  • MotorGo-Mini

Configure

idf.py menuconfig

Select which hardware you are building and deploying to.

Build and Flash

Build the project and flash it to the board, then run monitor tool to view serial output:

idf.py -p PORT flash monitor

(Replace PORT with the name of the serial port to use.)

(To exit the serial monitor, typeCtrl-].)

See the Getting Started Guide for full steps to configure and use ESP-IDF to build projects.

Output

The haptics (detent configuration, click/buzz) can be configured dynamically atrun-time using the provided CLI, see screenshot below:

CleanShot 2023-06-23 at 13 23 44

bldc_test_stand-compressed.mp4

As you can see, the cli also allows you to start and stop the haptic engine(default is off when the program starts) and allows you to query the position ofthe motor based on the current detent config. The default detent config is theunbounded_no_detents configuration.

For more information, see the documentation or the original PR:esp-cpp/espp#60

Some examples:

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

Troubleshooting

Make sure to run the code once withzero_electrical_offset set to 0 so thatthe motor will go through a calibration / zero offset routine. At the end ofthis startup routine it will print the measured zero electrical offset that youcan then provide within the code, at which point it will not need to run thecalibration routine.

You must run this calibration any time you change your hardware configuration(such as by remounting your motor, magnet, encoder chip).

Code Breakdown

This example encapsulates the board support packages into one of two components:

  • espp::TinyS3TestStand (in this repo)
  • espp::MotorGoMini (in espp)

These components build complex haptic behavior using thefollowing components:

  • espp::Mt6701
  • espp::BldcDriver
  • espp::BldcMotor
  • espp::BldcHaptics
  • espp::I2c

You combine theMt6701 andBldcDriver together when creating theBldcMotorand then simply pass theBldcMotor to theBldcHaptics component. At thatpoint, you only have to interface to theBldcHaptics to read the inputposition or reconfigure the haptics.

About

Software defined haptics which can run on a MotorGo-Mini or on a test stand built with a little gimbal BLDC and some off the shelf dev boards

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp