E022 How to Plan & Structure a Large MicroPython Program

  Рет қаралды 362

Making Stuff with Chris DeHut

Making Stuff with Chris DeHut

Күн бұрын

As we transition from construction to programming in Phase II of the Zoomtown experiment, it is time to carefully plan out the concept of the program. In this video we will cover a lot about what the program needs to do, how I want it to operate, and highlight a few of the unknowns. If you have not worked on moderately complex projects, this is a great opportunity to see one way of outlining it before you dig into the code.
#MicroPython #PICOW #Robotics

Пікірлер: 17
@oraflores
@oraflores 3 ай бұрын
A few comments: (1) First of all, as fun and instructive as I think the subjects of your videos are, I especially like your emphasis on the _design_ of your engineering projects. I don't believe there is enough of that on KZfaq. (2) Concerning the problem you raised about backing out of the driveway while avoiding collision:: how about just backing into the driveway and driving forward to leave the driveway? I think this could work, but might only just move the problem around.... (3) Concerning your questions about possible failure: if absolutely nothing were to go right, as long as you were thorough in explaining why things went wrong and threw out a few ideas and reasoning about how the problems might be addressed, from my perspective as a student of design, I would consider your experiment a success. (4) I don't know if it will be appropriate, but you might consider running multiple parallel threads (2 for the Pico if you use separate processors, I think?) in the code to reduce the loop time. Keep up the good work.
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
Hello @oraflores Thank you very much for watching and sharing your ideas, suggestions, and encouragement, VERY MUCH APPRECIATED! I would like to respond as well. 1) I agree, the vast majority of videos focus purely on just the function, or command, or simple do this. That has purpose but it does nothing to help people learn the process of creative or engineering type thinking. The ZoomTown experiment gives purpose to all the things I wanted to talk about this year - while not popular in terms of number of views, I have enjoyed every minute of it and people like yourself see value in it - and that is a wonderful experience for all. 2) Yeah, it is kind of like chasing the tail, but the biggest limitation is the amount the Zoomie can see and that will be a drawback but there is a solution already in motion, actually 2 but those are a bit further down the road. 3) Failure is always an option for me :-) When I first started talking about this project conceptually, a number of people were quick to say "It won't work" or "This won't work" or "do it that way instead, it will be faster". These are comments from people I respect and I don't discount their comments, however, a large part of my enjoyment with doing anything is the process of DISCOVERY. I want that experience of success and I want that experience of failure. There is nothing bad or wrong about either experience and both can be very beneficial. Even if I know absolutely that something will not work (Like the deterministic loop I am currently fixated on) if I have an idea for a different approach, that is merrit enough to explore the idea again - I know more today than I did 3 months ago. If I knew everything would work perfectly before I started to do it, I would probably hate life! I am 99.99% sure you and I share the philosophy. 4) Oh yeah, threading is a good thing and it very well may end up in this project. There is a pretty serious speed bump coming up in about 4 weeks or so. This will cause be to change direction to find a solution. Thank you again so much for sharing your thoughts and ideas, it is very much appreciated. Cheers! Chris
@wktodd
@wktodd 3 ай бұрын
Chris. Looking at the complexity of your application, I would strongly suggest you start it as fully OOP using modules for loop functions. You might even find having fast and slow loops helps
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
Hello wktodd, Thanks for chiming in and sharing your thoughts. I agree with what you are saying and frankly at this stage (I am much farther along than what you are seeing now) of the game, the decisions will have to be made soon. At the very beginning of the project while just thinking about it, I REALLY wanted it to be as basic as I could make it. Some of the "ground rules were": Must be a PICO, cannot be a Pi Zero or anything more powerful. Must be only one micro controller (although I believe a sensor is using one but that isn't in my control) Must be programmed in MicroPython (no PIO, no C / C++) Must be as inexpensive as possible (It is getting more and more expensive, but I tried hard to keep costs down) As for OOP, I have a love hate relationship with it and I don't know why. I think it is simply being lazy but it also could be a million other reasons. When I created Razzy (that big robot I showed in an earlier episode), that had about 5 RPI-3s and it was programmed almost entirely OOP, and it was certainly a better overall "system". With where I am at on the ZoomTown Experiment, I wanted the focus to be mostly about having a practical problem that could be solved with the most basic and affordable elements and so far I am staying pretty true to that. Unfortunately, the reality is coming on fast and I may have to change directions on the fly which is also fun - just like real life. Thanks again for joining in and contributing your wisdom. Cheers! Chris
@mihailemnaru8919
@mihailemnaru8919 3 ай бұрын
Thank you! You are the best. :)
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
Hello @mihailemnaru8919 THANK YOU AGAIN SO VERY MUCH! You are very kind. Cheers! Chris
@BeekersSqueakers
@BeekersSqueakers 3 ай бұрын
The encapsulation OOP offers makes everything so much nicer. I'm so used to writing classes that sometimes I forget how powerful they are. At least until I read someone else's code thats just a mess of loops, inside loops, inside loops with the same code copy and pasted throughout...
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
I too appreciated the power of OOP. It has changed the process of "thinking" about programming a lot from years past and earlier languages. As the old saying goes though - "you can't teach an old dog new tricks". I have learned it, I just can't make the switch to it as my go to style. I guess I am more like a lot of old people than I think as I seem to fight change ;-) BTW- I want to thank you for joining the channel and being a part of this community. I believe you are my first subscriber that has "binge" watched and commented on 5 videos in a row - makes me feel like I am serving the community well. Cheers! Chris
@donaldhoudek2889
@donaldhoudek2889 3 ай бұрын
Chris, looking at the main loop timing, that looks like it will be a lot of work for the Pico W. Would over-clocking the Pico W by 10 or 20% (Safe) help out any, although you may need to keep it cool. Should you run into timing issues, it may be a good idea to have another Pico or an Arduino help out by assigning the sensor data responsibility to the second controller and just hand off the current sensor data to the main Pico. Good Luck! Great video! Enjoying the videos
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
Hi Donald, Thanks for sharing your thoughts, very much appreciated!!!! You have good intuition and as you will find out a few more episodes down the road, I will run into performance troubles causing a re-think. I don't want to share all the details yet, but I will say that I am pushing the limits (using micropython) the way I am which was my intention from the start. Even though I am much further along in all the programming than you are seeing today, I am at the transition time where things are going to work, or there will be some very serious head scratching going on to figure out how to save it from total failure. Thanks again for sharing your thoughts, helps keep my mind open. Cheers! Chris
@donaldhoudek2889
@donaldhoudek2889 3 ай бұрын
@@MakingStuffwithChrisDeHutWell you can always learn "Assembly" language. I used to do it in my early days (1970's) much faster, just need to keep tract of the resisters... lol
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
​ @donaldhoudek2889 I actually would prefer Assembler over C/C++ or JAVA. A number of years back I was working with the Propeller micro-controller, as I recall it was one of the first multi-core micros. I want to do a rudimentary CNC control with it and quickly learned its native language (Spin?) was not up to speed. But it did have a lower level language which I think they referred to as Assembler, I FELL IN LOVE WITH IT! Cheers! Chris
@wktodd
@wktodd 3 ай бұрын
@@MakingStuffwithChrisDeHut snap. C++ is probably the best way, but I've writing code since before C came out and never really' liked' it Most (all ?) of my mpu stuff was written in assembler . I picked up on Python a few years ago, and it just seemed to click. Micro python has tripped me up a couple of times, but the help from the guys on the RPI forum is superb (as is the documentation from the RPF).
@donaldhoudek2889
@donaldhoudek2889 3 ай бұрын
@@MakingStuffwithChrisDeHutJust for the heck of it take parts of your code and put them in ChatGPT (AI) and ask it optimize it. Then try and run it. I wonder what it would do? Just for the curiosity part of it.
@tomek3633
@tomek3633 3 ай бұрын
New music :) enjoy your pizza tonight!
@MakingStuffwithChrisDeHut
@MakingStuffwithChrisDeHut 3 ай бұрын
You are very observant Tomek, yes indeed. I had actually wanted to switch music between the component selection phase and the build phase but got distracted. Don't you know it man, it is PIZZA night with my wife. How about you, been making some lately? Cheers! Chris
E021 Final Assembly of the Zoomie. the PICO controlled Autonomous Robot
22:14
Making Stuff with Chris DeHut
Рет қаралды 243
E023 Take a Look at the Zoomie Program Framework with it's Deterministic Loop
38:30
Making Stuff with Chris DeHut
Рет қаралды 185
100❤️
00:19
MY💝No War🤝
Рет қаралды 6 МЛН
Heartwarming: Stranger Saves Puppy from Hot Car #shorts
00:22
Fabiosa Best Lifehacks
Рет қаралды 20 МЛН
The child was abused by the clown#Short #Officer Rabbit #angel
00:55
兔子警官
Рет қаралды 24 МЛН
033 DON'T LET MICROPYTHON'S GARBAGE COLLECTOR RUIN YOUR PROGRAM
22:03
Making Stuff with Chris DeHut
Рет қаралды 429
035 Time To Reevaluate ZoomTown and the Current Approach
1:01:13
Making Stuff with Chris DeHut
Рет қаралды 332
026 Basic Motion Control for Zoomie (Autonomous Robot)
29:01
Making Stuff with Chris DeHut
Рет қаралды 215
Tigger C : an efficient 6502 C compiler
49:04
Hopper Development Environment
Рет қаралды 7 М.
The Only Unbreakable Law
53:25
Molly Rocket
Рет қаралды 318 М.
029 How to Steer a Robot with Encoder Feedback
24:07
Making Stuff with Chris DeHut
Рет қаралды 206
037 The Ever Evolving Zoomie and Viewer Suggestions
23:12
Making Stuff with Chris DeHut
Рет қаралды 265
Why Does Scrum Make Programmers HATE Coding?
16:14
Thriving Technologist
Рет қаралды 502 М.
I wish every AI Engineer could watch this.
33:49
1littlecoder
Рет қаралды 64 М.
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
Easy Art with AR Drawing App - Step by step for Beginners
0:27
Melli Art School
Рет қаралды 8 МЛН
تجربة أغرب توصيلة شحن ضد القطع تماما
0:56
صدام العزي
Рет қаралды 12 МЛН