Тёмный
No video :(

#28 Tutorial: PID controller using an Arduino 

Andreas Spiess
Подписаться 480 тыс.
Просмотров 112 тыс.
50% 1

Опубликовано:

 

5 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 101   
@rashiidsherif9222
@rashiidsherif9222 8 лет назад
You explained the details amazingly , definitely enforced my understanding of your project and PID as a whole. Cheers.
@AndreasSpiess
@AndreasSpiess 8 лет назад
Thanks!
@F3Aer
@F3Aer 8 лет назад
Incredible clear explanation of PID closed loop controller. I use them for my quadcopters. Congratulations!
@AndreasSpiess
@AndreasSpiess 8 лет назад
+Pablo López Thank you for your very nice comment!
@daveyhi3154
@daveyhi3154 7 лет назад
Great job on the "PID controller" part- very clear and easy to understand. Not so great on the "using an Arduino" part.
@AndreasSpiess
@AndreasSpiess 7 лет назад
:-)
@JohnSmith-ed1sr
@JohnSmith-ed1sr 7 лет назад
I understand fully how PID works but lack the understanding of Arduino to implement. Would you be willing to share the code or perhaps a similar bit of code to get us going in the right direction
@PaulExo
@PaulExo 7 лет назад
Your nice instructive video cured my hang-over. Thanks!
@AndreasSpiess
@AndreasSpiess 7 лет назад
+PaulExo :-)
@barakamultiteknika4480
@barakamultiteknika4480 8 лет назад
Great Tutorial. It's quiet clear explanation for me. I am waiting for the next video explaining Self Balance 2 wheel robot as you promise in the end of this video. I plan to build it. Pls release it ASAP. Thank you so much
@AndreasSpiess
@AndreasSpiess 8 лет назад
+Mugi Raharjo Thank you for your comment!. The balancing robot was a quite big project and I will divide it in several videos. I hope, I can start the series around Christmas this year. First, I have to finish my ESP8266 tutorial series...
@batch-man
@batch-man 3 года назад
Amazing explanation
@AndreasSpiess
@AndreasSpiess 3 года назад
Thank you!
@create80
@create80 Год назад
Thanks for taking the time to do this, excellent!
@AndreasSpiess
@AndreasSpiess Год назад
You are welcome!
@elrondmcbong467
@elrondmcbong467 4 года назад
Eureka! Endlich gschnallt. Danke für die super erklärig.👍👍👍
@AndreasSpiess
@AndreasSpiess 4 года назад
Gern geschehen!
@GarethJefferson
@GarethJefferson 8 лет назад
Wow! Thank you so much for a fascinating and instructive video. I came across you channel purely by chance, but what a wonderful find. I have, of course subscribed, and I hope many more people do too.
@AndreasSpiess
@AndreasSpiess 8 лет назад
+Gareth Jefferson Thank you very much for your support. Comments like yours help me if I am sometimes a little behind schedule with my videos!
@yousefalotaibi8343
@yousefalotaibi8343 8 лет назад
+Andreas Spiess could you please show us the code
@AndreasSpiess
@AndreasSpiess 8 лет назад
+yousef Alotaibi Unfortunately, the code is still in a very experimental stage and I have to work on it. In the next weeks I hope, I can reactivate my wind tunnel project again and then, I will post the code.
@bryanst.martin7134
@bryanst.martin7134 5 лет назад
I think it was on the boundary of the Arduino to get it higher than Andreas got it. Servo positioning ok. Precise motor control needs a lot more power. My favorite workhorse is a uC from ST Micro. It can do 10 times as much in one tenth the time. Nice tutorial.
@AndreasSpiess
@AndreasSpiess 5 лет назад
Or an ESP32 ;-)
@PhG1961
@PhG1961 7 лет назад
Very excellent video and tutorial. Again, I learned something interesting.
@AndreasSpiess
@AndreasSpiess 7 лет назад
Thanks for the nice words!
@j37timmy
@j37timmy 8 лет назад
Hello. Will you be able to share the code of this fan pid controller. I have made a home made jet engine and this code would be perfect to use as throttle controll. I have a hall sensor with a amplifier and a schmitt trigger so that would be the same as you. Insteed of driving a fan it would be driving the fuelpump. I need this function because today when i am igniting the afterburner the rpm off the engine goes down alitle bit. I have a ordinary 10k potentiometer as throttle.
@piuselectronics5707
@piuselectronics5707 2 года назад
thanks a lot, I was struggling with this
@AndreasSpiess
@AndreasSpiess 2 года назад
Glad it helped!
@norm1124
@norm1124 8 лет назад
Ein Coop Kunde ;-). Wie immer herzlichen Dank und bis zum nächsten Video.
@AndreasSpiess
@AndreasSpiess 8 лет назад
+norm1124 Nicht ich: Meine Frau. Ich tendiere eher zum Landrover ;-)
@davidmarks509
@davidmarks509 6 лет назад
Very good tutorial on PID thankyou
@AndreasSpiess
@AndreasSpiess 6 лет назад
Thank you!
@garyhoffmann1615
@garyhoffmann1615 6 лет назад
Good video, example code would be a very helpful addition.
@AndreasSpiess
@AndreasSpiess 6 лет назад
This is quite an old video and I do not have the sketches handy. However, there is an Arduino library for PID.
@XXXXIndices
@XXXXIndices 6 лет назад
Thanks for the reply, I figured it out with an example that came with the PID Library.
@owlsight4499
@owlsight4499 8 лет назад
Thank you very much! Top-notch tutorial!
@AndreasSpiess
@AndreasSpiess 8 лет назад
+Owl Sight You are welcome!
@chiragtanwani9506
@chiragtanwani9506 8 лет назад
Your video was great!! Thanks.. How have you plotted the graph of speed and other variables? Which software did you use?
@AndreasSpiess
@AndreasSpiess 8 лет назад
Just with Excel. You might have a look on my video #6 where I show how you can connect Arduinos with Excel.
@toastrecon
@toastrecon 7 лет назад
This may be more work than it's worth, but would you ever write some kind of numerical method algorithm to find the right parameters? I mean, you'd start it up, and it would evaluate its own performance. You could put your hand over it and do other things to perturb it, and over time, it'd learn?
@AndreasSpiess
@AndreasSpiess 7 лет назад
That is a whole other story and so far, I have no knowledge in the area of "self learning". A big part of the Silicon Valley for the moment is in this topic, and maybe, one day, we get ready made algorithms to be used by people like me. One big problem in real world examples exists however, and the self balancing robot is a good example: It falls down if the error is too big. So, you would need a lot of patience to restart it after every "learning step" (or you include a "self stand-up" functionality)
@JohnClulow
@JohnClulow 7 лет назад
Thanks. Excellent video !!
@AndreasSpiess
@AndreasSpiess 7 лет назад
:-)
@luis8768
@luis8768 7 лет назад
Did you end up only using the I controller since it got you exactly the 2000 RPM, or did you still end up using the proportional part of the controller? Great video!!!
@AndreasSpiess
@AndreasSpiess 7 лет назад
+Luis Camal At the beginning the D part is important. Later, the I part gets more important, when the difference is smaller
@PeterMedvesek
@PeterMedvesek 7 лет назад
Great learning material
@AndreasSpiess
@AndreasSpiess 7 лет назад
Thanks!
@Sandreble
@Sandreble 6 лет назад
Very nice. Thank you for open my mind...
@AndreasSpiess
@AndreasSpiess 6 лет назад
You are welcome!
@cowpens6
@cowpens6 7 лет назад
yeh! this is what I'm looking for! thanks!
@AndreasSpiess
@AndreasSpiess 7 лет назад
You are welcome!
@amernazirawan3908
@amernazirawan3908 6 лет назад
Great tutorial, I am working on similar speed control problem, what kind of sensor is used for speed sensing(how many pulses per revolution?), what is the sampling interval, can we use time interval as the control variable?
@AndreasSpiess
@AndreasSpiess 6 лет назад
It was all built into the fan and I do not remember the exact numbers. 4 wire fans have a sensor for RPM built-in
@piuselectronics5707
@piuselectronics5707 2 года назад
what if the motor speed is lower than the required value, wouldn't the P part = current value - required value. Or do I just take the absolute value of the difference
@AndreasSpiess
@AndreasSpiess 2 года назад
I do no more remember the details. But the formulas should be correct.
@matteoriad3214
@matteoriad3214 8 лет назад
Great Tutorial! helped me with my bachelor thesis!! :D But could you please tell me how you plotted the graphs? I think it would be great if I had some of those in my report!! :D
@AndreasSpiess
@AndreasSpiess 8 лет назад
Glad to her that. So, I hope, it will be accepted. (I already corrected a few of them during my time as a teacher...). I do not remember exactly, but I think, I used the procedure described in video #9.
@matteoriad3214
@matteoriad3214 8 лет назад
Alright, I will take a look at it then.!! Thanks a lot :)
@yelhachimi
@yelhachimi 8 лет назад
You explaine amazingly thank you very much for this informations ^^, big thumbs up sir.
@AndreasSpiess
@AndreasSpiess 8 лет назад
You are welcome!
@shubhambahl
@shubhambahl 7 лет назад
Can you provide the arduino code ?
@AndreasSpiess
@AndreasSpiess 7 лет назад
No, I do not have it anymore. Sorry.
@grmljegrmone8807
@grmljegrmone8807 8 лет назад
awsome stuff, great channel... can it be used to control servos in a cnc-like maschine with incremental optical encoders? i heard there are better methods for this, but the pid seems quite simple
@AndreasSpiess
@AndreasSpiess 8 лет назад
+grmlje grmone Thank you for your compliment. Usually you do not need an additional PID controller for a servo because the servo itself consist of a motor, an position encoder (often a potentiometer) and something like a simple "PID" controller. But usually, they are very inaccurate compared what you need for a CNC. And usually, they have just 180 or 360 degrees range. If you exchange the word "servo" with "motor", then you are right. There are some videos where people used a motor, a rotary encoder (usually optical), and a controller. This seems to work and is a perfect application for a PID controller. Most of the smaller CNC routers (including mine) however, use stepper motors.
@grmljegrmone8807
@grmljegrmone8807 8 лет назад
+Andreas Spiess yeah, i should have said dc motors.. i added some transmission to them and they are going to become servos after i decide what control to use (pid and pll are the main candidates for now). i would love to see a video on pll in your style all the best in the new year :)
@AndreasSpiess
@AndreasSpiess 8 лет назад
+grmlje grmone Happy New Year to you, too. With PLL you mean Phase Locked Loops? What kind of applications you have in mind?
@grmljegrmone8807
@grmljegrmone8807 8 лет назад
+Andreas Spiess yeah, phase locked loop.. im intrested in it because im working on a diy cnc router atm. but im working on a piece of code as well that will allow me later in life to easily connect almost any kind of motor and easily control it, could be useful for future hacks, and i want to cram every type of control into it for more flexibility. i dont know much about pll.. yet
@skydahe9615
@skydahe9615 5 лет назад
thank you for your fantastic explanation, do you have any example code? Thank you so much!
@AndreasSpiess
@AndreasSpiess 5 лет назад
You find an example in the self-balancing robot
@KarlAlfredRoemer
@KarlAlfredRoemer 7 лет назад
Hello and direct one question: Did you use a PID-Library or did you implement that yourself?
@AndreasSpiess
@AndreasSpiess 7 лет назад
I implemented it myself
@rasmusjansson751
@rasmusjansson751 8 лет назад
hallo! I am on a very base-level and right now in a project where we use the hub-ee wheel (a wheel with built in encoder), if I understand you right and want to use a PID-controller to get the wheel to a specific position, could I write something like this to get a P-controller: int motor1speed; int actualPoint; int setPoint; int diff; int p; p=0,8; setPoint=340; void setup() { motor1Wheel.setupPins(8,11,9); } void loop() { diff=actualPoint-setPoint; motor1speed=diff*p; if (motor1speed>255){ motor1speed==255 } if (motor1speed
@AndreasSpiess
@AndreasSpiess 8 лет назад
1. Basics are ok. But I think, you need also negative speeds because your motor could go across the position and has to reverse. 2. Pay attention to the sign of the difference. The speed has to be different accordingly (positive or negative) 3. The I and the D parts have to be included as the p part. (diff *p + integral(diff) * i + diff' x d). You can take my code as an example. 4. I would start with the p only part. only if it works, I would add the I part. I do not think, you will need a d part.
@piyushkushwah3352
@piyushkushwah3352 3 года назад
can you plz help me to make a code for dmx stapper motor with encoder
@AndreasSpiess
@AndreasSpiess 3 года назад
I am a RU-vidr and share my knowledge in my videos.
@bitsurfer0101
@bitsurfer0101 8 лет назад
Is the ratio of P and I the same usually (by some factor) for servos as well?
@AndreasSpiess
@AndreasSpiess 8 лет назад
There is no particular ratio between p and i. Both have to be adjusted for every application
@orlin369
@orlin369 6 лет назад
Great!
@AndreasSpiess
@AndreasSpiess 6 лет назад
Thanks!
@pratikbhagat1731
@pratikbhagat1731 3 года назад
how to choose pidmin and pid max values
@AndreasSpiess
@AndreasSpiess 3 года назад
By experimenting
@pratikbhagat1731
@pratikbhagat1731 3 года назад
@@AndreasSpiessThanks andreas Can you please guide (1)pid max pid min depends on output range or error percentage or fixed range (2) In pid integral value and derivative values should be updated at what speed. I mean integral and derivative are based on time ? some standard pids like siemens give i and d in seconds. can you explain and guide. Thanks P.R.B
@varunn.a.5764
@varunn.a.5764 8 лет назад
Excellent....... :-)
@AndreasSpiess
@AndreasSpiess 8 лет назад
Thanks!
@NarutoUzumaki-mh5cz
@NarutoUzumaki-mh5cz 7 лет назад
lovely explanation ...... 😘 I hope you re-write code too since you lost it.......
@AndreasSpiess
@AndreasSpiess 7 лет назад
This is an old video. The chance is small that I will publish the code
@BernhardHofmann
@BernhardHofmann 8 лет назад
Every time I saw that poor motor being abused by the varying signals I couldn't help but laugh and think "Fan for sale. One previous careful owner." ;)
@AndreasSpiess
@AndreasSpiess 8 лет назад
+Bernhard Hofmann That's a Landrover. It is not abused. It is just used inside its specifications 😉
@BernhardHofmann
@BernhardHofmann 8 лет назад
I meant the motor of the fan, not the vehicle. Sorry, I should've been clearer. I'm really enjoying your videos by the way. I like you you showed the troubleshooting process in this video. Thank you. "Hop schweez" ;)
@amiermer115
@amiermer115 7 лет назад
what software do you use to collecting data?
@AndreasSpiess
@AndreasSpiess 7 лет назад
I use a Excel datalogger described in one of my videos
@vovanikotin
@vovanikotin 6 лет назад
What about integral windup?
@AndreasSpiess
@AndreasSpiess 6 лет назад
I do not know.
@vovanikotin
@vovanikotin 6 лет назад
Andreas Spiess thats very important part of pid controllers.
@AndreasSpiess
@AndreasSpiess 6 лет назад
So I still do not know. Never heard of.
@vovanikotin
@vovanikotin 6 лет назад
Read about, very interesting and important subject to learn. Maybe thats inspire you to make new video about it. Without integral windup maintance there could be a lot of problems in control systems.
@1q1q1q1q1q1q1qw
@1q1q1q1q1q1q1qw 8 лет назад
excellente Arbeit. besser hätte man die regler nicht zusammenfassen können ein viedo für ein kamera stabilisation wäre toll :)
@AndreasSpiess
@AndreasSpiess 8 лет назад
+1q1q1q1q1q1q1qw Vielen Dank für das Kompliment. Ich werde das Thema "Kamerastabilisator" auf meine Liste nehmen.
@1q1q1q1q1q1q1qw
@1q1q1q1q1q1q1qw 8 лет назад
ja vielleicht wie man die pid lib richtig verwendet um einen schnellen gimbal zu bauen danke :D
@nayanablinks917
@nayanablinks917 6 лет назад
Sir, can i have your email sir?
@AndreasSpiess
@AndreasSpiess 6 лет назад
No
Далее
What is a PID Controller? | DigiKey
22:19
Просмотров 76 тыс.
I made a SUPER FAST Line Follower Robot Using PID!
10:02
У ГОРДЕЯ ПОЖАР в ОФИСЕ!
01:01
Просмотров 4,2 млн
ЭТО мне КУПИЛИ ПОДПИСЧИКИ 📦
22:33
MILLION JAMOASI 2024 4K
2:17:51
Просмотров 12 млн
Arduino PID Controller - From Scratch!
29:51
Просмотров 54 тыс.
Balancing Robot with PID - Mini Robot PCB
17:29
Просмотров 46 тыс.
The cheap Chinese bulb that won't turn off
10:27
Просмотров 10 млн
PID brushless motor control tutorial
16:25
Просмотров 468 тыс.
Hardware Demo of a Digital PID Controller
2:58
Просмотров 985 тыс.
У ГОРДЕЯ ПОЖАР в ОФИСЕ!
01:01
Просмотров 4,2 млн