Stepper motor PID control using a TMC2209 and AS5600

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ม.ค. 2025

ความคิดเห็น • 60

  • @the_runofff
    @the_runofff 2 หลายเดือนก่อน +1

    this video is so good man. i will be attempting to recreate this (probably just on a breadboard and with a raspberry pi pico). thank you so much for the work

    • @CuriousScientist
      @CuriousScientist  2 หลายเดือนก่อน

      Thanks! Go for it! It is a fun project! I also made it on a breadboard first and then made this PCB.

  • @Helio___
    @Helio___ 11 หลายเดือนก่อน +2

    wonderfull project. I was looking for someting like this for a camera controler for making time lapses.

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน +1

      Thanks! You don't need a sophisticated PID (I mean, no PID at all) for that. I already made such a project: th-cam.com/video/Yd5qOyM1EHs/w-d-xo.html

  • @odhie_r
    @odhie_r 11 หลายเดือนก่อน +1

    amazing. just control with PID ? because I see you react to the stepper motor but the motor returns to the set point position at 16:28 minutes

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน +2

      The PID algorithm tries to maintain the setpoint, no matter what. So if I move the shaft by force, the algorithm notices that the position of the shaft is outside the setpoint, and it drives the motor to return it to the setpoint.

  • @hullinstruments
    @hullinstruments 11 หลายเดือนก่อน +1

    Have you done any experiments with the "openflexure" microscope stage? Or given any thought to a diy scanning laser microscope?
    your videos are always so thorough and bring fresh ideas to the table. I enjoy your projects because you bring a very polished and professional look to diy lab stuff.

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน +1

      Hi! The Diy scanning electron microscope is on my to-do list, but not the laser one. 😄 Or not yet, perhaps. Funnily enough, I just saw a few videos popping up in my feed on the laser scanning microscope lately. I will probably look at it and might implement my approach, however first I need to implement a few other things that are already in the production pipeline.
      Thanks for the compliments. It is really nice to hear such feedback! I try to come up with something decent, as much as my tools and resources allow it.

    • @hullinstruments
      @hullinstruments 11 หลายเดือนก่อน +1

      @@CuriousScientist your content really stands above most because of your professional approach. And the amount of polish you put on your projects. Reminds me of "les's lab" channel and his impressive projects

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน

      Thank you very much! I hope you'll keep following this year's projects because I will publish some very interesting ones.

  • @rkampjak6696
    @rkampjak6696 2 หลายเดือนก่อน +1

    Hi!
    You said many times that there is no really a point of closed loop stepper. But what if im creating a simple robot arm on steppers, dont i need closed loop for keeping positions while holding something?

    • @CuriousScientist
      @CuriousScientist  2 หลายเดือนก่อน

      Hi! If you can make sure that the motors are strong enough so they don't lose steps, you only need to know the initial position of the motor. Then, you can just keep track of the steps.

    • @rkampjak6696
      @rkampjak6696 2 หลายเดือนก่อน +1

      @@CuriousScientist wow, thanks for response! And do you think parts like stm or tmc are good from alie?

    • @CuriousScientist
      @CuriousScientist  2 หลายเดือนก่อน

      Absolutely. I also buy the from there.

    • @rkampjak6696
      @rkampjak6696 2 หลายเดือนก่อน

      @@CuriousScientist i have tried for few days to make stm32 work with as5600, tmc2209 and nema17.
      I have no clue how to make as5600 work with those things. Is there any chance you can help me? Everything is wired properly. I dont know how to program it. Internet didnt help. Please help 👏

    • @CuriousScientist
      @CuriousScientist  2 หลายเดือนก่อน

      Everything can be found in this video and the corresponding article. What's missing then?

  • @TriWahyu45
    @TriWahyu45 11 หลายเดือนก่อน +1

    Do you have any source code, or file that i can download please ?

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน

      Sure, it is on my Patreon.

    • @ngnerd5392
      @ngnerd5392 2 หลายเดือนก่อน +2

      Bayar tong 😂 lu kira gratis.. Enak aja main minta2 kode, masuk sono di patreonnya dia lalu bayar..

    • @TriWahyu45
      @TriWahyu45 2 หลายเดือนก่อน

      @@ngnerd5392 ya iyalah bayar, siapa yang bilang gratis ?, kamu biasanya download gratisan ya ?

  • @rocksolo6788
    @rocksolo6788 10 หลายเดือนก่อน

    I implemented similar solution in my project but I use arduino nano to controll stepper mottor. Problem show when i try to read values from i2c bus (from encoder) and in the same time controll stepper via (curentTime-prevTime > period). This solution works with a huge lag. Should i change encoder or mC for stm or there is some other soluton?

    • @CuriousScientist
      @CuriousScientist  10 หลายเดือนก่อน

      Hi! Without seeing the whole setup and the code, it is hard to say anything...
      But if I assume that you toggle the step pin to move the motor, then it is pretty possible that the i2c introduces a delay which makes the motor to stutter. Also, the MCU I use has a 4x faster clock speed than the Arduino.

  • @NIKOLAY_PSHONIA
    @NIKOLAY_PSHONIA 9 หลายเดือนก่อน

    Thank you . Where can I see all the code?

    • @CuriousScientist
      @CuriousScientist  9 หลายเดือนก่อน

      Hi! It is on my Patreon page.

  • @atrobotpong4256
    @atrobotpong4256 3 หลายเดือนก่อน

    Can you share the code and diagram linking the ESP32 and TMC2209?

    • @CuriousScientist
      @CuriousScientist  3 หลายเดือนก่อน

      Hi! There's no ESP in this circuit. The code is on my Patreon.

  • @javierespejo73
    @javierespejo73 8 หลายเดือนก่อน

    How can i do the model identification for the stepper motor in base of the data of the encoder? I mean, i want the transfer function of the stepper motor (input: voltage (PWM), output: speed of the rotor) to desing a close loop control for muy self balancing robot

    • @CuriousScientist
      @CuriousScientist  8 หลายเดือนก่อน

      Sorry, but I have no idea about what you're asking. The stepper motor is not PWM driven.

  • @TheKoreshshok
    @TheKoreshshok 6 หลายเดือนก่อน

    Hi! Can I use arduino nano and 2209 or 2208 with stepper tmc library? I want to perform simple motor control using buttons and a simple "lcd(0x27,16,2)" display. I haven't seen anyone do it with this library yet.

  • @annaoaulinovna
    @annaoaulinovna 11 หลายเดือนก่อน +1

    wonderful wonderfull wonderfull. thank you so much

  • @callerdosaphor3690
    @callerdosaphor3690 11 หลายเดือนก่อน

    Very nice video. Have you thought about using FOC to control a stepper motor?

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน +1

      Thank you! No, I haven't thought about it.

  • @Need_more_free_time
    @Need_more_free_time 11 หลายเดือนก่อน

    Can you do stall guard on this setup?

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน

      Sure, the driver can do it, so you just need to enable it in the code.

  • @Thomas-ij7ki
    @Thomas-ij7ki 11 หลายเดือนก่อน

    Nice project! Could you provide the code on your website or do I have to type it from the screen?

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน

      It's provided on my Patreon.

    • @Thomas-ij7ki
      @Thomas-ij7ki 11 หลายเดือนก่อน

      @@CuriousScientist Bad development. If I become a Patreon every time just to get one interesting project, I will become poor. It used to be better when people did it out of idealism and didn't think they could get paid for everything through TH-cam.

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน +3

      Yeah, I invested weeks, if not months of my free time to develop this thing, designed a PCB, bought all parts myself, paid for the customs fees, wrote all the code, made the documentation, recorded a video about it and uploaded it to TH-cam purely out of idealism. :) I think I invested nearly $500 in this project, if not more. If you think I don't deserve $5-10 for this, then you can still follow the video and type in the project line by line.

    • @ReinholdStattelmann
      @ReinholdStattelmann 7 หลายเดือนก่อน +1

      ​@@Thomas-ij7ki Who says TH-cam content shouldn't cost anything? Why should developers work for free? You get paid for your work, don't you? Sneak away and do it yourself,

    • @CuriousScientist
      @CuriousScientist  7 หลายเดือนก่อน

      Thank you! Finally, someone who understands!

  • @Jim_One-wl4ke
    @Jim_One-wl4ke 8 หลายเดือนก่อน

    Good job 👍. It’s a close loop system then.

    • @CuriousScientist
      @CuriousScientist  8 หลายเดือนก่อน +1

      Thanks! Yes, it is a closed loop!

    • @Jim_One-wl4ke
      @Jim_One-wl4ke 8 หลายเดือนก่อน +1

      @@CuriousScientist so is there an advantage accuracy & speed if used in 3D printer for example? Thanks for making this video & sharing ❤️

    • @CuriousScientist
      @CuriousScientist  8 หลายเดือนก่อน +1

      @@Jim_One-wl4ke I honestly don't see the advantage of a closed-loop stepper motor. If the system is well-designed, it should not lose steps, even at high speeds and accelerations. If you look at fancier 3D printers, they still have an open-loop stepper motor. These motors (steppers in general) are specifically designed for precision.

    • @Jim_One-wl4ke
      @Jim_One-wl4ke หลายเดือนก่อน

      What if u use a dc motor instead will it go exact? I know steppers per step is 1.8°, but for TMC2209 u may go 256 µsteps 51200pulse Vs 4096 will it get there exact?

    • @CuriousScientist
      @CuriousScientist  หลายเดือนก่อน +1

      You can use a DC motor with an encoder. It is called servo. :) However, if you want to do it on this board, it won't work because the circuit and the program were specifically made for steppers.

  • @waynepetrevan
    @waynepetrevan 11 หลายเดือนก่อน +2

    If you use PID in your control, what is the benefit of using a stepper motor instead of a DC motor?

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน

      It seems that you haven't watched the video. :) I specifically mention the "benefit" of having a PID controller. Maybe if you want to build a stepper motor-based force-feedback mechanism, you can benefit from it. But PID is not really for stepper motors in my opinion. I just made this video, because I had a lot of questions related to this topic, and I also wanted to showcase my stepper motor platform and its capabilities more.

    • @annaoaulinovna
      @annaoaulinovna 11 หลายเดือนก่อน

      pid controller is giving an option when stepper motor makes positioning error. pid reduces position error and stabilizes the machine working. if error not going to zero system stops working to minimize the machine failure and loss. we use pid everywhere in daily life. thermostat of fridge is a pid controller starts and stops the motor for cooling and it have a optimised range.

    • @CuriousScientist
      @CuriousScientist  11 หลายเดือนก่อน

      The thermostat in a fridge is actually NOT PID-controlled. It is a simple On-Off regulator.

    • @waynepetrevan
      @waynepetrevan 11 หลายเดือนก่อน

      @@CuriousScientist I totally understand and agree about the benefits of PID. I just can't see any benefit of using it on a stepper motor versus a DC motor, and that was the intent of my question. Thanks.

    • @danielmclellan7762
      @danielmclellan7762 6 หลายเดือนก่อน +1

      ​@@CuriousScientistdepends on the fridge

  • @medienmond
    @medienmond 11 หลายเดือนก่อน +1

    This looks awesome. Do you have a spare PCB which you could donate to me? I would love to replicate this project, having every conponent but the PCB, a sensor and round magnet . Maybe you would like to make me the happiest guy on earth by helping me out with these 3 things? I would allways love you for this...

  • @atbuen
    @atbuen 11 หลายเดือนก่อน

    Nice first one here