Making a Arduino Based Closed Loop Stepper Part 1

After working with stepper motors a few times I learned that this awesome bit of electronics has a big disadvantage. When pushing the stepper to its limits, the accuracy of the motor is not that good. In future projects I want to push the steppers to their max without any accuracy loss, that’s why I decided to build a Arduino Based Closed Loop Stepper.
Part 2 • Making an Arduino Clos...
A good 3D printer:
www.banggood.com/DIY-Creality...
Steppers are accurate high torque direct current electro motors. You can find them in many devices, from 3D-Printers, actuator and even in transmissions of cars. The main difference from normal electro motor is the fact that they are control by electronic pulses. One pulse to the motor results in one step.
You can say that the stepper is blind. It has no way to check if the movement is has done is the same as the microcontroller has told it to do. The optical rotary encoder act as the eyes of the stepper. When the Arduino Based Closed Loop Stepper gets 200 pulses from the microcontroller but the rotary encoder detects that only 197 steps were mad, we can assume that we lost 3 steps. The system can now correct it’s mistake and give the 3 extra steps.
Building a Arduino Based Closed Loop Stepper can be seen as bit impractical. Why don’t you just buy a closed loop stepper… The answer is simple. Cost. This closed loop stepper can be built for less than 30 USD. Buying one, of this size, will cost you 3 to 5 times as much.
Support the channel: paypal.me/mbcreates
Hall Effect Magnetic Sensor Module: goo.gl/u4abdu (10% OFF Coupon: elec)
x Geekcreit® ATmega328P Nano V3 Controller Board: goo.gl/buUMV7
A good 3D printer:
www.banggood.com/DIY-Creality...

