DC motor PID speed control

Поділитися
Вставка
  • Опубліковано 24 гру 2024

КОМЕНТАРІ • 273

  • @usnaveen
    @usnaveen Рік тому +50

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

  • @pavelmihai6850
    @pavelmihai6850 3 роки тому +28

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

    • @curiores111
      @curiores111  3 роки тому +3

      Thank you Pavel - and good luck with your studies!

  • @davidjmstewart
    @davidjmstewart 2 роки тому +48

    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.

  • @manuel_youtube_ttt
    @manuel_youtube_ttt 3 роки тому +9

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

    • @curiores111
      @curiores111  3 роки тому +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.

  • @greggarriss2107
    @greggarriss2107 2 дні тому

    Thank you for a detailed, concise and focused explanation of implementing PID control using an Arduino.

  • @Noxafurry
    @Noxafurry 2 роки тому +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  2 роки тому

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

  • @lautamn9096
    @lautamn9096 3 роки тому +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.

  • @markusbuchholz3518
    @markusbuchholz3518 3 роки тому +56

    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  3 роки тому +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 Рік тому

      Qjwwwww

  • @DavidTLutz
    @DavidTLutz 2 роки тому +8

    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.

  • @noahgraber9339
    @noahgraber9339 19 днів тому +1

    Great video. This was super helpful for helping us implement our PI control. In the title it says PID though and you didn't show how to do derivative control but still a great video.

  • @avi-brown
    @avi-brown 2 роки тому +3

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

  • @jokoluna6978
    @jokoluna6978 11 місяців тому

    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.

  • @KirtikSoni
    @KirtikSoni 2 роки тому +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!

  • @alperenkeser
    @alperenkeser 2 роки тому +1

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

  • @eanerickson8915
    @eanerickson8915 3 роки тому +2

    100% better than my old control teacher.

  • @kubasiwon8359
    @kubasiwon8359 Рік тому

    Love you! You saved my life.

  • @BritCHCz
    @BritCHCz Рік тому

    Hi, great video. One question ( 4:05 ), why does the motor increase speed for 3s and than stop and repeat it? If I print a variable "pwr" in serial, it constantly rise. I dont get it.

    • @curiores111
      @curiores111  Рік тому

      Thanks. :)
      I'm not sure I see where the question is pointing to. Could you specify which lines of code are suspect (or which output)?

    • @BritCHCz
      @BritCHCz Рік тому

      ​@@curiores111 at 4:05, line 27, int pwr. You set int pwr as 100/3*micros/1.e6. If I print a variable "pwr" in serial comunication, it constantly rise. It do what i expected. But when the hardware is connected (motor, driver, source, arduino), motor increasing speed for few second and then stop and repeat it in loop. I still dont get it. Have you some idea why this happening?
      regards

  • @HSMAdvisor
    @HSMAdvisor 2 роки тому

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

  • @matheuswilgengoncalves
    @matheuswilgengoncalves 3 роки тому +8

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

  • @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 ;)

  • @DustanWebb
    @DustanWebb 3 роки тому +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.

  • @dhanushkawijethunga
    @dhanushkawijethunga Рік тому

    This channel is a hidden GEM!

  • @luiggitello8546
    @luiggitello8546 7 місяців тому

    Im doing this exact experiment but with state space. Can’t believe i just found your channel, loved your video

  • @vitalik-j6s
    @vitalik-j6s 5 місяців тому

    Nice video. You can actually solve 'zero velocity' issues by sending a stop to the motor any time the reference is 0 instead of having it use the PID

  • @HadrienDorfman
    @HadrienDorfman Рік тому

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

  • @luccarodrigues781
    @luccarodrigues781 3 роки тому +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  3 роки тому +2

      Thanks for the kind words and for stopping by Lucca 😊

  • @johns1988
    @johns1988 Рік тому +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 🙂

  • @austin-bowen
    @austin-bowen 2 роки тому +3

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

  • @nadirsert8235
    @nadirsert8235 2 роки тому

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

  • @tjabbo7458
    @tjabbo7458 4 місяці тому

    If been looking a while for dc motor speed control with arduino and this video is by far the best video i have found. Thank you very much for your effort!!!

  • @SomeOne-ke4fz
    @SomeOne-ke4fz 2 роки тому +1

    At 11:22 in the video, line 63 in the code, the speed is using vt=100*(sin(currT/1e6)>0); how did you get that equation?

    • @curiores111
      @curiores111  2 роки тому

      It's just an on/off function to switch the speeds from 0 to 100. Switches every 3.14 seconds. Nothing special about that number, just something simple.

  • @vedarovski4110
    @vedarovski4110 2 роки тому

    6:24 how can we get these values? I don't know what the model of the motor is but I know the driver model. They are both from polulu too.

  • @forrestjone3855
    @forrestjone3855 5 місяців тому

    The Best Tutorial Video about PID I have seen! Great Job

  • @JM_Tushe
    @JM_Tushe 3 роки тому +1

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

    • @curiores111
      @curiores111  3 роки тому

      Thank you, friend. Happy coding.

  • @mariohorlacher4226
    @mariohorlacher4226 2 роки тому +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 ?

  • @kapileswarbishi3891
    @kapileswarbishi3891 Рік тому

    How you are measuring the rpm of the motor in the display?
    Please show the connection diagram of the LCD display.
    Is there is any different code to show the rpm ?

  • @julchak65
    @julchak65 2 роки тому

    @Curio Res I am trying to implement this PID speed control but my motor driver board only has the INA and INB, not a PWM input like your Pololu has. I am using a Cytron MDD3A. I'm trying to figure out if the code can be made to work with this driver board or if I need to have that 3rd input? Any thoughts

    • @curiores111
      @curiores111  2 роки тому

      Jeffery, it looks like on your motor driver both inputs are PWM. It seems like if you increase/decrease the PWM signals you should see speed changes. I'm not sure what combination you should use to produce the speeds required... the data sheet doesn't make it obvious.
      www.robotshop.com/media/files/content/c/cyt/pdf/cytron-3a-4-16v-dual-channel-dc-motor-driver-datasheet.pdf
      I think they're expecting you to use their library. Have you looked at their example?
      github.com/CytronTechnologies/CytronMotorDriver/blob/master/examples/PWM_DIR_DUAL/PWM_DIR_DUAL.ino
      If I wanted to figure out how to do it without their library, I would look at their arduino code (linked above) and determine what combination of PWM signals they use to generate the forward/reverse speeds, and wrap that in my own function.

  • @swagatochatterjee7104
    @swagatochatterjee7104 2 роки тому

    Shouldn't using a kd and D component smooth the oscillation?

  • @mouseminer2978
    @mouseminer2978 2 роки тому +1

    Is it possible for you to explain "util/atomic.h"? Or any other resource you think is relevant. Thanks in advance.

    • @curiores111
      @curiores111  2 роки тому +1

      sure, atomic.h is for the atomic block. The atomic block prevents the interrupt code from running while in the atomic block. If it were to run at the same time, you could potentially read the value incorrectly, since it might be partially updated when the value is read. You can see an example at the bottom of this page: www.arduino.cc/reference/en/language/variables/variable-scope-qualifiers/volatile/
      An alternative is to use nointerrupts()
      www.arduino.cc/reference/en/language/functions/interrupts/nointerrupts/

    • @mouseminer2978
      @mouseminer2978 2 роки тому

      @@curiores111 Thanks for the lightning response, Really appreciated.

  • @noahfluri5568
    @noahfluri5568 Рік тому

    How did you manage to Plot the Data this Consitently in the Serial Plotter ?

  • @Salad_Pals
    @Salad_Pals 8 днів тому

    amazing! This is what I have been looking for all this time.

  • @attaponcharoenpon1890
    @attaponcharoenpon1890 3 роки тому

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

  • @samuelbentz
    @samuelbentz 10 місяців тому

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

  • @SpartanMI
    @SpartanMI 2 місяці тому

    Thanks!

  • @笑拉了
    @笑拉了 2 роки тому

    Hi curiores ,can i ask one question:I can't really understand the code bellow:"int pwr=100 / 3 * micros() / 1.0e6".I don't understand what the"1.0e6" is used for.Thank you

    • @curiores111
      @curiores111  2 роки тому

      Dividng by 1e6 converts from microseconds to seconds

  • @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 2 роки тому

    your voice is extremely relaxing :)

  • @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.

  • @arcrobotics9982
    @arcrobotics9982 2 роки тому

    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

  • @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

  • @nadirsert
    @nadirsert 10 місяців тому

    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.

  • @RESC_Eng
    @RESC_Eng 2 роки тому

    I hope to discuss how to control stepper motor with constant acceleration model, there is no resources on UA-cam .please....

  • @jaredevans8518
    @jaredevans8518 2 роки тому

    Can this be done with a sensorless bldc motor?

  • @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.

  • @stephenboyd6378
    @stephenboyd6378 2 роки тому

    Looking to use a tach to control motor speed, but the tach is on the device, not the motor, and will receive 4 magnetic pulses per revolution. It will need to stay at 1800 rpm but the motor will be running at a different speed due to voltage changes the volts will start at 12-13volts but go up to 14.5 to 15 volts how do you think I should do it?

  • @hssnov
    @hssnov 2 роки тому

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

  • @beecat-e2s
    @beecat-e2s Рік тому

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

  • @jujugl1622
    @jujugl1622 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.

    • @jujugl1622
      @jujugl1622 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

  • @abishekchaudhari6551
    @abishekchaudhari6551 Рік тому

    Please reply ...
    What is the reason behind measuring only one out of every 64 events of encoder per revolution?
    and how we are measuring only one .?would you please explain it?

  • @T071
    @T071 Рік тому

    which app are you using for software simulation ?

  • @neacksen9485
    @neacksen9485 8 місяців тому

    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?

  • @onlooker251
    @onlooker251 Рік тому

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

  • @alphaO27
    @alphaO27 2 роки тому

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

  • @conesillyvalley7182
    @conesillyvalley7182 Рік тому

    Is this sensorless commutation?

  • @jonathansouza7321
    @jonathansouza7321 4 місяці тому

    Great tutorial.. with method 2 couldn’t you implement a condition if speed set to 0 to skip pid calculation and set speed to 0 or a stall detection if no pulses read after set time.

  • @dipteshchoudhury7972
    @dipteshchoudhury7972 Рік тому

    Which software you are using to show the circuit diagram ?

  • @arvindh13
    @arvindh13 8 місяців тому

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

  • @HatibSetiana
    @HatibSetiana Рік тому

    how you generate fft?

  • @leonardoluca5420
    @leonardoluca5420 8 місяців тому

    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?

  • @karanparve1734
    @karanparve1734 2 роки тому

    Wow great explaination with Animations

  • @sharp_guy2310
    @sharp_guy2310 3 роки тому

    Why can't we model the motor by giving step input to it from the Arduino and seeing the response in the plot..It's like we may get FOPDT System I guess... then we can design our PID controller in a very easy way right?

  • @M_Ziya
    @M_Ziya 2 роки тому

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

  • @lightman500
    @lightman500 9 місяців тому

    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!

  • @Joe-zw9ep
    @Joe-zw9ep 2 роки тому +2

    Exquisitely presented; so clear!

  • @Adhithya1002
    @Adhithya1002 Рік тому

    BRILLIANT VIDEO.

  • @yengajaf
    @yengajaf 2 роки тому +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  2 роки тому

      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).

    • @yengajaf
      @yengajaf 2 роки тому

      @@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 Рік тому

      @@yengajaf 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.

  • @mubi88
    @mubi88 2 роки тому

    Can you do that for 4 DC motor please it is so important for me.

  • @vuongngocquy5814
    @vuongngocquy5814 3 роки тому

    Can you tell me clearly the FLP transfer function and where should I refer to the documentation? Thank you.

    • @curiores111
      @curiores111  3 роки тому

      Hmm, I'm not sure I understand the question. Which documentation?

    • @vuongngocquy5814
      @vuongngocquy5814 3 роки тому

      @@curiores111 :(( I am not good at English. Sorry for the inconvenience...I mean here is the documentation on how to design a low pass filter

  • @essamwisamfouad9938
    @essamwisamfouad9938 2 роки тому +1

    Thank you for the very informative video. It's somewhat unintuitive to me why method 2 exists if we won't be able to measure zero velocity. It also seems that you've used the LPF for it as well for some reason.

    • @curiores111
      @curiores111  2 роки тому

      It's definitely the most intuitive method. There could be ways to workaround the issue at zero velocity. I'm not sure what you mean by "why it exists", do you mean "why did you put it in the video?"

    • @essamwisamfouad9938
      @essamwisamfouad9938 2 роки тому

      @@curiores111 It's intuitive yes, but its existence provided that we'll get oscillations when setting v to zero is what isn't. It's only intuitive now because there could be ways to workaround the issue like you said.

    • @curiores111
      @curiores111  2 роки тому

      ​@@essamwisamfouad9938 I guess I see it from a slightly different perspective... thank you for sharing your thoughts. :)

  • @Mat-tb1hq
    @Mat-tb1hq 2 місяці тому

    holy moly PID makes sense now

  • @orlin369
    @orlin369 6 місяців тому

    Great video, I have suggestion. Can you create video that explain how to control DC motor at the same time by speed and position? I like you videos very much. It helped me allot as a student in industrial automation. Thanks in advance!

  • @AlexanderLopez-dv6yr
    @AlexanderLopez-dv6yr 2 роки тому +1

    Excelente video, editing and explanation! Thank you!

  • @quangvannguyen9476
    @quangvannguyen9476 3 місяці тому

    How do you code to convert the velocity signal into a DFT graph?

  • @robinwersich3424
    @robinwersich3424 8 місяців тому

    I had an idea to fix the issues of methods 1 and 2 for velocity measurement.
    It's basically a hybrid of the two:
    Regularly check how many pulses there have been since the last check, but instead of just assuming the check interval as time, always record the last pulse timestamp and use it to get a more accurate time between checks
    Would that work?

  • @DaniMalik-uf6hd
    @DaniMalik-uf6hd 8 місяців тому

    Kindly tell me which type of encoder dc motor use like how many voltage of this dc motor

  • @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.

  • @StarKiller5888
    @StarKiller5888 3 роки тому +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. ;)

  • @alextolosa6891
    @alextolosa6891 2 роки тому

    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  2 роки тому

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

    • @alextolosa6891
      @alextolosa6891 2 роки тому

      @@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

  • @luckkazz
    @luckkazz 3 роки тому +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  3 роки тому

      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.

  • @vijaysulakhe5605
    @vijaysulakhe5605 2 місяці тому

    Thanks for your excellent video and explanation..Hope you will make many such engineering videos.

  • @gauravsethia3379
    @gauravsethia3379 2 роки тому

    Amazing video. I had a question too,
    Why do we take 16 counts, even thought the motor gives 64 counts per relovution?

    • @curiores111
      @curiores111  2 роки тому +2

      Thank you :) The encoder CPR = 64 is rated with the expectation that you will count all four events: trigger A rising, trigger B rising, trigger A falling, trigger B falling. I have only written an interrupt that triggers when A rises. So only one out of every four events is captured. If you add interrupts for the other three events, you will have the higher resolution of 64 CPR.

  • @taherrad153
    @taherrad153 2 роки тому

    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 2 роки тому

    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?

  • @markday3145
    @markday3145 3 роки тому

    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  3 роки тому +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.

  • @TriNguyen.V.T
    @TriNguyen.V.T Рік тому

    Hi! Thank you for your great video! I have one question tho. How can i find the cut off frequency, or how did you perform the dft to get the plot in frequency domain? Thank you!

    • @TriNguyen.V.T
      @TriNguyen.V.T Рік тому

      Oh nevermind, just saw your other video 😂.

    • @curiores111
      @curiores111  Рік тому +1

      Those videos were made just for you 😉😄

  • @ahmadjned3553
    @ahmadjned3553 3 роки тому

    amazing video and amazing chanal ,we are waiting more videos

  • @lenslens7379
    @lenslens7379 2 роки тому

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

  • @BmxAddict08
    @BmxAddict08 2 роки тому

    my head hurts but this is gold!

  • @citratune7830
    @citratune7830 9 місяців тому

    Why did you use Method 1 with a filter instead of just using method 2?

  • @victor574
    @victor574 8 місяців тому

    Hello, I see the video but I don’t really understand why you combine the derivative and interval terms and so we have just à PI 🤔
    If you can explain me 😅