Тёмный
Ian Carey
Ian Carey
Ian Carey
Подписаться
Ian is an engineer and maker from Ireland - he spends most of his spare time making things, filiming it for RU-vid or writing articles about it for his website.

#electronics #programming #3dprinting #robotics #woodworking #diy #pidcontrol
Line Following Bot - Part 2: Chassis
10:48
2 месяца назад
Conway's Game of Life - in Rust!
24:30
3 месяца назад
Line Following Bot - Part 1: Light Sensors
18:14
3 месяца назад
How to set up the LSE on an STM32
18:06
4 месяца назад
Custom STM32 Dev Board with Rust!
19:43
4 месяца назад
Testing my Custom Power Supply PCB
6:22
5 месяцев назад
Arduino Stepper Motor Clock
16:34
5 месяцев назад
Custom G-Code with Rust!
27:31
7 месяцев назад
Ruby to Rust - Marching Squares
35:19
8 месяцев назад
Making an IKEA RÅSKOG Fit Under a Desk!
11:42
8 месяцев назад
Advent of Code 2023 - Day 21
17:13
9 месяцев назад
Advent of Code 2023 - Day 20
19:22
9 месяцев назад
Advent of Code 2023 - Day 19
29:20
9 месяцев назад
Advent of Code 2023 - Day 18
22:56
9 месяцев назад
Advent of Code 2023 - Day 16
23:21
9 месяцев назад
Irish Makers Secret Santa 2023
17:12
10 месяцев назад
Advent of Code 2023 - Day 15
17:08
10 месяцев назад
Advent of Code 2023 - Day 14
36:25
10 месяцев назад
Advent of Code 2023 - Day 13
20:11
10 месяцев назад
Advent of Code 2023 - Day 11
14:29
10 месяцев назад
Advent of Code 2023 - Day 10
27:45
10 месяцев назад
Advent of Code 2023 - Day 9
17:20
10 месяцев назад
Advent of Code 2023 - Day 8
19:39
10 месяцев назад
Advent of Code 2023 - Day 7
26:03
10 месяцев назад
Advent of Code 2023 - Day 6
18:50
10 месяцев назад
Advent of Code 2023 - Day 5
25:40
10 месяцев назад
Advent of Code 2023 - Day 4
18:18
10 месяцев назад
Комментарии
@caleb_wole
@caleb_wole День назад
Thanks for explaining this so well. I wish my control classes in uni showed explicitly how the theory is applied to real-world problems. After watching this, I feel I have a better intuitive understanding of PID control. God bless you!
@careyian
@careyian День назад
You're very welcome!
@Bedfford
@Bedfford 9 дней назад
HI! great video! But I don't understand how you pass the 'dt' value into the pid() function without using a additional parameter, like pid(error, dt); . Arduino manage the 'dt' as local or global variable ? Thanks!
@careyian
@careyian 8 дней назад
Hi there, yes dt is a global variable. I could have done the same with error. It doesn’t make much difference here. Glad you enjoyed the video!
@DragonzaS
@DragonzaS 9 дней назад
Great video! Now understand PID and used it for my filament dryer. Now I am tuning it and trying out different combinations. Thanks!
@careyian
@careyian 9 дней назад
Hey that’s awesome!! Really glad this helped!! Well done friend, keep having fun!
@filevillahermosa7167
@filevillahermosa7167 12 дней назад
Hi.. I'm doing this project but I have different parts... Will this work with uno?
@careyian
@careyian 12 дней назад
Yes, it should work with an Uno!
@filevillahermosa7167
@filevillahermosa7167 12 дней назад
@@careyian is there any way I can talk with you? I am using a different stepper motor driver which is specifically A4988 and my sensor is MPU6050 .. will your code work with this components?
@careyian
@careyian 12 дней назад
@@filevillahermosa7167 you can message me here if you like: iancarey.ie/contact However, my code will not work with those components. The driver might work, as I believe they have the same pinout but I don’t know, I’ve never used one. As for the sensor, that’s a completely different type of sensor that I am using, so my code won’t directly work with it. You would have to modify it heavily.
@hassegreiner9675
@hassegreiner9675 16 дней назад
I controlled the temperature in a greenhouse (90m*20m*6m) almost entirely on the derivative portion - the time constant of that volume of air required it.
@careyian
@careyian 16 дней назад
Cool!
@mayabiswas2772
@mayabiswas2772 26 дней назад
Congratulations
@careyian
@careyian 26 дней назад
Thank you!!
@ShubhamShanbhag
@ShubhamShanbhag 26 дней назад
Do you have any video or technique for autotuning the kp, ki and kd values?
@careyian
@careyian 26 дней назад
Unfortunately no, I usually always manually tune controllers
@opticonor
@opticonor 29 дней назад
Niice!!! What's next for him? Super jealous of your workshop 🛠
@careyian
@careyian 28 дней назад
No specific plans for right now, but I will take what I've learned to future projects! Thanks, it's not my dream workshop by any stretch, but you can get a lot done in it!
@laurenvickers8615
@laurenvickers8615 29 дней назад
Wiggle butt
@careyian
@careyian 29 дней назад
She tried but she can’t help it!
@laurenvickers8615
@laurenvickers8615 29 дней назад
Nice socks 🧦
@careyian
@careyian 29 дней назад
Giving the people what they want
@careyian
@careyian Месяц назад
Love this little robot! So happy with how it turned out!!
@careyian
@careyian Месяц назад
This one tested me a bit, I was really happy I spent the time to rebuild the sensor module, it worked better than I expected!
@ChickenNuggetMN
@ChickenNuggetMN Месяц назад
I know this is from a while ago, but ehat sensor is that??
@careyian
@careyian Месяц назад
Hey there, it's a HC-SR04 Ultrasonic Distance Sensor, you can get them from most hobby electronics suppliers, I got mine from Amazon.
@pif5023
@pif5023 Месяц назад
I was stuck in exactly the same way!!! I was counting all the vertical ones and I was not understanding what was going wrong! So frustrating!
@careyian
@careyian Месяц назад
This was one of the toughest problems of last year!
@VinothkannanR-vu9yl
@VinothkannanR-vu9yl Месяц назад
To achieve critical damping what is the value?
@careyian
@careyian Месяц назад
Hi, I don't know what you mean, could you elaborate? The values will probably be different if you set this up yourself and you will have to tune them yourself.
@laurenvickers8615
@laurenvickers8615 Месяц назад
Taylor Swift’s biggest fan
@careyian
@careyian Месяц назад
The songbird of our generation
@LittleFjords
@LittleFjords Месяц назад
Ollo! I have a project in mind where the speed of the motor is generally more important than positioning (except for linear end points). I have a physical input device that sets motor speed at one of 8 speeds in either direction. Does it make sense to use PID to keep the speed consistent and to smooth the transitions from one speed to another? (I'm trying to improve on a standard control protocol that often leads to visible motion jerks) Very much a newbie so sorry if this doesn't make much sense!
@careyian
@careyian Месяц назад
Hi there, yes a PID controller will work well for speed control too. The only difference will be your feedback sensor will measure speed not position. Everything else will be pretty similar to what I talk about above.
@laurenvickers8615
@laurenvickers8615 Месяц назад
Looks like a very cute robot
@careyian
@careyian Месяц назад
Thanks you! He needs a name! Any ideas??
@careyian
@careyian 2 месяца назад
Weeeeeeeeee!!! Progress made, lots of progress made, still lots to do, LET'S GOOOOOOOOO!
@careyian
@careyian 2 месяца назад
I was in Paris for the Olympics and I bought the nerdiest thing to remember it by! I miss Paris, but I have a little piece of it on my desk now!
@careyian
@careyian 2 месяца назад
Little bit of a delay in getting this one out, I have been very busy with my day job and I was also on holidays, but we are back! Hope you enjoy this one, it's only short but it's the latest view on my progress on the line following robot! More to come
@khanggggg
@khanggggg 2 месяца назад
Respect from Viet Nam
@careyian
@careyian 2 месяца назад
Thanks!!
@_charmlc
@_charmlc 2 месяца назад
I love this idea thank you!!!!! Very creative😊
@careyian
@careyian 2 месяца назад
Thank you! 😊
@nhatcao8411
@nhatcao8411 2 месяца назад
your code clean, your explaination clear, your voice good --> 10/10 video, thanks bro !
@careyian
@careyian 2 месяца назад
Thanks friend! Glad you liked it!!
@arshiafas9361
@arshiafas9361 2 месяца назад
thanks mate, you helped a bachelor student here :)
@careyian
@careyian 2 месяца назад
Love to hear it! You are very welcome friend
@derrickadusei7987
@derrickadusei7987 2 месяца назад
This is an amazing content . i wish there was a quick way to calculate the pid values and tune them quickly since as an engineer you have dead lines to meet
@careyian
@careyian 2 месяца назад
Great point, real engineers can build actual models of these things and simulate different PID values, it’s never going to be 100%, there is a trade off of detailed models and the time it takes to build etc. There are also methods for tuning PID controllers. However, it might end up being faster to do it manually. You also have to think about if you are building a product, the base tuning might come from a model and simulation, you only need to build that once, then you can tweak and tune it afterwards.
@JeffBird766
@JeffBird766 2 месяца назад
Have you ever considered micromouse? I came across the UKMARS yt channel and am now hooked! I'll be building my own soon but thought it might be up your alley as well. I've watched your videos a lot, I like your problem solving style!
@careyian
@careyian 2 месяца назад
Ahhhh, I’ve seen them, they are super cool, I’d love to make one some day!
@celestinemachuca2339
@celestinemachuca2339 3 месяца назад
Do a Julia set with rust now and sweep thru the imaginary plane :) it is awesome project to learn.
@careyian
@careyian 3 месяца назад
Oooooh, nice, I'll add that to my list!!
@ZapOKill
@ZapOKill 3 месяца назад
if ((alive | population ) == 3){ // set next iteration to alive } this weirdly handles all cases
@careyian
@careyian 3 месяца назад
Ha! That's so great, love it!
@local.interloper
@local.interloper 3 месяца назад
Fun fact: For keeping the state of active cells you can use a hash set of touples that represent coordinates. and then use a matcher to progress the game. It's incredibly fast.
@careyian
@careyian 3 месяца назад
I actually refactored my code since to use the tuples, it's much nicer! The string keys came from my previous experience building larger hash keys with more params while doing advent of code in Ruby. It can be handy to easily print for visually debug them. For this project, the tuple keys are much better.
@JosephDavies-j8b
@JosephDavies-j8b 3 месяца назад
This is awesome, I am teaching myself C++ and OpenGL and conway's game of life is my first project. I would love to learn Rust one day. Keep up the great content!
@careyian
@careyian 3 месяца назад
Hey, thanks a lot! Good luck with your project!
@misterwoody_
@misterwoody_ 3 месяца назад
Was the rust code removed from the repository as a matter of interest? I only see a ruby version now. Many thanks
@careyian
@careyian 3 месяца назад
Hey, they are both there, two folders, one called Ruby and one called Rust, should all be there unless I made a mistake let me check
@careyian
@careyian 3 месяца назад
Ahhhh I made a mistake copying it!!! I’ll fix that now
@careyian
@careyian 3 месяца назад
Fixed now, thanks for pointing that out, I managed to delete it while reorganising the repo!!
@yigglesmoto
@yigglesmoto 3 месяца назад
The optimization to only check live / neighboring dead cells is interesting, but depending on the state is short-lived, no? It's never removing entries, so a single glider going across the grid would end up leaving a ton of dead cells with no live neighbors in the HashMap. Is there also a reason you initialize to a default hashmap in main, then immediately reassign? It seems like `seed_grid` should just be the initializer, or take the `grid` as an `&mut` so you don't need to reassign the value
@careyian
@careyian 3 месяца назад
Oh yeah, there is no need to reassign after the initial, seed_grid can re assign it. As for your first observation, note at the start of the loop, we recreate a new empty grid each time and only then fill it with the next set of live cells and their adjacent dead ones.
@yigglesmoto
@yigglesmoto 3 месяца назад
@@careyian Ah, I totally forgot about the new_grid! Great optimization. Something about using Strings as keys for the coordinates still bothers me, for some reason. I wonder if a simple struct with two i32s would be more efficient? But this is all still very neat. You can probably use `std::mem::swap` on the two grids instead of cloning when you reassign. I'm imagining a 2nd iteration on this where you could either "move" the view of the grid (i.e. WASD and be able to follow a glider), or use the `print_area` to either have it wrap around or stop storing cells out of bounds
@careyian
@careyian 3 месяца назад
@@yigglesmoto I actually just did a few tweaks to the code there and published my Ruby example of doing it too. I actually realised I didn't need to clone, I think I had it in while debugging because I had some compiler error at some point, but it wasn't needed anyway. On the string keys, there probably is a better way, it's a pattern I have used tonnes while doing advent of code for creating hashing keys of many different params, so it's just the first thing that occured to me. That said, it works well in Ruby, but isn't as nice in Rust.
@laurenvickers8615
@laurenvickers8615 3 месяца назад
Do not pass go
@careyian
@careyian 3 месяца назад
@@laurenvickers8615 that one is next week
@laurenvickers8615
@laurenvickers8615 3 месяца назад
Not too rusty … heh heh
@laurenvickers8615
@laurenvickers8615 3 месяца назад
YAYYYYYY A NEW VIDEO
@careyian
@careyian 3 месяца назад
IKR?!?!
@careyian
@careyian 3 месяца назад
Lots of fun writing this super simple simulation of Conway's Game of Life! Check out the full video for more!
@laurenvickers8615
@laurenvickers8615 3 месяца назад
Oh wait…game of life…not monopoly
@careyian
@careyian 3 месяца назад
I have been crazy busy recently and haven't had as much time as I'd like to work on my projects. I plan to jump back into my recent robotics project soon, but this was a welcome for me to just code up something fun and I hope you guys learn something from it! Edit: Thanks for all the comments folks, between your comments here and some comments on Reddit I have refactored some of the code which you can see in the GitHub link in the description. The main thing I changed was swapping from string keys in the hash to tuple keys for the coords, it's much cleaner this way! The string keys came from my previous experience building larger hash keys with more params while doing advent of code in Ruby. It can be handy to easily print for visually debug them. For this project, the tuple keys are much better. I also added my Ruby solution there too. Thanks for the comments folks!!
@abdoelzohiery2133
@abdoelzohiery2133 3 месяца назад
That's a great explanation; however, I think we should consider making the PID gains more adaptive to enhance the code's generality and accuracy. Would this improvement be beneficial or will it add unnecessary overhead to the code?
@careyian
@careyian 3 месяца назад
Hey there, what do you mean by adaptive?
@abdoelzohiery2133
@abdoelzohiery2133 3 месяца назад
@@careyian I mean if we can make a simple method that changes the gains within the runtime based on the time the system takes to reach its steady state. Therefore we will have a better gains for the next time.
@careyian
@careyian 3 месяца назад
Yeah, I guess you could do something like that if you wanted to. This is just example code, I have no plans to do anything more with it.
@reshari5368
@reshari5368 3 месяца назад
The robot turned out to be cool, don't you have a visual connection diagram?
@careyian
@careyian 3 месяца назад
What is a visual connection diagram?
@reshari5368
@reshari5368 3 месяца назад
@@careyian this is a drawing with pin markings where the boards will be connected to each other through wires. This makes it easier to navigate in which rem you need to connect the boards
@reshari5368
@reshari5368 3 месяца назад
@@careyian I just want to erase your robot for training, but I'm a little confused about which pins to insert the wires into.
@careyian
@careyian 3 месяца назад
Erase it??
@careyian
@careyian 3 месяца назад
Ahhh you mean a schematic, no, I don’t have one I’m afraid
@laurenvickers8615
@laurenvickers8615 3 месяца назад
So beautiful
@careyian
@careyian 3 месяца назад
IKR?!?!
@laurenvickers8615
@laurenvickers8615 3 месяца назад
Rumour has it, you couldn’t locate your black tape…
@careyian
@careyian 3 месяца назад
Rumor has it I never had any…
@laurenvickers8615
@laurenvickers8615 3 месяца назад
Lots of ambient light
@careyian
@careyian 3 месяца назад
Tooooooo much
@opticonor
@opticonor 3 месяца назад
Comment for the algo 🤖 This reminds me of a project we did back in college, except it was using Lego/Technic and a light sensor - had to build a robot that would go looking for lit candles and try to extinguish them 🔥 Looking forward to part 2!
@careyian
@careyian 3 месяца назад
Haha, class! That sounds like a fun project. This was actually inspired by a project I did in college to monitor and control the speed of a spinning disc. Strip of black tape on a white disc, read the pulses from an LDR. Then use a PID controller to match the speed to differing breaking forces on the disc.
@careyian
@careyian 3 месяца назад
Woop, lots of fun building this! Check out the full video for more!
@careyian
@careyian 3 месяца назад
Pretty impressed with how well this thing worked. Had no idea if it would, nice to surprise yourself sometimes!
@laurenvickers8615
@laurenvickers8615 4 месяца назад
Brother … ew
@careyian
@careyian 4 месяца назад
What’s that brother???
@mietekgpz
@mietekgpz 4 месяца назад
PID have three values. "P" ,"I" and "D". It's very confusing when you call all of them "gain". I've watched it three times and still got confused what is what:/
@careyian
@careyian 4 месяца назад
Oh well, sorry about that, I thought it was clear enough
@LOLWUT281
@LOLWUT281 4 месяца назад
Why 32k and not the 32.768k(?) one? Internal crystal for most the STM32's I've seen are already tuned for the inferior 32k clocks. And Do you mean to say that on the low speed pins, your original board had the wrong clocks at 16MHz? Finally, with such low volume, just get an active circuit, single clock oscillator. Dealing with caps and impedance tuning on such low volume made in china boards is just annoying at best and a waste of time at worst. Also if you fuck up and put the wrong speed, you can easily just pop off that oscillator and put the right one on. Regardless, doing your own board and messing up like 20 times really is the best way to learn.
@careyian
@careyian 4 месяца назад
Ahhh sorry, I’m just rounding it off when I say 32k, just easier to say than the decimals, I also keep forgetting what the decimal points are! Originally I had a 16Mhz resonator connected to the same pins, basically didn’t read the docs properly at all… You are also totally right about the external modules for this, this specific STM32 actually only even supports the HSE via one of those type of modules, so in future I’ll probably go with one of them if I come to need it. However, like you say, this was a great way to learn
@logigen
@logigen 4 месяца назад
One thing I’ve had to come to accept is that if it works, don’t touch it
@Perfect-Idiot
@Perfect-Idiot 4 месяца назад
I know right, accidentally bend a small peice and it only works half the time lol
@careyian
@careyian 4 месяца назад
So damn true!!
@careyian
@careyian 4 месяца назад
Well… at least it does work half the time!!
@logigen
@logigen 4 месяца назад
A win is a win