Skip to content

Latest commit

Β 

History

History
53 lines (30 loc) Β· 2.35 KB

File metadata and controls

53 lines (30 loc) Β· 2.35 KB

Throttle Motor Control with Hall Sensor

Welcome to the Throttle Motor Control with Hall Sensor repository! This project offers a proficient control mechanism for motors using a Hall-effect throttle sensor. The core advantage of this code is delivering smooth and adjustable acceleration/deceleration responses based on the Hall sensor input.

πŸš€ Features

  • Debounce Mechanism: Assures only substantial changes in the Hall sensor throttle position are processed, negating any minor jittery fluctuations.

  • Ease-in Acceleration: Achieve polished acceleration or deceleration based on the variance between the current and target speed, granting full reign over motor behavior.

  • Speed Mapping: Converts Hall sensor readings (analog input) to a suitable motor speed (PWM output).

  • Safety Clamps: Enforces PWM limits to ensure motor safety.

🧰 Prerequisites

  • Hardware:

    • Motor with a PWM-compatible driver.
    • Throttle based on a Hall-effect sensor.
    • Arduino board or equivalent microcontroller.
  • Software:

    • Arduino IDE or an analogous platform for programming your microcontroller.

πŸ›  Setup

  1. Connect the Hall-effect throttle sensor to the analog pin designated as throttlePin (default: A0).
  2. Interface the motor driver's PWM input to the digital pin denoted as motorPin (default: pin 3).
  3. Power your board and upload the included code.

βš™οΈ Configuration

The code presents several adjustable parameters:

  • accelerationFactor: Modulate the intensity of the ease-in acceleration. Smaller values yield a gentler motor reaction to throttle alterations, while bigger values elicit a brisker response.

  • speedDifferenceThreshold: Dictates when the motor directly matches the target speed versus utilizing the ease-in technique.

  • debounceThreshold & debounceInterval: Fine-tune the debounce system for the throttle to heighten responsiveness or mitigate jitters.

Personalize these settings for the desired motor activity.

πŸ“ License

This project is under the MIT License - refer to the LICENSE.md document for specifics.

🀝 Contribution

Please feel invited to fork, enhance, suggest improvements, or create PRs to refine this Hall sensor-based motor control solution!


Happy Engineering! πŸš€