How to wiring Stepper Motor buit-in Encoder with Arduino

Поделиться
HTML-код
  • Опубликовано: 14 окт 2024
  • How to wiring Stepper Motor buit-in encoder with Arduino
    www.omc-stepperonline.com
    Nema 17 Closed Loop Stepper Motor 45Ncm/64oz.in with Magnetic Encoder 1000PPR(4000CPR) → bit.ly/3Hrnjz3
    Arduino sketch → github.com/jum...
    ::::::::::: SUPPORT CHANNEL ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    Please Donate To Help Me Afford New Equipment And Software To Make My Videos More : goo.gl/1m8Dg2
    Don't forget to subscribe!

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

  • @sejungsong
    @sejungsong 10 месяцев назад +1

    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 Год назад

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

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

    It is posible to move the stepper by the angle?

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

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

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

    This project is very good!

  • @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;
    }
    }

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

    Very nice!

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

    Like 124, big show 👏👏👏

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

    the postion control mode should be tested in higher speed

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

    Good!!!

  • @arunachalam.p3646
    @arunachalam.p3646 Год назад

    I love you ❤❤❤❤