Yeah, I mean making a PID out of the arduino, something that can do proper control loops. A simple on/off control when it hits a particular temperature, while it might work, isn't going to be great, and certainly will not be a greater product than a proper PID, or something fancier than a PID.
On/off style control, if you graphed the temperature, it wouldn't be a stable straight line at that temperature, rather it'd be a big oscillation, as it would turn the heater on as the temperature drops below the set value, and only turn off once it's passed it. A PID will more accurately predict the change that the heater will make to the temperature and will basically kind of "pulsate" the heater on and off just the right amount to keep it stable.
For PID's, the PID actually stands for the 3 parameters that are used to adjust for the curves of the loop, as well as basically to set the responsiveness to the heater, so it basically knows just how much heat to apply for a given temperature differential. To write that code, I'd need a much better understanding of calculus I'm afraid, but I am now better starting to understand some of the principals behind it. I would almost think someone must have written PID code for arduino already though, it just seems far too common of a use case, given the arduino is practically a PLC to begin with.
The hard part about PID programming is trying to account for unexpected occurrences in your otherwise normal heating/heat-loss loop. In our use cases, that's basically taking a dab. There's going to be a typical amount of heat loss to the environment that the PID is normally accounting for to keep it stable, so to further account for the addition instability of taking a dab may mean making the whole process slightly more unstable, to account for that shorter period of instability, all the while keeping the average stability within reason. It's a balancing act, essentially.
The next kind of PID beyond the traditional 3-value PID controllers are fuzzy-logic based PID's. That's a whole different game that I've barely even got into reading about, but the notion of fuzzy logic is that it can better predict what to do when something unexpected happens.
http://www.mstarlabs.com/control/fuzzypid.html
Haha, I like this quote from that article
"We intend to show that, given any well-tuned PID controller, it is always possible to configure a fuzzy logic controller that is
no more complex, but
never less effective. (There you go, a carefully worded claim that is
at least as misleading as the hype that you will find in the trade mags, as we will soon show.) If a PID controller's performance is not quite acceptable, perhaps this can serve as a first step toward performance improvements."
Basically, it's hard for fuzzy logic to be any worse than a PID, and at best, it can be a lot better. It's all just different algorithms for trying to keep that line on the graph straight as an arrow.
Needless to say, if someone wants to spend $500-600 on a enail, I could build one with an off-the-shelf fuzzy logic controller in it, they are literally $250-300 for the PID alone. It's probably the main reason that as far as I know, no one has done it yet. There's a few companies using $100-150 PID's, but they are often really no better than a $35 one when it comes to the internal PID algorithms being used to control the heat. And in my case, the fuzzy logic controllers that did have those fancier algorithms were just too expensive to justify, even for my own amusement, but if we could do something with an arduino for a lot cheaper, well, that's a really interesting proposal all of the sudden....
Also worth noting, some of these more expensive PID's do support things like multiple profiles, the one I have used in my controller, which cost around $85, has this feature in fact. I'd just be happy to come up with one single set of values I'm happy with! I'm realizing that each nail and coil can sort of have their own sweet spots, so I need to find that "middle ground" so to speak. The possibility to have a separate "barrel coil" profile and a "flat coil" profile may result in slightly more stable temperatures profiles for each.
As far as I know, most of these types of probes are basically just resistance-based, measuring the resistance through a piece of wire kind of thing. There is likely a formula and/or big chart of known values for a given temperature, I suspect this would be easier to do than you think, although there may possibly need to be some circuitry around it to convert it to values that are usable to the arduino. I have no doubt I could make that work and convert the values to something usable to the code, I'd be much more concerned about the control loop logic side of things, while I am a programmer, I am not an expert at calculus.
I'd probably still prefer to use a solid state relay unless there's a reason to directly use the arduino to switch it? Do the arduinos have a built in relay or something? The nice thing about SSR's is they're optically isolated and have no mechanical parts. Also, with traditional PID based controllers, it's often flipping the coil on and off constantly, you wouldn't want to use a traditionally magnetic relay as it would likely wear out extremely fast with that sort of use.
Phew, that was long, I hope that all made sense.
Some brand new (to me) knowledge that hopefully I'm not botching:
Any thermocouple will provide a given difference in voltage per degree celsius between it's hot and cold contacts. The Arduino does the math to interpret the data as temp (simple arithmetic) and the PID logic (calculus?) for prediction/compensation feedback. You can change the thermocouple type by changing one factor in the math. I think the K type is 30mv per degree or something.
The AD595 chip ($6-$10 on aliexpress) converts the thermocouple's voltage to 5v and viceversa for communication with the arduino and provides cold compensation (otherwise any cold side temp fluctuation will affect accuracy). There's more than one solution for this, but this is out of my league so I don't know how to generate them. One is mentioned
here. I'm Laughmore, double posted to try to keep the thread alive.. oh well.
If "cold side" is an unfamiliar term, the wiki on thermocouples can explain it better than me. Ready-made PID controllers take care of it so the concept is off the radar of enail DIYers I think, I'm only barely learning about it now.
Sounds like you and I have been learning about similar stuff lately....
I knew those probes had some set variance of voltage or resistance per-degree or something like that! I hadn't bothered to look it up yet, but I was pretty sure it followed some fairly simple formula that wouldn't be too hard to convert one way or another. It figures someone's already made a thing to attach directly to the arduino, they've probably been used to do this many times over already in other applications.
The real question now is whether there's code out there to do anything fancier than simple PID style control, like a fuzzy logic algorithm or etc....otherwise we'd just be re-inventing the wheel and building glorified PID's out of arduinos, which, might give you some cool extra features, like shut off timers and dab counters, but probably isn't going to really change how it performs in terms of keeping the temperature more stable than any other sub-$200 PID. You only get into fuzzy logic PID's once you seem to pass that $200-300 price tag on the PID itself, and I've still yet to see an enail manufacturer use one, I imagine the cost for the fuzzy logic controllers are just prohibitively expensive, and I imagine such a product would cost atleast $600...If we can do that with an arduino at a fraction of the cost, then I think it's a huge game changer.