Пікірлер: 108

  • @MBcreates
    @MBcreates5 жыл бұрын

    A good 3D printer: www.banggood.com/DIY-Creality-CR-10-3D-Printer-300300400mm-Printing-Size-1_75mm-0_4mm-Nozzle-p-1085645.html?p=CR190314405010201709

  • @walteryang1338
    @walteryang13386 жыл бұрын

    Just the kind of explanation video I have been looking for, really appreciate it.

  • @egemens
    @egemens6 жыл бұрын

    I just made a bunch for a cnc conversion i did and this approach really shines when you put some variable load on the motor.

  • @gregthomas7950
    @gregthomas79503 жыл бұрын

    Good job! I've been toying with the idea of something like this for a 3d printer.

  • @johnmellor6065
    @johnmellor60656 жыл бұрын

    brilliantly constructed in my opinion

  • @tadrozycki7929
    @tadrozycki79295 жыл бұрын

    Very good explain why closed loop is better . Thanks!!!

  • @michaelbuchholz992
    @michaelbuchholz9926 жыл бұрын

    Nice so far - and really needed, if you are driving the stepper without smooth acceleration!!! That's, why you find in some slicer programs (i.e. Cura) those acceleration values. If you start the stepper with slow steps and make them faster until top speed, you will not loose steps too - and your candy sorting machine will be a lot smaller and cheaper. By the way - someone mentioned a servo - for the wrong reason, but that will do the job too and servos are even smaller and cheaper than steppers. And the Arduino just needs one pin, to control a servo - two pins for a stepper.

  • @Lolerburger

    @Lolerburger

    2 жыл бұрын

    If you're doing "smooth acceleration" you're losing speed. The entire point of a closed loop stepper like in this video would be to max out speed so velocity smoothing is not needed.

  • @vanepico
    @vanepico6 жыл бұрын

    I can't be the only one that grimaced when you didn't clock that pulley in your chuck before boring it out xD

  • @Byzmax

    @Byzmax

    6 жыл бұрын

    No you were not :-)

  • @m3chanist

    @m3chanist

    6 жыл бұрын

    Aye, and looked like about 1mm of runout just to the naked eye... a shocker

  • @bassome3000ify
    @bassome3000ify6 жыл бұрын

    Awesome, I'm glad I found your channel, Subbed!!

  • @MBcreates

    @MBcreates

    6 жыл бұрын

    welcome aboard ;)

  • @oshanfernando1169
    @oshanfernando11694 жыл бұрын

    Very good demonstration

  • @alanb76
    @alanb766 жыл бұрын

    Noting the position after a move and correcting for lost steps with a retry is useful, but it is not always sufficient. If you were cutting a circle, for example, with two motors running simultaneously, correcting after the motion makes a different, imperfect motion when steps are lost on one motor and not the other. A true feedback system will correct in real time during the motion along the trajectory. This is why they are more complicated and costly.

  • @geoffhubbard7815

    @geoffhubbard7815

    5 жыл бұрын

    I understand your point, but a complex cutter wouldn't likely be moving at the max speed of the stepper and knocking all around like this either; his design remains useful for specific applications, including tracking dual cutters; just not at break neck speeds.

  • @Lolerburger

    @Lolerburger

    2 жыл бұрын

    @@geoffhubbard7815 Yes, but if the cut material provides resistance like in a cnc machine, which is typically where these closed loops are needed, then that problem can occur even at slow speeds.

  • @dernicolas6281
    @dernicolas62816 жыл бұрын

    well done and explained. :)

  • @franciscofortunato1864
    @franciscofortunato18642 жыл бұрын

    Magnifica ejecución y una interesante muestra, de las posibilidades infinitas del cnc. Gracias por compartir!

  • @jiangj001
    @jiangj0016 жыл бұрын

    Is that possible to share the code for the control? I'm wondering how often does the encoder check the position? At the end point or periodically checking in the middle.

  • @vp.8181
    @vp.81812 жыл бұрын

    Very well explained ❤️❤️❤️

  • @iszlaimatyasjeno1301
    @iszlaimatyasjeno13016 жыл бұрын

    Awesome idea

  • @huistv2005
    @huistv20056 жыл бұрын

    My rotary encoder has an output of 250 mV. Yours probably to. How did you connect it with the arduino? Did you use a transistor or something similar? Looks cool.. thx

  • @abdullah1234ization
    @abdullah1234ization6 жыл бұрын

    can you please post the code? and the encoder used thanks!

  • @karounkapedrokilombo2374
    @karounkapedrokilombo23744 жыл бұрын

    Good job

  • @JM_Tushe
    @JM_Tushe2 жыл бұрын

    Awesome. How much does that encoder cost? Or what's the name of it?

  • @senthilarumugam5343
    @senthilarumugam53436 жыл бұрын

    Hi sir im having some problem with my timing pulley assembly can u guide me how to slove it

  • @mohammedaminaissou2285
    @mohammedaminaissou22856 жыл бұрын

    Amazing !

  • @itsthedanyole
    @itsthedanyole6 жыл бұрын

    Nice, crispy, high quality audio! Cool project too. Source code please??

  • @user-tl7he3ye4p
    @user-tl7he3ye4p8 ай бұрын

    Hello, what kind of software do you use? Is it compatible with a step and direction signal

  • @pco1984
    @pco19842 жыл бұрын

    What I'm wondering now, is can you un-power the motor so you can read out the value on the encoder (like a digital read-out)? This would be great for instance for a CNC conversion on a lathe or something; you'd still be able to turn the handwheels manually, but also sometimes program and use CNC.

  • @projecthivemind3239

    @projecthivemind3239

    Жыл бұрын

    You definitely could.

  • @drustan6890
    @drustan68906 жыл бұрын

    also, is the hall effect sensor used to "home" the stepper motor?

  • @sNEAKYnIGHTmUPPET
    @sNEAKYnIGHTmUPPET6 жыл бұрын

    can you please post a link to that encoder? thanks in advance

  • @briwicklab
    @briwicklab6 жыл бұрын

    how to increase the speed. would you share the code? is it the video, or is it the speed of full step? did u use the microstep on 8825?

  • @cbdzcbdz
    @cbdzcbdz6 жыл бұрын

    What is the purpose of the Hall Effect Sensor? The rotary encoder should do all the counting, and therefore know the location of the motor/encoder at each step.

  • @zeytelaloi

    @zeytelaloi

    6 жыл бұрын

    I think it doesn't need it while the system is in operation, but if he turns the system off and then on he can use the hall effect sensor to re-adjust it to a 0. Even if he were to continuously save the position to some kind of long-term memory (e.g. the Arduino EEPROM), it would suck if someone turned the arrow while the system was off.

  • @kubiedubie

    @kubiedubie

    6 жыл бұрын

    yared94 is correct. The hall effect sensor acts as the "home" position and tells the controller a given known position upon startup. Powering down the system or making mechanical repairs requires a re-home of the controller.

  • @Tosnic

    @Tosnic

    6 жыл бұрын

    I guess that using a hall effect sensor would not be precise enough for steppers with many steps per revolution (or geared steppers, that is). I was wondering about how to get a "zero position" working with my setup (600 steps per revolution stepper motor). At least the hall effect sensor is an idea I could not come up with.

  • @dineshvyas
    @dineshvyas2 жыл бұрын

    What is the function of optical encoder? Just a bearing for magnet?

  • @ZulkaifAhmed1
    @ZulkaifAhmed13 жыл бұрын

    Is it possible to add feedback just by using Encoder instead of enoder motor

  • @MiniatureWorld_01
    @MiniatureWorld_014 жыл бұрын

    Hello, Can you explain why you need a hall effect sensor ? Isn't the rotary encoder has optical sensor internally to detect shaft movement ?

  • @petermwheeler

    @petermwheeler

    3 жыл бұрын

    To zero the encoder, it's likely not an absolute encoder and even if it is, you have to calibrate it to somewhere.

  • @drustan6890
    @drustan68906 жыл бұрын

    Hi, i got a question for you. Is it necessary to convert a stepper motor into a closed loop one or is relying on its step/revolution enough to be accurate in tracking position?

  • @meriemalahmadihammou6073

    @meriemalahmadihammou6073

    6 жыл бұрын

    In order to obtain a good precision you should use it..otherwise the stepper motor will memorize it's previous position as a reference... you'll find more details in the link below: phidgets.wordpress.com/2014/05/13/steppers-with-encoders-when-open-loop-control-isnt-enough/

  • @AnwarAlfaqeehAlhusseini
    @AnwarAlfaqeehAlhusseini5 жыл бұрын

    hi i have ac servo motors without drive can you tel me please if i can used it without drive servo i mean convert it to just stepper motor that i can used stepper drive with it ? anther thing i found in scrap ac servo without encoder in the back >> can i used it and how thanks

  • @sailjunky7326

    @sailjunky7326

    5 жыл бұрын

    AC servos are permanent magnet 3 phase AC motors with encoders attached. Totally different technologie than a stepper. You need an ac servo drive to control an AC servomotor.

  • @AnwarAlfaqeehAlhusseini

    @AnwarAlfaqeehAlhusseini

    5 жыл бұрын

    Sail Junky thank you 🙏

  • @piyushkushwah3352
    @piyushkushwah33523 жыл бұрын

    can you plz help me to make a code for dmx stapper motor with encoder

  • @raphanunu6912
    @raphanunu69126 жыл бұрын

    This is a working but costly solution, rotary encoders aren't cheap and an extra mechanical part is needed. Usually, when we need speed and accuracy, we use only a hall sensor and decrease speed just after it's been active, not to lose any step. This works fine while movement implies a pass on the sensor, but software can manage this easily.

  • @AlyMabrouk2012
    @AlyMabrouk20126 жыл бұрын

    great

  • @megas4078
    @megas40786 жыл бұрын

    did u have an optical encoder? y didnt u use an absolute encoder better results m8?

  • @Ebuilt

    @Ebuilt

    6 жыл бұрын

    how much does this absolute encoder cost?

  • @ianide2480
    @ianide24806 жыл бұрын

    I do believe that I am developing a nervous twitch in my eye after to many videos with *&^##@! music instead of dialog

  • @MrGarkin
    @MrGarkin6 жыл бұрын

    What encoder has been used?

  • @MBcreates

    @MBcreates

    6 жыл бұрын

    www.amazon.de/gp/product/B015GYY7XU/ref=oh_aui_detailpage_o00_s00?ie=UTF8&psc=1

  • @tootingcarmoon532
    @tootingcarmoon5324 жыл бұрын

    Thank you for this very nice tutorial. How are you planning to use the stepper to actually drive something, since the pulley for the encoder belt takes all the shaft? Would it be possible to come up with a solution which doesn't imply having an extension shaft?

  • @nrml76

    @nrml76

    4 жыл бұрын

    Buy a double shaft stepper motor. and directly mount the encoder on to the back of the stepper with a coupling.

  • @tootingcarmoon532

    @tootingcarmoon532

    4 жыл бұрын

    @@nrml76 Hi again, I managed to construct a belt drive, but it with a 4:1 stepper to encoder ratio. However, I am having issues with the pulses generated by the encoder. They are not constant from one step of the motor to the other. Do you have any idea what the reason might be? I 3D printed the pulleys, so maybe that has an effect. I can see that the belt is wobbling a bit as the pulleys rotate.

  • @horrorhotel1999
    @horrorhotel19996 жыл бұрын

    Maybe I am wrong on this one, but isn't this the same feature the TMC2130 stepper diver is supposed to accomplish?

  • @MichaelWoodrum

    @MichaelWoodrum

    6 жыл бұрын

    Ben Müller how can anything know the actual position without an input? Unless that encoder also has a feedback input, it's guessing that it made it to the specified position.

  • @ndrsg3013

    @ndrsg3013

    6 жыл бұрын

    I don't get the need of an encoder there, if all those tasks can be done with a stepper motor on it's own, or am I wrong?

  • @OU81TWO

    @OU81TWO

    6 жыл бұрын

    @Ben Müller No. The TMC2130 can detect skipped steps and make corrections but...it still has no idea where it's positioned. The position is based on a calculation as opposed to reading an input from the actual position itself. The solution in this video is quite elegant in fact. The system will always know a given position of the belt and make corrections as necessary regardless if the stepper motor skips steps.

  • @KawekSL

    @KawekSL

    6 жыл бұрын

    This optical encoder also don't "know" its position, it is incremental encoder so position is also based on calculation. It can lose "step" with high speeds. Whould be nice to see same test with TMC2130 without encoder

  • @BrianBoniMakes

    @BrianBoniMakes

    6 жыл бұрын

    The hall effect sensor gives an absolute position.

  • @botak333
    @botak333 Жыл бұрын

    Whre is the code?

  • @AdrianSchwizgebel
    @AdrianSchwizgebel6 жыл бұрын

    Please give me your address, I'm gonna send you an assortment of washers!

  • @AbhishekThakur-wl1pl

    @AbhishekThakur-wl1pl

    6 жыл бұрын

    Adrian Schwizgebel 😆️

  • @ivanrodionov9724

    @ivanrodionov9724

    6 жыл бұрын

    you have bearings as well? If so, send me some as well :D!

  • @craftzars

    @craftzars

    4 жыл бұрын

    Yeah same, i was like wtf u n use washers on plastic :D

  • @Aurimantassan
    @Aurimantassan6 жыл бұрын

    Nice project !!! do you share arduino code on public ? Or this is just for your use. Or maybe it's possible to ask you for code personally :)

  • @MBcreates

    @MBcreates

    6 жыл бұрын

    Thanks Auryz! The public version will be posted in de video description somewhere in the next couple of weeks. I’ll give you a heads up!

  • @haith2407

    @haith2407

    6 жыл бұрын

    Please show up your details about this project... Still more than 3 weeks since...

  • @Aurimantassan

    @Aurimantassan

    6 жыл бұрын

    Some news about public version ?

  • @bobbywelch3499

    @bobbywelch3499

    6 жыл бұрын

    Any news on about the public version of the code going out. My project currently is similar to this setup.

  • @benjaminkeplinger

    @benjaminkeplinger

    6 жыл бұрын

    I am in as well for the arduino code .... a public release would GREAT !

  • @sonuverma2796
    @sonuverma27966 жыл бұрын

    Sir what difference closed loop stepper motor and hybrid servo motor

  • @silverdog63

    @silverdog63

    6 жыл бұрын

    none

  • @sonuverma2796

    @sonuverma2796

    6 жыл бұрын

    Your mean hybrid servo motor and closed loop stepper motor is same , only called different name

  • @silverdog63

    @silverdog63

    6 жыл бұрын

    hybrid motor is another name for stepper motor

  • @silverdog63

    @silverdog63

    6 жыл бұрын

    here if you want a deeper understaning: www.motioncontroltips.com/the-hybrid-servomotor-stepping-up-to-closed-loop/

  • @Ebuilt
    @Ebuilt6 жыл бұрын

    where to buy this encoder?

  • @poordecisionsgarage9834

    @poordecisionsgarage9834

    6 жыл бұрын

    Raja Haseeb ebay

  • @drustan6890
    @drustan68906 жыл бұрын

    public code to share? please

  • @claudiuoctavian1972
    @claudiuoctavian19726 жыл бұрын

    While interesting, it's not practical. Most application that require steppers, also require precision and correcting steps after they where lost is not precise. For fast and accurate control, DC motors equipped with encoders are typically used.

  • @cicciofranco405
    @cicciofranco4056 жыл бұрын

    very compliment from Palermo :-) Francesco Pa

  • @Paul17yo
    @Paul17yo6 жыл бұрын

    music name pls ? :)

  • @tahirkamboh147
    @tahirkamboh1474 жыл бұрын

    Code?

  • @JaakkoF
    @JaakkoF6 жыл бұрын

    You know, those closed loop steppers from Leadshine do not cost that much. No point in doing these yourself other than to learn about closed loop controls.

  • @ReactionTime344
    @ReactionTime3446 жыл бұрын

    Love it, can you now retrofit it to a 3d printer :P?

  • @MBcreates

    @MBcreates

    6 жыл бұрын

    That would be perfectly possible ;) But this one goes in a candy sorting machine!

  • @lezbriddon

    @lezbriddon

    6 жыл бұрын

    the cheapest 3d printers run in 1/16th of full steps with pwm control, so can lose 1/16th, is the encoder that accurate? the newer drivers run 1/256 steath chop pwm or spread spectrum pwm, torque is reduced and chance of missed steps even higher. i thought 1/16th was voodoo but 256......

  • @paulwyleciol3459
    @paulwyleciol34595 жыл бұрын

    01:33 ma gemein ;-(

  • @MJPilote
    @MJPilote6 жыл бұрын

    Oh well, another hollow promise to the people with no coding skills. I call it click bait.

  • @danieltabrizian

    @danieltabrizian

    6 жыл бұрын

    I call stop nagging and get learning. Arduinos C is incredibly easy compared to other languages

  • @MadHatter123456

    @MadHatter123456

    6 жыл бұрын

    daniel tabrizian, a little holding of hands and a little advice as well as something to start with comes a long way when someone is starting learning something new. I started using Arduinos about a year ago and without the help of others as well as sample-code I wouldn't be where I am today. Unless you're a stable genius, one is having a hard time learning steppers, rotary encoders and PID control all by himself. So. Yes. Not providing the code here is somewhat comparable to clickbait.

  • @rondlh20
    @rondlh206 жыл бұрын

    Interesting, stationary drill, rotating part :D Steppers are not blind... check out Trinamic's stall guard: kzread.info/dash/bejne/gqarmdmHkZWWd84.html

  • @hellopellos

    @hellopellos

    2 жыл бұрын

    yeah its called a lathe

  • @deeepakkushwah2503
    @deeepakkushwah25033 жыл бұрын

    Can you please help me to make a code for dmx stapper motor with encoder

  • @deeepakkushwah2503

    @deeepakkushwah2503

    3 жыл бұрын

    Please help me