|
honey the codewitch wrote: I believe I have figured out a way to drive pumps and fans at a specified RPM without using a PID
honey the codewitch wrote: This isn't a general request for help. However, if anyone wants to help and has an ESP32 of some sort and a PWM fan + two+ channel level converter, I wouldn't turn it down.
I love new discoveries, could you describe the new algorithm you found?
|
|
|
|
|
It's shockingly simple.
I give it a change delay - say 500ms (acceptable for my specs)
It can measure the RPM at any given point.
So what it does is there is a state machine and as soon as you change the RPM it stores the new target, and kicks the state machine off in one or two states depending if it's moving up or down.
Once you entered the new target RPM it continues to increase or decrease the PWM duty by one "tick"** each change delay until just after the RPM passes the target RPM mark, at which point it draws it back a tick and then stops changing.
** what a tick is depends on the resolution of the PWM.
The only downsides I can see to this method is probably taking more time to do the change, and potentially passing the mark for an instant before correcting itself.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Believe it or not I use to write dynamic positioning software that drove azimuth/bow thrusters, rudders and propellers and we heavily relied on PID algorithms. I use to write maritime vessel navigation software when I worked at Marine Technologies. I wrote both civilian and DoD navigation software systems.
My "instincts" tell me that what you are proposing might work for your "Laboratory setup". But you can get into situations where you are "chasing the error rate".
I know this might be hard to visualize but imagine you are on a school ground. You are on a playground swing, the person behind you pushes just 0.5 seconds after you reach the bottom of the swing.
It's that simple, you need to account for the error rate.
In fact most dynamic systems need a Kalman filter for higher accuracy.
Your 'dynamic system' is whatever Temperature gradient of the mass you are working with.
|
|
|
|
|
My lab actually is more demanding than my production, wherein with my lab I'm testing changes far more rapidly than will be made in my production environment.
I'm thinking if it's good enough to control PC style fans it should be able to drive fans that I only need to control in increments of minutes per change.
We'll see. I can plug PID into it if I have to, but I don't want to have to calibrate everything.
In fact it is nearly impossible for me to do so in the field since all the real world hardware is halfway 'round the world from me, and I need this code in place before the project's principal makes the trip over there.
If this part of the project fails in terms of the drop dead date for the above trip, it's not a show stopper, but it would be immensely helpful if it works.
To err is human. Fortune favors the monsters.
|
|
|
|
|
If you are working with AIR temperature you might have an measure of success.
I'm typing all this on my TV, pain in the ass, but it boils down to temperature gradient, I'm just a simple software engineer, my "job" was to take the math/physics these guys came up with and write it in C++
It's the 'laymen' and patent clerks that have to learn the physics.
Life sucked back then, I had to live in Egersund, Norway for a while, we had an office there.
|
|
|
|
|
Randor wrote: my "job" was to take the math/physics these guys came up with and write it in C++ I had a consulting job once that was like that. The scientist had written the math for the process we were implementing, and then 'C' code that (supposedly) implemented it. He originally insisted that I use his code as-is. Unfortunately it was really buggy, as he didn't quite understand how pointers and arrays were equivalent. I finally got him to show me the math, and between that and the code, I managed to write a version that actually worked.
Software Zen: delete this;
|
|
|
|
|
Randor wrote: PID algorithms Ye gods. You just triggered a flashback to my control systems class, decades ago.
Software Zen: delete this;
|
|
|
|
|
Yeah, this is what I was hoping to avoid because I want something you don't have to use a scope to tune.
I may be flying too close to the sun, as I've run into several problems with my approach so far, even with just measuring the RPMs, but I'm not ready to give it up yet.
To err is human. Fortune favors the monsters.
|
|
|
|
|
Do you have the PSU from your old computer? That has 12V DC outputs at reasonable amps, as well as 5V and often 3.3V
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Not at the moment, but even if I did, don't they have to be plugged into a mobo before they'll give you the time of day?
To err is human. Fortune favors the monsters.
|
|
|
|
|
No, not generally - they provide at least some power immediately. I use an old PSU as a 12 / 5 bench supply for testing odd gizmos from time to time.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
A good power supply is indispensable and are not all that expensive.
I've had one of these BK Precision 1660A Triple Output DC Power Supply | eBay[^] for about 10 years now and it's been solid. At the time they were all over ebay and around $100 but they seem to be scarce now.
PartsBin an Electronics Part Organizer - An updated version available!
JaxCoder.com
|
|
|
|
|
TOAUTO dc power supply $50 through Amazon but not currently (no pun intended) available. Works for me.
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
Yeah there are a ton of them on the market, and cheap. The only reason I bought the one I did is because it was a lab supply and knew it would be reliable.
PartsBin an Electronics Part Organizer - An updated version available!
JaxCoder.com
|
|
|
|
|
agree
"A little time, a little trouble, your better day"
Badfinger
|
|
|
|
|
And also when did it start appearing on Visual Studio.
|
|
|
|
|
It's the "Visual Studio Debug Console", and it's been there since the first release of VS (as "Visual Studio" - it was a part of it's predecessors, right the way back to "Visual C++" V 1.0, "Quick C For Windows", or even existed in a form in Quick C for DOS.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
|
I saw the recent ChatGPT answers that were recently posted here on codeproject.com and were subsequently deleted. I don't disagree with the judgement call.
Some of the answers were really good. At least one of the answers was 'more correct' than two other answers veteran members gave. I checked, I double checked.
What surprises me the most is the infancy of this technology. I'm not sure if I will be able to determine real people from computers here in the near future. Kinda worrisome.
In fact, the only reason they got caught is they answered like 20-30 questions on a wide range of topics in just an hour. If they would have submitted 1 answer per day along with chat/banter here in the Lounge they may have gone undetected.
I'm not even sure if it was ChatGPT, it was different. When I looked at how it was answering more correctly than our members, I think it was comprehending the question better than our members.
It was very verbose, gave a very accurate description of C/C++ semantics. I felt like I wanted to see more.
|
|
|
|
|
Some of it's text was very good indeed. But the code? It didn't compile, let alone work! It clearly had no idea of the rules of the software language it was "writing for", let alone how to code even in psuedocode.
And that's a very big part of development. I wasn't impressed with any of the code it produced.
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
The C++ code compiled (all the c++ answers at least), I didn't try the other languages. It's imperfect, but I'm not pointing out it's correctness, but my inability to determine if it's human.
It's something to be concerned about. It would have 100% fooled me if they didn't answer 30 questions in such a short period of time.
New technology, I am witnessing the birth of something that will change the world. I'm an expert in my field, it was difficult to see it was a computer. None of the C/C++ answers were wrong.
Didn't even look like pure ChatGPT. I suspected an AI researcher was testing the waters.
|
|
|
|
|
Randor wrote: Didn't even look like pure ChatGPT. I suspected an AI researcher was testing the waters.
If that is true, I would expect an ethical researcher to get permission from the subjects. Subject to Chris' cooperation, I'm sure that if we (collective 'we') were asked to participate in such an experiment, many of us would be willing to do so.
Designing a test that would work even with informed subjects isn't even very difficult; Alan Turing did so over 60 years ago.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
Yeah,
In case you haven't understood the Turing test the whole point is to trick humans.
|
|
|
|
|
ChatGPT (assuming it was ChatGPT) apparently excels at collection and summarization of ideas from various sources. It may even be better at that than some of CP's experienced members.
I have no technical issue with ChatGPT and its descendants taking over functions like QA. There may be a legal issue with whether collation and summarization of a subject constitute plagiarism, but - assuming ChatGPT avoids direct quotes - how does that differ from what a human expert does when he/she answers a question? Is silicon-based processing qualitatively different from carbon-based processing?
The above does not mean that ChatGPT would make a good developer / design engineer / architect. Leaving aside the issue of grammar and code correctness (i.e. does it even compile, let alone function as expected?), a good developer / design engineer / architect must be able to see how the various components of a system interact, and what would happen if those interactions were changed. He/she must also be capable of designing components that match a given set of criteria. These are rare enough abilities among humans, and I have yet to see any signs of their development in AI.
In fact, ChatGPT appears at present to be the epitome of the ivory-tower consultant - the one that has all the answers, but has never built a system in the real world. As long as this remains the case, I doubt that human developers have much to be worried about.
Freedom is the freedom to say that two plus two make four. If that is granted, all else follows.
-- 6079 Smith W.
|
|
|
|
|
I don't disagree with anything you wrote. I read it three times.
I would add "anytime soon", it's a complexity issue.
|
|
|
|