Stepper motor PID control using a TMC2209 and AS5600

  Рет қаралды 14,775

Curious Scientist

Curious Scientist

Күн бұрын

Пікірлер: 60
@the_runofff
@the_runofff 16 күн бұрын
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 16 күн бұрын
Thanks! Go for it! It is a fun project! I also made it on a breadboard first and then made this PCB.
@Helio___
@Helio___ 10 ай бұрын
wonderfull project. I was looking for someting like this for a camera controler for making time lapses.
@CuriousScientist
@CuriousScientist 10 ай бұрын
Thanks! You don't need a sophisticated PID (I mean, no PID at all) for that. I already made such a project: kzbin.info/www/bejne/j5WYooKvgpZ4ftU
@hullinstruments
@hullinstruments 10 ай бұрын
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 10 ай бұрын
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 10 ай бұрын
@@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 10 ай бұрын
Thank you very much! I hope you'll keep following this year's projects because I will publish some very interesting ones.
@odhie_r
@odhie_r 10 ай бұрын
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 10 ай бұрын
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.
@rkampjak6696
@rkampjak6696 29 күн бұрын
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 29 күн бұрын
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 29 күн бұрын
@@CuriousScientist wow, thanks for response! And do you think parts like stm or tmc are good from alie?
@CuriousScientist
@CuriousScientist 29 күн бұрын
Absolutely. I also buy the from there.
@rkampjak6696
@rkampjak6696 16 күн бұрын
@@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 16 күн бұрын
Everything can be found in this video and the corresponding article. What's missing then?
@annaoaulinovna
@annaoaulinovna 10 ай бұрын
wonderful wonderfull wonderfull. thank you so much
@CuriousScientist
@CuriousScientist 10 ай бұрын
I'm glad you liked it!
@callerdosaphor3690
@callerdosaphor3690 10 ай бұрын
Very nice video. Have you thought about using FOC to control a stepper motor?
@CuriousScientist
@CuriousScientist 10 ай бұрын
Thank you! No, I haven't thought about it.
@javierespejo73
@javierespejo73 6 ай бұрын
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 6 ай бұрын
Sorry, but I have no idea about what you're asking. The stepper motor is not PWM driven.
@atrobotpong4256
@atrobotpong4256 2 ай бұрын
Can you share the code and diagram linking the ESP32 and TMC2209?
@CuriousScientist
@CuriousScientist 2 ай бұрын
Hi! There's no ESP in this circuit. The code is on my Patreon.
@NIKOLAY_PSHONIA
@NIKOLAY_PSHONIA 8 ай бұрын
Thank you . Where can I see all the code?
@CuriousScientist
@CuriousScientist 8 ай бұрын
Hi! It is on my Patreon page.
@rocksolo6788
@rocksolo6788 9 ай бұрын
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 9 ай бұрын
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.
@Jim_One-wl4ke
@Jim_One-wl4ke 7 ай бұрын
Good job 👍. It’s a close loop system then.
@CuriousScientist
@CuriousScientist 7 ай бұрын
Thanks! Yes, it is a closed loop!
@Jim_One-wl4ke
@Jim_One-wl4ke 7 ай бұрын
@@CuriousScientist so is there an advantage accuracy & speed if used in 3D printer for example? Thanks for making this video & sharing ❤️
@CuriousScientist
@CuriousScientist 7 ай бұрын
@@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.
@JohannesDavidsen
@JohannesDavidsen 26 күн бұрын
Cool
@CuriousScientist
@CuriousScientist 26 күн бұрын
Thanks!
@TriWahyu45
@TriWahyu45 9 ай бұрын
Do you have any source code, or file that i can download please ?
@CuriousScientist
@CuriousScientist 9 ай бұрын
Sure, it is on my Patreon.
@ngnerd5392
@ngnerd5392 17 күн бұрын
Bayar tong 😂 lu kira gratis.. Enak aja main minta2 kode, masuk sono di patreonnya dia lalu bayar..
@TriWahyu45
@TriWahyu45 17 күн бұрын
@@ngnerd5392 ya iyalah bayar, siapa yang bilang gratis ?, kamu biasanya download gratisan ya ?
@TheKoreshshok
@TheKoreshshok 5 ай бұрын
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.
@CuriousScientist
@CuriousScientist 5 ай бұрын
Hi! I think it should work.
@waynepetrevan
@waynepetrevan 10 ай бұрын
If you use PID in your control, what is the benefit of using a stepper motor instead of a DC motor?
@CuriousScientist
@CuriousScientist 10 ай бұрын
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 10 ай бұрын
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 10 ай бұрын
The thermostat in a fridge is actually NOT PID-controlled. It is a simple On-Off regulator.
@waynepetrevan
@waynepetrevan 10 ай бұрын
@@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 5 ай бұрын
​@@CuriousScientistdepends on the fridge
@Thomas-ij7ki
@Thomas-ij7ki 10 ай бұрын
Nice project! Could you provide the code on your website or do I have to type it from the screen?
@CuriousScientist
@CuriousScientist 10 ай бұрын
It's provided on my Patreon.
@Thomas-ij7ki
@Thomas-ij7ki 10 ай бұрын
@@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 KZbin.
@CuriousScientist
@CuriousScientist 10 ай бұрын
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 KZbin 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 5 ай бұрын
​@@Thomas-ij7ki Who says KZbin 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 5 ай бұрын
Thank you! Finally, someone who understands!
@medienmond
@medienmond 10 ай бұрын
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... ❤
@CuriousScientist
@CuriousScientist 10 ай бұрын
Drop me an email. 😎
@Need_more_free_time
@Need_more_free_time 10 ай бұрын
Can you do stall guard on this setup?
@CuriousScientist
@CuriousScientist 10 ай бұрын
Sure, the driver can do it, so you just need to enable it in the code.
@atbuen
@atbuen 10 ай бұрын
Nice first one here
@CuriousScientist
@CuriousScientist 10 ай бұрын
Welcome-welcome!
PID controlled stepper motor. #tmc2209 #arduino #electronics #diy
0:57
Curious Scientist
Рет қаралды 94 М.
AS5600 magnetic position encoder - best encoder for stepper motors
48:18
Curious Scientist
Рет қаралды 114 М.
Каха и лужа  #непосредственнокаха
00:15
N20 miniature DC geared motor with AS5600 encoder and PID
44:26
Curious Scientist
Рет қаралды 4,2 М.
This Component solves "All" Motor Problems?! (Motor Encoder) EB#58
11:34
Position and Speed Control Combined dc Motor
12:21
T.J Moir
Рет қаралды 9 М.
Stepper Motor Control with a Raspberry Pi and DRV8825 Controller!
22:09
Measuring speed and position using the AS5600 magnetic encoder
38:22
Curious Scientist
Рет қаралды 30 М.
Closed loop stepper motors -- very impressive
10:46
Matthias random stuff
Рет қаралды 136 М.
DC motor position control using PID
43:23
Curious Scientist
Рет қаралды 82 М.
DC motor PID speed control
15:29
Curio Res
Рет қаралды 249 М.
Control a Stepper Motor with Hall Effect Switches
28:13
DroneBot Workshop
Рет қаралды 246 М.