[Full Breakdown] PID for DC Motor Position Control using Rotary Potentiometer

  Рет қаралды 40,506

GeeKee CeeBee

GeeKee CeeBee

Күн бұрын

Пікірлер: 62
@GeeKeeCeeBee
@GeeKeeCeeBee 3 жыл бұрын
IMPORTANT: If you find this video helpful then please leave a LIKE, SHARE and SUBSCRIBE to support me in making more videos like this. 👍 CODE and SCHEMATICS ARE AVAILABLE HERE geekeeceebee.com/DCMotor%20Position%20Tracking.html More Videos: DC Motor Speed Control: kzbin.info/www/bejne/h4SsnKaGgNOXe9U
@hoangkhuong9
@hoangkhuong9 2 жыл бұрын
Same system, Could you pls change dc motor by stepper? Thanks
@naboulsikhalid7763
@naboulsikhalid7763 2 жыл бұрын
this the king of tutor whom we should support for the outstanding explanation and sharing knowledge. thank you
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
Thank you, that's very kind of you to say that. Im glad my videos are helping.
@onlooker251
@onlooker251 Жыл бұрын
Thank you for explaining the PID feed back loop and the conversation into code. 👍🙂
@chameeraabhishek2969
@chameeraabhishek2969 Жыл бұрын
Thank you very much ❤ I used this method for control Doosan 225 excavator throttle 🤘🤘
@prashantgautam8983
@prashantgautam8983 Жыл бұрын
Thank you, this video has helped me understand the basics of PID and the arduino implementation was awsome. The same code worked for my feedback motor.
@amirhusseinqolami3593
@amirhusseinqolami3593 Жыл бұрын
Your project is very perfect. Thnaks🙏
@qozia1370
@qozia1370 Жыл бұрын
thank you, good video, would be good if you go into the details of the math behind the Transfer function.
@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?
@kishor_VU2MZT
@kishor_VU2MZT Жыл бұрын
Very exellent , can this be replicate with dc motor with reduced gear box of about 7 rpm ???
@codelery414
@codelery414 11 ай бұрын
Good job! How did you get 360-degree rotation? Because the rotation of potentiometer is less than 360-degree.
@obotech1742
@obotech1742 9 ай бұрын
Thank you very much for the tutorial that you have made, it really helped me to solve the steering ruder control problem.😇😇
@Jim_One-wl4ke
@Jim_One-wl4ke 7 ай бұрын
That’s a cool setup! Maybe I can try 10turns VR so with a 10:1 gearing can we get a more precise position? Possible to use as feedback for steppers too? Thanks for sharing ❤
@JoaoVitor-wj2ki
@JoaoVitor-wj2ki 2 жыл бұрын
Outstanding job you did. I'm in a project, which consist in control a DC motor, most specifically the position of the DC motor. For this, I'll not use other potentiometer coupled in the motor, just the motor DC. I want to control the motor directly with one potentiometer (reference potentiometer). In this case, can you explain me how can I do that? what connections I have to do from your assembly? Thanks.
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
You need some sort of feedback sensor on the motor to control its position. If can't use a pot then other option is to use an optical encoder. Then map the angular range of ref pot to that optical encoder.
@easy_3d
@easy_3d 4 ай бұрын
Instead of using reference potentiometer , can i directly use values from a oled display to turn the motor to a specific position?
@rohitbhandari9879
@rohitbhandari9879 3 жыл бұрын
Best video
@bobjames994
@bobjames994 6 ай бұрын
Please help, I’ve uploaded code to the board and wired everything identical to the diagram, but when I power everything the motor just spins without control, any way to fix this?
@marksoderberg628
@marksoderberg628 3 жыл бұрын
This PID tracker with the 2 POTs is awesome! Small thing-you diagram shows using A2 and A3 and the code is A3 and A4. Also, I’m having a little trouble. Turning on the serial monitor makes the loop much slower than 10ms. It works but it is a little jerky with irrregular timing that seems to be due to the serial communication. When I turn serial off, the timing is then right but it no longer seems to be tuneable…. Strange…. Should I try to monitor some other way??
@GeeKeeCeeBee
@GeeKeeCeeBee 3 жыл бұрын
Thanks for pointing that out. I'll update the code to reflect correct pin assignments. Have you tried using "Serial Plotter" instead of serial monitor? I'm not exactly sure but couple of things to try - increase the delay time or use timer interrupts instead of delay() command. I have another video on my channel about PID DC motor speed tracking where I implement Timer interrupts. Advantage of timer interrupt is that Arduino is free to do other things while waiting for 10ms. Unlike in delay(10) command, arduino is stuck for 10ms.
@abdulmomenbhuian7530
@abdulmomenbhuian7530 3 жыл бұрын
Thankful sir.
@arthurknevitz3151
@arthurknevitz3151 3 жыл бұрын
Amazing video, just what I was looking for! Just asking to know if I got it correctly: you used "encoder_pot" for the feedback when declaring the variables, but used the reading (in the main loop) of the potPin as the feedback. Was it a typo or did I get the whole idea backwards? Great project and one of the best takes on the PID workings btw best regards from Brasil !!!
@GeeKeeCeeBee
@GeeKeeCeeBee 3 жыл бұрын
You got it right. There's a typo when defining the encoder pot. Glad video was helpful. Thanks for watching 👍
@badisouahab6582
@badisouahab6582 Жыл бұрын
@@GeeKeeCeeBee when you read analog potentiometer you get angle ??
@GeeKeeCeeBee
@GeeKeeCeeBee Жыл бұрын
It is technically angular position mapped to potentiometers resistance value. However, I do not necessarily read it as angle. I simply use the resistance value as feedback signal and PI controller compensates the voltage by comparing feedback with reference potentiometer value. Hope that's helpful.
@arduinomaquinas
@arduinomaquinas 10 ай бұрын
Loved video ❤👏👏👏
@kritancreations6471
@kritancreations6471 2 жыл бұрын
Nice you are life saver. How can is use a mobile phone instead of potentiometer?
@MrShaneSunshine
@MrShaneSunshine Жыл бұрын
Yes!
@Leitoc957
@Leitoc957 8 ай бұрын
felicitaciones maestro
@nadirsert8235
@nadirsert8235 2 жыл бұрын
good job thank you
@nuwanamarasingha1982
@nuwanamarasingha1982 Жыл бұрын
wow great !
@kifahzaidan4505
@kifahzaidan4505 2 жыл бұрын
THANKS A LOT CAN YOU PLEASE POST VIDEO FOR THE (CONTROLLING OF DC MOTOR 'ACTUATOR ' PROGRAMABLE POSITION WITH MEMORY BUTTONS USING ARDUINO. BEST WISHES
@nikobles8285
@nikobles8285 Жыл бұрын
Hello, if i'm going to use BTS7960, where should I tap the 6,7,8 pins fron arduino to bts7960 pins? Thank you
@GeeKeeCeeBee
@GeeKeeCeeBee Жыл бұрын
Looks like Bts7960 needs atleast 4 wires. It needs 2 separate pwm output from arduino for left and right rotation. My code won't transfer over without modifications
@kritancreations6471
@kritancreations6471 2 жыл бұрын
How can is limit the rotation to 90 degrees only?
@niboonboonprakob2209
@niboonboonprakob2209 2 жыл бұрын
How robot line tracking using PID controll?
@ВиталяАльбатрос-к3т
@ВиталяАльбатрос-к3т 11 ай бұрын
Отлично!
@ravmanoskid8192
@ravmanoskid8192 Жыл бұрын
Im trying to replicate this but have a small problem. I can hear the motor buzz but it wont move. My motor has a built in potentiometer and its value is different than the input potentiometer. Also, starting resistance is from max to min. Does this matter? And can it be fixed with code. Thanks!
@GeeKeeCeeBee
@GeeKeeCeeBee Жыл бұрын
Pot resistance value should not matter. You can try flipping Vcc and Gnd pin of your potentiometer. Resitance max-min should flip. Hope that helps.
@ravmanoskid8192
@ravmanoskid8192 Жыл бұрын
Hey man thanks for the tip! I tried flipping the cables and saw improvement, but playing with kp and kd values solved my problem completely! Hoping to see more electronics videos from you soon. Cheers!!
@jrmichel
@jrmichel 2 жыл бұрын
excelent! It´s possible to do this same with the ESP-32?
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
Yes, absolutely. Technically, you can use any microcontroller to do this.
@jeffclark8681
@jeffclark8681 2 жыл бұрын
Paypal , done. Great write up and video. Where are you defining the khz rate of the driver (sorry im new). I have a project, im needing a PWM motor controller that runs @ 20khz and can handle max of 10amps (12 volts). I would like to use your code and set it up the same way. What do you recommend??.
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
Thank you, Jeff. Much appreciated 🙏 I have responded to your questions via email. Hope that's helpful. Thanks again
@zezoalbendary8528
@zezoalbendary8528 3 жыл бұрын
Can i use Rotary encoders instead of potentiometers for this project ?
@GeeKeeCeeBee
@GeeKeeCeeBee 3 жыл бұрын
You absolutely can. You would need a somewhat high resolution rotary encoder. Most inexpensive encoders can be around 24pulses per revolution which is 360/24 = 15deg for each pulse. Not nearly acceptable for any kind position controlled application. If you are interested, there's another video on my channel with encoder and speed/position control. But I feed a pre-defined speed ans position profile and get feedback from rotary encoder. kzbin.info/www/bejne/h4SsnKaGgNOXe9U
@arthurilyuts7575
@arthurilyuts7575 Жыл бұрын
Seems like there’s no second encoder in the link you shared. I really like that you did with two Potentiometers in this video and I also want to make same thing but with two Rotary Encoders instead of using Potentiometers. Will be very appreciative if you can direct me in that.
@GeeKeeCeeBee
@GeeKeeCeeBee Жыл бұрын
There's another video on my channel where I use two encoders but not like in this video. You can probably use that as guide in terms of wiring and getting encoder values and combine that with this pot project by replacing pots with encoders. Hope that helps. "Anti Backlash Dual Encoder" video
@yldrmozer1598
@yldrmozer1598 2 жыл бұрын
is it 100% possible for precision work
@s.h.a.g.g.6072
@s.h.a.g.g.6072 2 жыл бұрын
Good video, and very helpful, at school we are doing something kinda similar, what steps did you follow to calculate the P, I and D values?
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
Please check out "PID tuning" video on my channel. I have shown my approach about empirically determining PID gain values. Hope that's helpful.
@primescienceprojects
@primescienceprojects 2 жыл бұрын
What is the value of potentiometer
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
Potentiometer is 10K Ohms. However, pot value does not really matter when it comes to Arduino reading analog voltage in 0-1023 range because of its voltage divider circuit. But, one should consider pot value if power dissipation is a concern. 10k pot at 5V only dissipates few milliWatts of power. It may or may not be significant if you're running your system on battery. Hope this is helpful.
@primescienceprojects
@primescienceprojects 2 жыл бұрын
@@GeeKeeCeeBee thank you so much But I'm facing another problem that is my motor moves only in one direction and not the other direction even after rotating the potentiometer, why is it so
@GeeKeeCeeBee
@GeeKeeCeeBee 2 жыл бұрын
I suspect your setup is not reversing the voltage to spin the motor in other direction. Check your direction pin wiring (pin7 and 8). Other than that I can't really say without looking at the setup and code.
@primescienceprojects
@primescienceprojects 2 жыл бұрын
@@GeeKeeCeeBee I've cross checked the wiring and it was wiring problem. Thank you so much for this idea. You have done a great job. It's running successfully now. Thank you so much ❤️
@YILDIRIM-e6u
@YILDIRIM-e6u 3 жыл бұрын
how for mega 2560 diagram
@arduinomaquinas
@arduinomaquinas 10 ай бұрын
Like full 607
@isotechpapertech1330
@isotechpapertech1330 3 жыл бұрын
Sir add 0to100 position show lcd this project plz send me code n etc
@farihaarif2973
@farihaarif2973 7 ай бұрын
this circuit is not working
@arduinomaquinas
@arduinomaquinas 10 ай бұрын
Great video's 👏👏👏 subscribed 🇧🇷😉👍 very useful, awesome, @arduinomaquinas thank you man !
CARLA: Lane Assist Steering Wheel with Arduino
4:28
GeeKee CeeBee
Рет қаралды 2,7 М.
Turn any DC Motor into a Servo Motor
25:24
How To Mechatronics
Рет қаралды 303 М.
BAYGUYSTAN | 1 СЕРИЯ | bayGUYS
36:55
bayGUYS
Рет қаралды 1,9 МЛН
Quando eu quero Sushi (sem desperdiçar) 🍣
00:26
Los Wagners
Рет қаралды 15 МЛН
Analog Feedback Servo Motor - Improved Servo Performance
23:15
DroneBot Workshop
Рет қаралды 81 М.
Modeling and Simulation of Advanced Amateur Rockets
17:10
Lafayette Systems
Рет қаралды 147 М.
Magnetic rotary encoder vs stepper motor accuracy
5:41
Matthias random stuff
Рет қаралды 155 М.
How to control a DC motor with an encoder
9:30
Curio Res
Рет қаралды 465 М.
Pr#88 - Control PID CNC Un Eje Con Motores DC Con Escobillas (Retroalimentación)
13:38
Servo PID Control of DC Motors Using Encoders, C++, and Arduino - Complete Tutorial
1:10:15
Encoder de cuadratura para robótica usando Arduino | Guía Completa
17:15
Edison R Sasig - Roboticoss
Рет қаралды 17 М.
Уроки Ардуино. ПИД регулятор
28:57
Заметки Ардуинщика
Рет қаралды 485 М.