Encoded Motor With Arduino

แชร์
ฝัง
  • เผยแพร่เมื่อ 3 ธ.ค. 2024

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

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

    Support my projects on Patreon → www.patreon.com/nikodembartnik

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

    I doubt that anyone will ever see this post, but I had to write one because this video is the BEST I have seen regarding this subject. I have been looking for this solution for over 6 years now and came across it just now. Every other video on YT does not use position control with DC/encoder control(closed loop). Seems they all like steppers. There is no better way than this method for position control at a very inexpensive solution. I was a CNC tech for over 25 years, and this method was used long ago on industrial machining centers. Thank you very much for this project!

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

      I have seen it :) Thank you very much!

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

    Great explanation of how an encoder works! 0:53

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

    Nikodem, you're sooo diverse! It's always fun to see what you're tinkering with each video! Your projects always intrigue and impress me! Keep up the great explorations and work!

  • @seklerek
    @seklerek 5 ปีที่แล้ว +86

    I think you should zoom in on the code when you're explaining it, now it's a bit hard to see on a computer and on mobile it's impossible. Otherwise cool video!

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

    That background music is really chilling, I like it.

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

    Quality of your videos is really getting better! Keep up the good work!

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

    Do you have a correct circuit diagram for this? The link you included for the motor has a harness with the wires in a different color order than the motor in your video. The colors do not match your fritz diagram.

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

    2:54 where to buy an encoder like that without the motor? I have 2 peg prego dc motors that I want to put an encoder.

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

    I connect a 12v encoder motor instead of 6v when I move the potentiometer ligermanet the motor does not respond and keeps rolling why? I send position in serial plotter and nothing it still rolling
    -85
    -87
    -88
    -90
    -92
    -93
    -95
    -97
    -99
    -100
    -102
    -104
    -106
    -108
    -111

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

    Great tutorial. This is precisely how I want to control my droid dome rotation. Remote controllable and automated. Thank you for all your research. Gotta get myself a 12v dc motor with encoder now. ;)

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

    Nice tutorial! My actual project for agriculture uses a sensor hall or a reed switch to control a peristaltic pump. The "IN" is the wheel speed. It uses a 12V, 36W windshield motor and a IRF1404 “as driver” (plus a diode and resistors for protection).

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

    I pulled up the DC Motor w/ Encoder that you provided a link to in the video's details and compared it to the Fritzing diagram you displayed (3:19), and the wiring you suggested does not make sense to me. In particular: Why are we connecting the motor's white "Quad encoder B signal'" wire (see Amazon's pictures) to the negative motor terminal of the driver?

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

    it ok for wheel but for a turret we have to know the zero so what kind of sensor allow angle feedback

  • @_jonathas.castro_
    @_jonathas.castro_ 4 ปีที่แล้ว +1

    How make control without potentiometer, I want use other encoder to control the servo in this project.

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

    Files and code link doesn't work

    • @satkumbaev
      @satkumbaev 10 หลายเดือนก่อน +3

      in the link change SmallProjects to Small-Projects

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

    this is completly underated thx man

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

    Great video and thank you for the time you invest in these videos. It would be great if you could explain the wiring a bit more too. "Here is the motor... it has 6 wires" - what are those six wires for? My motor has 2 power wires and 4 encoder wires, so it looks different and has different colors but has the same functionality. If you explained what the wires are for, it will help others with different motors to also understand the wiring better.... like myself :-) But thank you again

  • @rodrigoc.goncalves2009
    @rodrigoc.goncalves2009 5 หลายเดือนก่อน

    I came across this video after having successfully made a project exactly like the one you mentioned 1st, with the potenciometer. However, I tried doing something using serial comm as the source of the target position, but anytime I connect the powered motor driver to the arduino, serial comm doesnt work. I'm left disconnecting the driver anytime I want to type a number in serial comm. All the grounds have a single common ground point, so it's not a grounding issue. A friend suggested it might be electrical noise from the m.driver interfering with the arduino, what dya think? Thanks

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

    Sorry, but I couldn't find right code in your repository. Can you say me file's name for Encoder, please! Thanks a lot for good video

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

    Can i use an encoded motor as a 360 degree rotation servo ? Suppose i give an input of 5 to the arduino using some monitor display then the encoder must stop at 360degree/5 position, like every 72 degree the motor should stop and rotate??

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

    When using the 2nd version of the code without potentiometer, do you just remove the potentiometer from the wiring schematic?

    • @MichaelRHead-zv2zf
      @MichaelRHead-zv2zf 3 ปีที่แล้ว +1

      did you ever figure this out. its driving me crazy. i dont know know what to do.

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

      @@MichaelRHead-zv2zf Niko didn't reply so I didn't go down this path. I found one that was simpler/cheaper th-cam.com/video/yvrpIYc9Ll8/w-d-xo.html

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

    In your code, you’d be much better off defining a constant for each dio pin e.g. MotorSense = 3; Not only does it make your code easier to read, and less likely to make mistakes, but if you ever changed pin, you only need to change the code in one place.

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

    Great tutorial, I try to run the code with the same setup for both knob and serial, but the motor doesn't seems to run correctly. The motor just run at one direction and with constants speed, even when I turn the potentiometer left to right, or the otherway around. Same thing with the serial version, the motor just run at constants speed to different number I typed in. The motor I have is slightly different than the one you have, but the encoder is the same specs, same color cables with 11 signals for 1 turn.
    Do you know why? is it because of this line where I have to tune? pos_pid.tune(20, 0, 200); Thanks

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

    SOOOOOOO nice. Love the way you've summed it all up.

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

    02:25 I have the same motor from a printer. Do you know by any chance where can I get its datasheet?

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

    Sorry if I'm a beginner.
    I want to ask, is this the same as the stepper?
    Can i set the motor to only rotate 2x (for example) ?

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

    I can’t find the code shown from attachment. The only using PID is 168 lines contrast yours is 40.

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

    Hello my friend. I have the same small engine in the video. but I do not know the wiring diagram. I will only use the encoder. Can you help me?

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

    hello sir can I do it without using potentiometer ?

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

    i have same small printer motor with encoder. but i dont know what is the cable order. how can i learn which cable is signal which is gnd which is v5 ??? pleasee helppppp

  • @스마트파워트레인연구
    @스마트파워트레인연구 3 ปีที่แล้ว

    I entered the code according to the video, but the motor does not stop. The code on GitHub also seems to be inaccurate. What code do I need to write to do the same as 5:55?

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

      It sounds like you have the wrong motor polarity. When the motor moves in the positive direction, the encoder must count positive.

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

    NIcely done! I'm curious about your inclusion of the PID library. Are you using that to accomplish smooth acceleration/deceleration of your motor? Cheers

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

    Hello friend, I'm from Colombia, I'm doing this same project using exactly the same components and the same code of your video, but I can't get it to work correctly, when it reaches the position that it should stop, the only thing it does is reverse the direction of rotation , please help me

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

      In addition, the current when reaching the desired position rises too high and the motor driver gets very hot.

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

    Excellent production quality!

  • @MichaelRHead-zv2zf
    @MichaelRHead-zv2zf 3 ปีที่แล้ว

    i can't get it to stop spinning. I can get it to go forward and backwards but it will not stop any help?

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

    Great video! If I understand correctly, the encoder you ultimately used will tell you relative position, not absolute position, is that right? In other words, if you turn the arduino off and then on again, it will think that the current motor position is "0"?

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

    3:39 PID controller library? WHY? WHY EVERYBODY USES A LIBRARY? .-. DO IT FROM SCRATCH PLEASE

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

    Do you have a scematic layout for the setup without potentiometer using the digital input, or is the potentiometer still there?

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

    Can I use the Arduino to compare vibration levels of different cd players ect? If so, is it as simple as placing the Arduino sensor on the cd player chassis and also using a multimeter to get the reading?

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

    nice job!! quick question, how would you have figured out the gear ratio if the motor you have wasn't documented?

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

    Are going to make a video about how to implement this method to a robot with two wheels? I need to learn how to control two motors in synch on my project.
    Thank you

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

    Hi, do you think is it possible to do a open loop test in order to get a mathematical model of the motor? The test is simply to put a voltage at input and measure the speed output, and of course to hold the data. Thanks

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

    Hi. I'm new at this. Can you tell me where each color wires go? It's hard to see from your pic. I have same 6 color wires. Tks in advance.

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

    Hello there, can I control dc motor with encoder by 2 line the first one is pulses for steps and the second one is (0,1)for direction?

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

    Thank you for sharing this video.
    Have you used the LM393 speed sensor with a DC motor? I am facing a problem with this sensor because it overcounts every time when I use interrupts. Can you please make a video on it?

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

    Great video, all works well. Would like to put a micro switch to set the 0 point on start up. do you have any videos on that?

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

    Hello great video. One question though, I try to type 0 into the serial monitor after typing in 1000 and it won’t go back to 0, do you know why that would be? Thankyou

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

    nice editing man, i like this.

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

    I have a problem, if I have a motor with encoder but it handles a voltage of 24 volts, which model of H-bridge can I use?

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

      the l298n can handle it, make sure to see how it works

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

    Hi, thank you for the video!
    Do you know where i can found this motor's datasheet? I need some values like resistance, inductance, moment of inertia...

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

    it could be possible to do a reverse engineer that method to build a DRO for Manual Mill?

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

    cool and very nicely and clearly explained.

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

    Huge thanks! It was useful for me

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

    Hey there, l have seen your videos were really superb but what l actually want is how to control the position of the encoder by using arduino , lcd display to see the position visually, keypad to type degree , potentiometer for lcd display voltage up and down and h-bridge to control high voltage using low voltage . Please let me know if you upload a video basing my project please help me

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

    project gonna be opensource?

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

    My code was working fine but then one fine day when i give a serial input value of 555 the encoder rotates to 5555 idk shy this happens but for any value i give the motor turns to times 10 of the given value. Can anyone tell me what to do?

  • @noneNone-mw1px
    @noneNone-mw1px 5 ปีที่แล้ว

    Can you please tell me what type of rotary encoders I need for air manager and how I can connect each I strument to encoders to turn ? Thank you. I told many how made it in youtube but they never told me

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

    How do you keep the position of the motor same on startup? for example if it is in a robot arm then how do you know the absolute location of the arm on startup. Wont the position be different every time the robot boots up?

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

      yes it will, that's the downside of these motors, more expensive robotic arms use absolute enocoders, that way the position of the motor is always known

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

    I like it. Could this be made as a drop in replacement for a stepper motor?

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

      With proper PID calibration, it could be used instead of a stepper motor

  • @vanwong8846
    @vanwong8846 5 ปีที่แล้ว

    Thanks for shareing the core.
    I was not familiar with coding and I was tring to use the STM32 MAPLE BOARD insted using arduino nano.
    I just going to change some pin number, But it not work...... the encoded can show up to 7 or some number, then the loop was dead.
    Any ider with that?
    Thanks.

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

    Can we control position of motor using L293 motor controller??

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

    Nice and useful product. I liked it.

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

    Thanks for a great video! I'd like to ask a newbie question. Would it be possible to use a quadcopter ESC flashed with BLHELI firmware, as a motor driver for such precise control of a BLDC motor with encoder?

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

    What program do you use to 3D printer designs?

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

    clearly explained, thank you !

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

    How did you connect the encoder's wires?

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

    U saved my life mate! Thank you

  • @leviisrael3752
    @leviisrael3752 5 ปีที่แล้ว

    are you doing research for weather to buy larger stepper motors or servo motors for your large cnc

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

    You will have a bit of a problem with i2c. The problem will be the interrupt - you will need to make sure you can read pulses while communicating over i2c... What's the problem of using serial instead of i2c, btw? Misun wrote a nice servo controller already for arduino, esp8266 and I modded it for ATtiny85, perhaps check that one out for inspiration ;) Nice work, btw. Good luck.

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

    Hi, nice video, how did you manage the motor with the serial monitor?
    Thanks

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

    Is it like stepper motor can use it in cnc

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

    thanks, this really helped me

  • @mzzm9484
    @mzzm9484 5 ปีที่แล้ว

    Thank you for sharing this information with us. I have a question about checking the position when the tree has to stand still. How you manage this and how you implemented the sw to do it.

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

    suggestion for a new video of a cnc router with this motor and encoder

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

    Very good visuals

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

    Thanks yo, Wish you all the best

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

    Excellent tutorial. Thanks

  • @crckdns
    @crckdns 5 ปีที่แล้ว

    Easy and good explained, worth a follow :)

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

    Hi! I am a fan of your youtube channel, because they are easy to follow. Can you provide a schematic drawing for the wiring when using Arduino uno instead of nano?

  • @michaelandersen1161
    @michaelandersen1161 5 ปีที่แล้ว

    what pid library are you using ?

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

    why are u have "* 3740" at first line in void loop? Thank u!

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

      Hey. Perhaps, for your question, if you search for "JGA-25 370 6V 210RPM with encoder - how to get RPM from encoder pulse frequency", which is found on the arduino forum, or something similar, maybe it can help you, not that it is this is the encoder motor value that the author of the program has used.
      -----------------------------------------------------------------------------------------------------------------------------------
      Oi. Talvez, para essa sua questão, se você procurar por "JGA-25 370 6V 210RPM with encoder - how to get RPM from encoder pulse frequency", que se encontra no forum arduino, ou algo similar, talvez possa lhe ajudar, não que seja esse o valor do motor encoder que o autor do programa tenha utilizado.

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

    Interesting video regarding ardulnos, I'm currently working on a project it's an radio controlled model kayak 🛶 1:6 scale but having great trouble mimicking scaled down body movement like forward backwards left and right with a two standard motor setup using normal standard r/c the timing on the motors needs to be correct as it's critical for the paddle strokes, the system i have at the moment is a electronic speed controler (esc) driving two motors. Just wondering if you can point me in the right direction if it can be done involving an endcoder motors ardulno system working with a r/c receiver and transmiter. Have a look on my channel to see kayak videos thanks Chris.

  • @MichaelRHead-zv2zf
    @MichaelRHead-zv2zf 3 ปีที่แล้ว

    what the chances of you showing the code but with an rc control?

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

    hello nice work, could you upload the source code, the link u provided is not working..

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

    is there already a library avalible?

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

    I appreciate any tutorials related to Arduino or ESP32 but when you are showing/describing code we need to be able to read it. Thanks!

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

    pidcontroller header file is missing

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

    Hi sir can you please make a vedio on home made servo motor
    I have some Idea by it is not working please help

  • @sarigaraj
    @sarigaraj 5 ปีที่แล้ว

    Good but what pid library are you using ?

    • @sarigaraj
      @sarigaraj 5 ปีที่แล้ว

      this is --> www.arduinolibraries.info/libraries/pid-controller

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

    Hello, can you tell me the name of the motor controller? Regards

  • @MaddoCosplay
    @MaddoCosplay 5 ปีที่แล้ว

    hi first of all good work on the video very well made! i am thinking to introduce this motor into my project (replacing my stepper motor) my question is since my motor will have some load on the shaft would you suggest e a better motor driver in terms of heating and idle power handling? for example for the stepper i'm using a tmc 2208 wich drops power up to 20% when idle...hope to hear from you soon keep up the good work!

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

    Hooking up the jga25 to a driver is a more pressing problem than sorting code. You didn't address that.

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

    hello, this tutorial is quite helpful. thanks for your great effort!
    I have brought a DC geared motor. it's kinda different than the one you have used but I believe it would serve the same purpose especially that it has the same exact encoder.
    I was wondering if I could use it on my Arduino mega without a motor drive.
    please help me! thanks in advance.

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

    hi.. i'm a student taking course computer of engineering can i ask a help for my project ? i dont know how run this dc motor using motor control shield :( i really need help

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

    what is value 3740.1??

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

    if you also connect AS5600 contactless angle sensor check

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

    Thanks. Can you share me PID controller library?

  • @jinwangli6948
    @jinwangli6948 5 ปีที่แล้ว

    hello,How to use an encoder to control the position of the DC motor?

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

    Awesome video. Thank you!