Week 3 - Advanced HID Control, Motor Optimization

🚀 Week 3 - Advanced HID & Motor Optimization

📅 Date: 2025-02-10 – 2025-02-16
🏷️ Tags: Year 2 Project, ESP32-S3, Smart Knob, HID Expansion, FOC, Force Feedback


🎯 This Week's Goals

  1. Expand Bluetooth HID functionalities to include more input methods (keyboard shortcuts, Surface Dial emulation).
  2. Optimize motor control using Field-Oriented Control (FOC) to improve force feedback.
  3. Improve real-time motor response to user interactions.
  4. Integrate Bluetooth HID with force feedback for dynamic resistance changes.

🔹 1️⃣ Enhancing HID Functionality

To make the Smart Knob more versatile, we expanded its HID (Human Interface Device) capabilities, allowing:

Rotational input mapped to scrolling, zooming, and volume control.
Clicking the knob to perform shortcut actions (e.g., Ctrl+Z, Enter, Tab switching).
Long press and double-click for advanced functions.
Integration with Surface Dial API for better Windows compatibility.

📌 Code Implementation - BLE HID Shortcuts

We modified the BLE HID functions to support custom keyboard shortcuts.



What This Does:

  • Expands HID functions to support keyboard shortcuts.
  • Allows knob rotation to trigger scrolling or zooming actions.
  • Maps button press to Ctrl+Z (undo action).

🔹 2️⃣ Improving Motor Control & Force Feedback

We refined FOC-based motor control to:
Provide a smoother force feedback experience.
Adjust torque dynamically based on user input.
Enhance stability at different speed levels.
📌 Code Implementation - Optimized FOC Motor Control


What This Does:

  • Uses FOC for precise motor control.
  • Dynamically adjusts torque based on rotation feedback.
Ensures smooth force feedback for different interactions.

🔹 3️⃣ HID & Motor Integration for Dynamic Resistance

We integrated HID input with force feedback, so the knob’s resistance changes dynamically based on user actions.

📌 Code Implementation - Bluetooth HID & Motor Synchronization


What This Does:

  • Links motor control with HID input to adjust force dynamically.
  • Knob resistance changes based on user input (e.g., scrolling in different directions).
  • Provides a more natural, intuitive interaction experience.

🔥 Issues & Solutions

IssueSolution Implemented
HID latency in fast interactionsIncreased Bluetooth polling rate, optimized event handling
Motor resistance was inconsistentTuned FOC parameters for smoother
HID shortcuts not recognized on some platformsAdjusted HID descriptor mappings
Force feedback felt unnatural at low speedsImproved torque scaling for fine control

📌 Next Week's Plan

Integrate Surface Dial support for Windows.
Optimize final force feedback adjustments.
Perform complete system testing before final integration.


Comments

Popular posts from this blog

Week 4 - Final Debugging & System Integration

Week 1 - Hardware Assembly & Connections

Week 2 - Bluetooth Connection, HID Control & Motor Optimization & 3D Printed Housing