Making a Arduino Based Closed Loop Stepper Part 1

แชร์
ฝัง
  • เผยแพร่เมื่อ 19 ก.ย. 2017
  • 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
    @MBcreates  5 ปีที่แล้ว

    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
    @walteryang1338 6 ปีที่แล้ว +2

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

  • @egemens
    @egemens 6 ปีที่แล้ว

    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
    @gregthomas7950 3 ปีที่แล้ว

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

  • @johnmellor6065
    @johnmellor6065 6 ปีที่แล้ว

    brilliantly constructed in my opinion

  • @tadrozycki7929
    @tadrozycki7929 5 ปีที่แล้ว +1

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

  • @michaelbuchholz992
    @michaelbuchholz992 6 ปีที่แล้ว +6

    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
    @vanepico 6 ปีที่แล้ว +14

    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 ปีที่แล้ว +2

      No you were not :-)

    • @m3chanist
      @m3chanist 6 ปีที่แล้ว +1

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

  • @bassome3000ify
    @bassome3000ify 6 ปีที่แล้ว +2

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

    • @MBcreates
      @MBcreates  6 ปีที่แล้ว +1

      welcome aboard ;)

  • @alanb76
    @alanb76 6 ปีที่แล้ว +11

    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.

  • @oshanfernando1169
    @oshanfernando1169 4 ปีที่แล้ว

    Very good demonstration

  • @dernicolas6281
    @dernicolas6281 6 ปีที่แล้ว

    well done and explained. :)

  • @franciscofortunato1864
    @franciscofortunato1864 2 ปีที่แล้ว

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

  • @jiangj001
    @jiangj001 6 ปีที่แล้ว +6

    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.8181 2 ปีที่แล้ว

    Very well explained ❤️❤️❤️

  • @iszlaimatyasjeno1301
    @iszlaimatyasjeno1301 6 ปีที่แล้ว

    Awesome idea

  • @huistv2005
    @huistv2005 6 ปีที่แล้ว

    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
    @abdullah1234ization 6 ปีที่แล้ว +6

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

  • @karounkapedrokilombo2374
    @karounkapedrokilombo2374 4 ปีที่แล้ว

    Good job

  • @JM_Tushe
    @JM_Tushe 2 ปีที่แล้ว +1

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

  • @senthilarumugam5343
    @senthilarumugam5343 6 ปีที่แล้ว

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

  • @mohammedaminaissou2285
    @mohammedaminaissou2285 6 ปีที่แล้ว

    Amazing !

  • @itsthedanyole
    @itsthedanyole 6 ปีที่แล้ว

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

  • @user-tl7he3ye4p
    @user-tl7he3ye4p 8 หลายเดือนก่อน

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

  • @pco1984
    @pco1984 2 ปีที่แล้ว +1

    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.

  • @drustan6890
    @drustan6890 6 ปีที่แล้ว

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

  • @briwicklab
    @briwicklab 6 ปีที่แล้ว

    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?

  • @sNEAKYnIGHTmUPPET
    @sNEAKYnIGHTmUPPET 6 ปีที่แล้ว

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

  • @cbdzcbdz
    @cbdzcbdz 6 ปีที่แล้ว +1

    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 ปีที่แล้ว +2

      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
    @dineshvyas 2 ปีที่แล้ว

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

  • @ZulkaifAhmed1
    @ZulkaifAhmed1 3 ปีที่แล้ว

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

  • @MiniatureWorld_01
    @MiniatureWorld_01 4 ปีที่แล้ว +4

    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
    @drustan6890 6 ปีที่แล้ว

    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 ปีที่แล้ว +1

      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
    @AnwarAlfaqeehAlhusseini 5 ปีที่แล้ว +1

    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 ปีที่แล้ว +1

      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
    @piyushkushwah3352 3 ปีที่แล้ว

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

  • @raphanunu6912
    @raphanunu6912 6 ปีที่แล้ว

    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
    @AlyMabrouk2012 6 ปีที่แล้ว

    great

  • @megas4078
    @megas4078 6 ปีที่แล้ว +1

    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
    @ianide2480 6 ปีที่แล้ว +19

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

  • @MrGarkin
    @MrGarkin 6 ปีที่แล้ว +2

    What encoder has been used?

    • @MBcreates
      @MBcreates  6 ปีที่แล้ว +1

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

  • @tootingcarmoon532
    @tootingcarmoon532 4 ปีที่แล้ว

    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
    @horrorhotel1999 6 ปีที่แล้ว

    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 ปีที่แล้ว +1

      @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
    @AdrianSchwizgebel 6 ปีที่แล้ว +34

    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
    @Aurimantassan 6 ปีที่แล้ว +2

    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 ปีที่แล้ว +1

      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
    @sonuverma2796 6 ปีที่แล้ว

    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 ปีที่แล้ว +1

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

  • @Ebuilt
    @Ebuilt 6 ปีที่แล้ว

    where to buy this encoder?

  • @drustan6890
    @drustan6890 6 ปีที่แล้ว

    public code to share? please

  • @claudiuoctavian1972
    @claudiuoctavian1972 6 ปีที่แล้ว

    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
    @cicciofranco405 6 ปีที่แล้ว

    very compliment from Palermo :-) Francesco Pa

  • @Paul17yo
    @Paul17yo 6 ปีที่แล้ว

    music name pls ? :)

  • @tahirkamboh147
    @tahirkamboh147 4 ปีที่แล้ว

    Code?

  • @JaakkoF
    @JaakkoF 6 ปีที่แล้ว +1

    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
    @ReactionTime344 6 ปีที่แล้ว

    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
    @paulwyleciol3459 5 ปีที่แล้ว

    01:33 ma gemein ;-(

  • @MJPilote
    @MJPilote 6 ปีที่แล้ว +4

    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 ปีที่แล้ว +1

      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
    @rondlh20 6 ปีที่แล้ว

    Interesting, stationary drill, rotating part :D Steppers are not blind... check out Trinamic's stall guard: th-cam.com/video/Prw7wNa20Gk/w-d-xo.html

    • @hellopellos
      @hellopellos 2 ปีที่แล้ว

      yeah its called a lathe

  • @deeepakkushwah2503
    @deeepakkushwah2503 2 ปีที่แล้ว

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