DC motor PID speed control

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ค. 2024
  • GitHub Code (under /SpeedControl):
    github.com/curiores/ArduinoTu...
    If your platform does not have access to "atomic.h" (and so you get an error message), you can use the alternative version of the code that has been uploaded to the repository. It is labeled "_NoAtomic".
    Learn how to control the speed of a DC motor with an encoder using a PID controller. In this video, I walk you through several important steps in this process:
    0. Hardware
    1. Velocity measurements
    2. Measurement filtering
    3. PI control
    4. Variations
    For more information about how an encoder works, see our video "How to control a DC motor with an encoder."
    • How to control a DC mo...
    To learn about low-pass filtering, see our video "How to design and implement a digital low-pass filter on an Arduino."
    • How to design and impl...
    Parts used in this video:
    1. DC Motor - 19:1 Metal Gearmotor 37Dx68L mm 12V with 64 CPR Encoder:
    www.pololu.com/product/4751
    2. Motor Driver - VNH5019 Motor Driver Carrier:
    www.pololu.com/product/1451
    3. Microcontroller - Arduino Uno:
    store.arduino.cc/usa/arduino-...
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @usnaveen
    @usnaveen 4 หลายเดือนก่อน +25

    Just can't believe that this high quality content is available for free. God bless you.

  • @davidjmstewart
    @davidjmstewart ปีที่แล้ว +44

    This is a very high quality piece of content. It is much harder to edit this type of video rather than doing a simple screen share and writing the code, but I think it has paid off. Big fan of showing the iterative procedure of proportional controller, what its limitations are, and moving to the PI controller. I hope you find the time to keep making videos like this.

  • @DavidTLutz
    @DavidTLutz ปีที่แล้ว +7

    Excellent series of videos on dc motors and how to control them. Thank you for not shying away from a bit of theory and mathematics. I find it very 'digestible' and inspires deeper thinking through thorough study of the material you provide. You present a clear expression of your obvious command of the topic. Plus your voice is very pleasant to listen to. Keep up the good work.

  • @pavelmihai6850
    @pavelmihai6850 2 ปีที่แล้ว +24

    I'm studying engineer for 3 years and your videos are pure gold, thank you very much!

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

      Thank you Pavel - and good luck with your studies!

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

    Thank you very much. Your way of explaining things are much better than the most professors in my university.

  • @austin-bowen
    @austin-bowen 2 ปีที่แล้ว +2

    This was exactly the video I needed to remind myself how to build good speed control, thank you!

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

    I agree with all of these reviews, this is quality information presented extremely well. Great job and thumbs up!
    Plus, your voice in these videos is so relaxing to listen to it almost puts me in a trance...
    Thank you so much for such a clear explanation of all of your topics, and please keep them coming 🙂

  • @KirtikSoni
    @KirtikSoni ปีที่แล้ว +3

    Excellent Video! The step-by-step approach coupled with the fluid animations and an amazingly soothing voice made this video an absolute treat watch and learn! Thanks!

  • @Noxafurry
    @Noxafurry ปีที่แล้ว +3

    The channel is brilliant indeed! The last part of the video blew my mind because it is so rare to see similar approach to learning and experimentation! Thank you.

    • @curiores111
      @curiores111  ปีที่แล้ว

      Well thank you Noxafurry. That's very kind :)

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

    I'm really enjoying these videos. So clearly explained and easy to follow especially for an unskilled programmer like myself

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

      Thanks Dustan! I find that arduino/this type of application is a great way to get better and more interested in programming, without an awful slog through a C++ class.

  • @manuel56354
    @manuel56354 2 ปีที่แล้ว +7

    This may well be one of the most clearly explained videos on TH-cam. I'm amazed.

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

      Thanks so much Manuel. My main goal with this one was to explain all the details carefully. You basically have to understand how it works to have any hope of getting a decent response.

  • @avi-brown
    @avi-brown ปีที่แล้ว +3

    Hands down best Arduino-related video I've ever seen. Great quality, in-depth explanations, just excellent.

    • @curiores111
      @curiores111  ปีที่แล้ว

      You are too kind, thank you

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

    I am building an arduino controller for a 4hp dc motor and this video is invaluable!

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

    If someone wants to know or is interested: there are graphic methods to get the ki, ke and even the kd constants. Amazing vid, cheers.

  • @matheuswilgengoncalves
    @matheuswilgengoncalves 2 ปีที่แล้ว +8

    Amazing explanation, thank you! I liked how you compare the methods.

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

      Glad to hear that 😄

  • @luccarodrigues781
    @luccarodrigues781 2 ปีที่แล้ว +9

    Awesome explanation, this is exactly what I subbed for! And those nice graphics are the icing on the cake. Thanks for sharing!

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

      Thanks for the kind words and for stopping by Lucca 😊

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

    100% better than my old control teacher.

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

    Thank you so much for this inspiring video! Finally seeing someone implementing PID control after visiting control engineering class and not seeing any practical examples warms my engineering heart ;D I don't have a motor+encoder flying around, but an led and light sensitive resistor. I guess pid brightness control is now a thing for me. I added a none feedback path to the feedback loop, to make the system more reactive/less prone to oscillating. I add u to a value x that is dependent on my target value. The relationship between the target and x is not perfect, but now the control loop only needs to compensate for the remaining deviation. Not useful in every situation, but worth it in some.

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

    This video was just what I was looking for and you explained everything so well. Thank you so much!

  • @markusbuchholz3518
    @markusbuchholz3518 2 ปีที่แล้ว +54

    From my humble point of view, your channel is brilliant and remarkable. Content very consistent with practical examples and perfectly done. We have to appreciate also you effort in preparation content. Your channel will grow. I keep finger for your goals!

    • @curiores111
      @curiores111  2 ปีที่แล้ว +7

      Thank you Markus, you are too kind 😊.

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

      @@curiores111 hello, I will design the simulink according to the label movement of the information coming from the video controlled with 3 motors, of course, first of all, it will get information from gprs, monitor the coordinates with the satellite camera, track the moving objects and turn in that direction in the motors.which type of block can we use in simulink

    • @ambastaaashishkumarsanjayk2729
      @ambastaaashishkumarsanjayk2729 ปีที่แล้ว

      @@curiores111 hey can you help me with implementing this project

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

      Qjwwwww

  • @Joe-zw9ep
    @Joe-zw9ep ปีที่แล้ว +2

    Exquisitely presented; so clear!

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

    Clearly explanation of how to control motor with pid. Thank for this tutorial. I'm looking for next video

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

    Literally one of the best videos Ive ever seen.. !! excellent explanation . the animations are really easy to understand... and the flow is great too..

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

      You are too kind Will, thank you

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

    I freaking LOVE your channel. Your videos are well thought-out, useful and informative. Please keep them coming.

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

      Thank you (...not sure how to read your name... let's say..) DJ Drover! ;) I've been struggling to decide on something so I appreciate the encouragement.

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

      @@curiores111 ahah its DJ-red rover. Trust me you should keep at this, a few more of your top quality videos and companies are gonna be fighting to be your sponsor. Its always tough in the beginning when you put all this time and effort and seemingly nothing in return but before you know it, all this effort pays off in dt :D. Your mouse-trap (or what sets you apart) is the level of detail you go into and the completeness of the explanation in a very short amount of time. Other similar videos are either short and uninformative, or too long and over explained, you have hit the sweet spot with ur duration, detail, great graphics. Don’t give up!!

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

      @@djredrover Ah DJ red rover! I see it now, lol, I can't believe I didn't get that. XD Well thanks so much, you are far too kind. I appreciate you pointing that out, I will keep that "mouse-trap" in mind and see if I can do the same in the next video.

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

      @@curiores111 If you need some video ideas, here are a few that I personally would love to see your take on:
      -Kalman Filter
      -LQR Controller
      -AM Radio Receiver
      -Audio Synthesizer
      -Camera Gimbal (Investigating an IMU [MPU6050])
      -SRAM & EEPROM Usage w/ Arduino
      -Implementing Multi-Class Software on Arduino
      -LiDAR Implementation
      Just some ideas to help you setup more videos, since most companies that sponsor tech videos/channels, are looking for at least 3.5 videos/month of output. So there needs to be a balance between putting time into making videos as good as possible (good for us) and speeding up production to increase output (good for you to attract sponsors). Maybe you should put a PID controller on it LOL.
      I am an Electrical/Computer Engineer as well so if there is anything I can do to help you out, by all means let me know and I will do what I can! Cheers.

  • @onlooker251
    @onlooker251 5 หลายเดือนก่อน

    Brilliant explanation - wish I had this explanation when I was at college. 👍🙏🙂

  • @dhanushkawijethunga
    @dhanushkawijethunga ปีที่แล้ว

    This channel is a hidden GEM!

  • @nadirsert8235
    @nadirsert8235 ปีที่แล้ว

    thanks for video series. this is the 3th time i am watching. They are full of information.

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

    wonderful explanation

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

    thanks for your video you saved my time. I am trying to controll a blcd motor but have diffuculties about low speed rpm control and your low-pass filter solved my problem.

  • @AlexanderLopez-dv6yr
    @AlexanderLopez-dv6yr ปีที่แล้ว +1

    Excelente video, editing and explanation! Thank you!

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

    For me it's hard to put formulas like these into code so your video is very helpful, thank you!!

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

      Thank you, friend. Happy coding.

  • @lenslens7379
    @lenslens7379 ปีที่แล้ว

    The best channel that link theory with practice!!
    You are awesome 👍👍

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

    Great Job! Terrific tutorial....easy to follow with great visual aids. Your logic flow is spot on as you develop the code....thanks for the tremendous job!

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

    I am so impressed by this. I wondered if you would talk about what issues you encountered before this was operational?! I am struggling with a project!

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

      Hi Matthew, thank you! My biggest issue was the velocity measurement, which is why I spent so long talking about it in the video. Other than that the main issue I encountered was instability near zero velocity. What kind of issues are you seeing?

  • @tatlcocuk9588
    @tatlcocuk9588 ปีที่แล้ว

    your voice is extremely relaxing :)

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

    This is going to save me a lot of time and headache. Your channel is going to blow up soon. I know it!!!

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

      Let's hope so! (that it saves you time and headache, not that the channel blows up ;)

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

    Thank you so much, your explanation and your code really helps me to shorten the low level control in my mobile robot!! Liked!

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

      Exactly what I like to hear! Thanks Abdul 😊

  • @emanuelesilvestri6646
    @emanuelesilvestri6646 ปีที่แล้ว

    Tutorial bellissimo. Complimenti.

  • @mariohorlacher4226
    @mariohorlacher4226 ปีที่แล้ว +3

    Hello, great Video!
    I tryed to do it for 2 Motors like the dual Motor with encoder Video. But i cant do it something is missing.
    Someone got it for a dual setup ?

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

    It's a very good video! I advise you to make a video about position/velocity control of a motor with state feedback! I'm studying this things in the course of systems theory and maybe you can also create an Luenberger observator to obtain the state of the motor. Yes i know, there is a lot of linear algebra, matrices everywhere but nobody on youtube create a tutorial about this, it can be something good to bring on youtube!

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

      Thank you and I appreciate the suggestion. I don't mind linear algebra and matrices. ;)

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

    What an amazing tutorial!!!

  • @souravpoudyal1545
    @souravpoudyal1545 25 วันที่ผ่านมา

    Thank you!Great content!

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

    Thanks. Was able to implement this in my code and it helped solve the problem I had.

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

      Good to hear that. What was the problem that you had?

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

      @@curiores111 Acceleration and Deceleration on a Garage door controller that I designed. Some mosfets (Same Part number and Manufacturer) would behave different to others. Using this(tweak here and there) I could get the Acceleration and Deceleration the same regardless of the irregularity in the mosfets.

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

      @@dannyoneill4888 Interesting. Thank you for sharing.

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

    Great video as expected.

  • @kubasiwon8359
    @kubasiwon8359 ปีที่แล้ว

    Love you! You saved my life.

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

    The "speed" of the video is a bit fast BUT it's a very very good explaination of PID control! thanks tons for this :))

  • @user-ms8yh2hb3r
    @user-ms8yh2hb3r 2 ปีที่แล้ว

    So clear! Thanks for sharing!

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

    Thank you very much. I'm appreciated that!

  • @Unknown-ck7fi
    @Unknown-ck7fi 2 ปีที่แล้ว

    the best video ever ,thanks

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

    you are pretty brilliant, thank you so much .

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

    I am very grateful to you. Thank you so much.

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

    Well explained, thanks a lot👍👍

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

    my head hurts but this is gold!

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

    this is so well made

  • @alphaO27
    @alphaO27 ปีที่แล้ว

    Great Video, Wish if you have shown the filtered speed using method 2 (the less noisy method)

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

    BRILLIANT VIDEO.

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

    Hello. Your videos are fantastic. Can you tell me what software you use to produce this tutorial?

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

    Fantastic, thank you!

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

    Loved it!

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

    A great video as always Curio Res, keep it up! ....I have a question as to how you are choosing your gain values. This has confused me a lot in the past and I wondered if you could give me some further insight...but how do you choose those gains appropriately? It just seems as though often it's trial and error? I've had a look at approaches and a lot of literature points to Ziegler Nichols. Many controllers do have automatic tuning functions, I'm also curious of its procedures which is a whole new side of the coin as to how they optimise there gain values, but for manual tuning surely there is more of a methodical approach? Let me know your thoughts. Thank you again ! :)

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

      Hi Ronak, yes this is a very important question. There are several different approaches. Classically speaking I would say that the two basic approaches are
      1. Manual tuning (based on trial and error or intuition)
      2. Tuning using a mathematical model (you can use root-locus or other methods to decide the parameters that fit a set of requirements)
      Details:
      1. For the first approach, you're right, you can use Ziegler Nichols. I prefer to play with the parameters and find a response that looks good. The thing I personally find the most helpful is this table that explains how changing the parameters affects the response:
      en.wikipedia.org/wiki/PID_controller#cite_ref-24
      Once you understand that table, you can intuitively adjust the parameters one at a time for simple applications (like the DC motor)
      2. In terms of mathematical models, there are several classical methods. It's generally fairly challenging, but Brian Douglas has a series of great explanatory videos:
      th-cam.com/channels/q0imsn84ShAe9PBOFnoIrg.html
      Optimization is roughly a branch of (2), where you use an optimizer on the mathematical model to select parameters that improve one or more of the characteristics, like rise time and/or stability.

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

    This video is very high quality content. Thank you.

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

      How nice 😄. Glad you stopped by mist!

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

    What a great video thank you

  • @karanparve1734
    @karanparve1734 ปีที่แล้ว

    Wow great explaination with Animations

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

    Great video! Thanks for sharing

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

    Fabolous explained. Thank you a lot for your sharing. The tutorial are well useful and informative

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

      Thank you for the kind words Le Dinh 😊 I am very glad you found them useful.

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

    Great stuff, very helpful, I really enjoyed this.

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

      wow thank you, I'm glad you liked it 😊

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

    High quality video, many thanks, subbed

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

      Thank you, and welcome! :)

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

    excellent video production, outstanding didactics. subscribed.

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

      How kind and concisely put! Thank you Copernico.

  • @MOHITKUMAR-xe7bg
    @MOHITKUMAR-xe7bg 5 หลายเดือนก่อน

    really good content, pls upload more videos

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

    HELPFUL
    THANKYOU

  • @neacksen9485
    @neacksen9485 12 วันที่ผ่านมา

    Hello! Thank you very much for this high quality video.
    I was just wondering: why are we using an atomic block, or just stopping the interrupts, when fetching its value? What are the risks if not doing it?

  • @SomeOne-ke4fz
    @SomeOne-ke4fz 2 ปีที่แล้ว

    omg what a cool tutorial!

  • @adamt3077
    @adamt3077 ปีที่แล้ว

    wow! love this

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

    Excellent

  • @taherrad153
    @taherrad153 ปีที่แล้ว

    Thank you so much.Very useful video.
    There is one thing I'm wondering to know.
    The input and the output of PID Controller is rpm, right?
    So how we define it to arduino pins as Voltage?
    Thanks

  • @stephenboyd6378
    @stephenboyd6378 ปีที่แล้ว

    Oh by the way I loved your video I already downloaded the software for Arduino. I will hopefully use one for my project with a Pololu motor controller Jrk G2 18v27 USB Motor Controller with Feedback just not sure which Arduino unit to use yet any recommendations?

  • @hssnov
    @hssnov ปีที่แล้ว

    Thank you

  • @vaughan.gittel
    @vaughan.gittel 2 ปีที่แล้ว

    Good lesson thank you. 😊

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

      Certainly, glad you thought so 😊

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

    amazing video and amazing chanal ,we are waiting more videos

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

    awesome tutorial. carry on

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

      Much appreciated Rony

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

    Hi curiores once again another great video. I have a question - how does this type of motor control demonstrated in the video differ from controlling the motor via Field Oriented Control which incorporates atleast two PI(D) controllers? Thanks!

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

      also would I be able use this video to control a brushless DC motor?

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

      Hi Conor, I'm not familiar with field oriented control... after briefly reviewing it, it is quite similar to the PI controller here. The difference appears to be that a three-phase motor is used, and as a result you have to set up the controller differently. As far as the measurement side goes, you could use an encoder or other device (just like for a DC motor, you don't have to use an encoder, you could also use a tachometer).

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

      I think you need a bit more for a three phase motor. I haven't implemented it myself, so I can't say for sure. This would also depend on what motor driver you used, which would probably take care of some of the work for you. If you're simply assigning a single input (power) signal to drive the motor and reading from an encoder, then this method would work. If you need to do more (like handle the inputs to the brushless DC motor) that would require more work than what I've shown here.

  • @naveengupta5588
    @naveengupta5588 ปีที่แล้ว

    Instant Sub Amazing content.

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

    Thanks for your great share

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

      Of course, and thanks for stopping by Nguyen (assuming this is your given name :)

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

    which app are you using for software simulation ?

  • @CadPixel-why-not2455
    @CadPixel-why-not2455 5 หลายเดือนก่อน

    thanks

  • @anees-ahmadjaffer6891
    @anees-ahmadjaffer6891 ปีที่แล้ว +3

    Nice video. I am trying to implement such speed control on a 0.75kW motor using a VFD. The microcontroller will set the frequency, similar to how yours sets a PWM signal, which is essentially the same.
    The problem is that for my application, the motor speeds are relatively low (maximum 150 RPM). Initially, I wanted to use hall effect sensors that would trigger a pulse every time the motor passes a magnet over it. The problem is the low resolution: with my current setup, I am only able to measure 6 pulses per revolution. That, combined with the fact that the speeds are low, is making me concerned. Do you think the 6 pulses per revolution will be enough to have accurate PID control?
    Also, you mentioned there are some potential problems with method 2 of measuring the velocity. Would those issues be a problem in my low speed application? Which method did you end up using? I am guessing that method 2 will not be a good idea for me, because my speeds are low.

    • @curiores111
      @curiores111  ปีที่แล้ว

      I ended up using method 1 (number of pulses per fixed time interval). The issue with method 2 near zero velocity was too much of a problem for me.
      6 counts per rev is pretty low... it might be okay. Is the motor geared down? For low RPM applications usually using a geared down motor is better. You get more counts per rev, and have fewer issues low voltage required to keep the speed low (there's usually some stall for low voltages when using DC motors).

    • @anees-ahmadjaffer6891
      @anees-ahmadjaffer6891 ปีที่แล้ว

      @@curiores111 yes, it is geared down. I meant that the actual output, the thing that is attached to the motor, will be maximum 150RPM.
      I am a bit concerned about my 6 counts per rev because compared to your 600, thats 100 times less resolution.
      To control near zero velocity, I can just turn off the system. For my application, that is sufficient. I don't need it to hold its position, just need to turn it off. But I do see that if I needed to hold it in one position, simply turning it off wouldn't work.
      Also, is it correct that method 2 won't be able to be filtered, because you need deltaT between sample, and the deltaT between samples would change depending on the speed

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

      @@anees-ahmadjaffer6891 I do also think along these lines - could you in some way make method 2 work. I made a couple of videos regarding speed control of sewing machines, and almost all of them got a problem with low speed control. Part of the problem is the static friction of the mechanics when you start sewing. Bad control means, that you try to make one stitch from start but you end up making 4 stitches. I have used another small DC motor as a Tachogenerator to make the feed back signal for speed. It works, but this DC-motor do also produce a ripple voltage, but it will also depend of motor quality. You need to apply a 1 uF capacitor on its terminals to filter out bouncing of the brushes at mechanical resonances.
      Finally I like to thank @curiores111 for an excellent video.

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

    Great video!
    Why did you choose a cutoff frequency of 25Hz? What is the reasoning behind this choice? Thank you very much for your great work!

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

      Thank you! The 25 Hz choice is pretty arbitrary. Basically, I chose the highest cutoff frequency that still removed most (~90%) of the oscillations created by the measurement method. You could look at the spectral content to decide (which I did afterward, and was happy enough with where it landed).

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

      @@curiores111 Don't you think we can rely on the motor response time to pick a number. For example, a typical response time of a small dc motor is about 100ms, so a 10Hz cutoff frequency is a reasonable choice. Does such reasoning make sense or am I missing something? Thanks!

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

      ​Certainly, using characteristics of the system would be a good way to choose a cutoff. I feel that a 10Hz cutoff might lead to some signal loss, but I'm not certain. Certainly worth doing some testing.

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

    Excellent 👍👍❤️❤️...

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

      😎😎✌️✌️

  • @nahlachoual3686
    @nahlachoual3686 ปีที่แล้ว

    Can i ask what softwares are u working with like the closed loop scheme and the plot

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

    Thanks a lot for sharing this video. Wish that you will do this topic on raspberry pi and using python. Control position and speed using PID :)

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

      Good idea, I will try it out.

  • @wangpingan9136
    @wangpingan9136 ปีที่แล้ว

    thank u. save the life of me !~

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

    Hi there, great video! Learned alot from it.
    I just have one question. How do i replace the setPoint for a potentiometer? I cant figure that one out at all! Can you please help?

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

      Thanks Kenan!
      There's more than one option. I think the most obvious answer to your question would be something like...
      (1) Read a value from the pot, let's call it potValue ( e.g.: www.arduino.cc/en/tutorial/potentiometer )
      (2) setPoint = multiplier*potValue
      the value of "multiplier" should be based on the range of set-points that you are looking to achieve.

  • @alextolosa6891
    @alextolosa6891 ปีที่แล้ว

    I have a question about the conversion from rpm to voltage. Have you supposed that 1 rpm equal to 1 V? Despite my question, this is one of the greatest videos on DC motor PID speed control I have ever seen.

    • @curiores111
      @curiores111  ปีที่แล้ว

      1 rpm definitely does *not* equal 1V. What part of the video suggested that to you?

    • @alextolosa6891
      @alextolosa6891 ปีที่แล้ว

      @@curiores111 when the graphic is shown, it is calculated the error of rpm (y axis) and then it is said that if the error is 24, meaning 24 rpm, and Kp is 0.5 the tension given to the motor es 24 * 0.5... this is the part where i get confused. I want to excuse myself for the bothering

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

    Heelo, nice video ! There's one thing that I don't uderstand about PID controller:
    Imagine that you want your motor to spin a 100 RPM and for that speed the voltage should be around 6 V.
    If the motor is exactly at that speed the error will be 0 and then the pwm too so the motor's votlatge will be 0 rather than ~6V.
    The motor's speed will decrease the error go up and the pwm too to have the right speed then the error will be 0, this cycle will go indefinetly so my question is why the motor's speed does not oscillates like the cycle I mentionned earlier and why working purely with the error is best when you want to maintain a certain value?

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

      Good observation Julien. This is actually exactly how proportional control works (neglecting for a moment, the integral and derivative terms). What ends up happening is that the rotation speed will drop slightly, and the control signal will immediately ramp up to keep it spinning. But overall that means the speed you reach will tend to be a bit lower than the desired speed on average.
      If this happens, you can add the integral term which will accumulate error over time. This will end up giving a little more power to the control signal than you would have with the proportional control alone.

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

      And btw, if you choose the PID parameters poorly, you will definitely see the speed oscillate. Another thing to remember is that the physical characteristics of the motor tend to keep it spinning for a while, even if the voltage is turned off. So in other words, you wouldn't suddenly stop when the control signal goes to zero, you would just start to slow down.

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

      @@curiores111 oh yeah, the inertial carateristics of the motor are useful here, it's like a bike where to mainain a certain speed you don't have to pedal continously but give "spikes" of power will keep you going at approximatively constant speed

  • @leonardoluca5420
    @leonardoluca5420 21 วันที่ผ่านมา

    I wonder if this could be improved by defining a transfer function for the motor and doing the root locus to find an optimal gain?

  • @hssnov
    @hssnov ปีที่แล้ว

    Is it possible that we take analog reading of the motor rotation and use ADC to create PID.
    Is there any video tutorial?

  • @arcrobotics9982
    @arcrobotics9982 ปีที่แล้ว

    Quick question if I want to include the 64 counts of the encoder what part of the code that is going to change in order to achieve this request

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

    My first thought was that allowing the controller's output to go negative and cause it to try to drive the motor in reverse seems wrong for a setup like this. Maybe constrain the output to be non-negative? But I guess for a DC motor, that means letting it spin freely, which would rely on friction to slow it. And if there was an external force (for example, gravity if you are trying to raise or lower window blinds), I could see needing to apply a negative force to partially counteract that external force to control the speed.
    Next, I was thinking that if the current speed is below the target speed, you clearly need to increase the control output (and decrease the control output if current speed is faster than the target speed). Wouldn't that mean adding (some multiple of) the error to the current control output, instead of setting the output to be proportional to the error? But that's essentially what the integration term is doing (except that it is accumulating error from multiple iterations of the loop).
    Thanks for pointing out that velocity method two (timing the interval between pulses of the encoder) breaks down at zero velocity. That was something I hadn't considered. It seems like there ought to be a way to mitigate that. You know that an upper bound on the speed is determined by the time from the last pulse to current time, so you could constrain your last measured speed; eventually, you would reach the limits of your precision and get zero.
    I really appreciate your videos. The narration is clear and easy to understand (good pronunciation and enunciation). The pace is quick, but not too fast to follow. The graphics really help reinforce the narration.

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

      Great to see you Mark! And I love your detailed thoughts about the controller.
      1. Interestingly, the voltage switching happens fast enough that it's totally feasible to apply a negative voltage to slow the motor down. In fact, there's a lot of +/- switching that will happen in the controller that's unnecessary, but on **average** will produce the required speed. That's one of the unpleasant things caused by feedback control, but is a natural consequence.
      2. Yes! This is why the integral term is essential in this case, because the friction (or other loading) is constantly trying to slow it down. So at steady-state you need to be applying additional voltage. What you're describing is a bit more like open-loop or model based control, where you use some information about the system to try to predict how much voltage to apply.
      3. One way to mitigate this is to use open-loop control near zero velocity. Or an alternative strategy. I toyed with a couple alternatives. At the end I found that simply filtering method 1 was overall easier to implement and more consistent. It's the reason I made the video about low-pass filtering.
      4. Thank you very much. 😄 I hope that you stop by at my next video.

  • @ziyasahin428
    @ziyasahin428 ปีที่แล้ว

    What additions need to be made when performing PID control with 2 motors?

  • @arvindh13
    @arvindh13 28 วันที่ผ่านมา

    Can you explain desired position controll process using encoder, like providing user input & getting that position.