How to wiring Stepper Motor buit-in Encoder with Arduino

Поделиться
HTML-код
  • Опубликовано: 21 янв 2025

Комментарии • 12

  • @botak333
    @botak333 Год назад

    It is posible to move the stepper by the angle?

  • @sejungsong
    @sejungsong Год назад +3

    Thank you for sharing the great content! I am using the same stepper motor. It looks like EA- and EB- cables from the encoder are not connected to Arduino? Should I leave the two lines as it is? Or should they be connected to GND?

  • @carology1642
    @carology1642 Год назад +1

    what is the part that you are using to display angular position called and how did u show it

  • @didiersee
    @didiersee 2 года назад

    Congratulations from Belgium and thank you for sharing. 👋👏👍

  • @ketikasemestatiada
    @ketikasemestatiada Год назад

    Hii.. this program can show actial rpm on lcd? Pls help me

  • @vobinhthu5299
    @vobinhthu5299 2 года назад

    This project is very good!

  • @no1slisteninganyway
    @no1slisteninganyway 2 года назад

    Very nice!

  • @strongme80
    @strongme80 Год назад

    Now wire up a noisy Grove (pot) Joystick using just the X axis to the Arduino to control the motor position and let's see if it can handle the jitter and also the motor returns home when the joystick is centered as well. I use "Exponential Smoothing" to address the jitter but for some reason sometimes the motor can't find its way back home and it becomes off. I also use an L298N and Arduino GIGA R1. Let me know, thanks!
    Here's my code:
    #include
    // Change this to the number of steps on your motor
    #define STEPS 200
    // Create an instance of the stepper class, specifying
    // the number of steps of the motor and the pins it's
    // attached to
    Stepper stepper(STEPS, 7, 6, 5, 4);
    // The previous filtered sensor reading
    float filteredSensorValue = 0;
    // The previous filtered reading for smoothing
    float filteredPrevious = 0;
    // The smoothing factor (alpha value)
    float alpha = 0.2; // You can adjust this value as needed
    void setup() {
    // Set the speed of the motor to 200 steps per second
    stepper.setSpeed(200);
    // Initialize the filtered sensor reading
    filteredSensorValue = analogRead(0);
    filteredPrevious = filteredSensorValue; // Initialize filteredPrevious
    }
    void loop() {
    // Get the raw sensor value
    int rawSensorValue = analogRead(0);
    // Apply exponential smoothing to the sensor reading
    filteredSensorValue = alpha * rawSensorValue + (1 - alpha) * filteredPrevious;
    // Calculate the difference between the filtered and previous readings
    int diff = abs(filteredSensorValue - filteredPrevious);
    // Move the stepper motor only if the difference is greater than a threshold (e.g., 5)
    if (diff > 5) {
    // Move a number of steps equal to the change in the sensor reading
    stepper.step(filteredSensorValue - filteredPrevious);
    // Update the previous filtered reading
    filteredPrevious = filteredSensorValue;
    }
    }

  • @arduinomaquinas
    @arduinomaquinas Год назад

    Like 124, big show 👏👏👏

  • @alirashad5828
    @alirashad5828 Год назад

    the postion control mode should be tested in higher speed

  • @arunachalam.p3646
    @arunachalam.p3646 2 года назад

    I love you ❤❤❤❤

  • @aidando649
    @aidando649 2 года назад

    Good!!!