The Arduino Opta has mechanical relays on the digital outputs. I have decided to add a minimum on and off time (beyond which the heater locks on or off) to my pulse width modulation call for heat. This reduces unecessary wear, iritating noise, and ensures the relay contacts fully open and close at either edge of an off or on section during the period. This prevents ranges of duty being used that are too low or too high for the relays to effectively make or break contact. The end result will be that the power output is smoothly controllable from dutys of for instance 0.1 and 0.9 but anything lower than 0.1 latches the heater off and larger than 0.9 latches it on.
The period for the pulse width control is adjusted to be as large as possible without observing significant oscillation with low duty cycles in the reported temperature when monitored on debug.
Question 1: (finally!) As the PID controller moves through these 0.0 to 0.1 or 0.9 to 1.0 ranges is the PID controller likely to 'wind up' and behave oddly, or is that only likely to occur if the perfect duty for a settled system lies close to these ranges?
Question 2: With the above in mind is it worth having the controller lock the heating on or off until the reported temperature is within a specific range of the set point and then using PID control? ...or is the same achieved by adjusting the points in the 0-1 duty range where the controller changes from continuously (within reason) variable to descrete?
Feel free to point me towards some reading. It's been ~26 years since I looked at PID control in my degree, and don't remember going into much depth!
Footnote: This is an learning exercise rather than a customer project. While the Opta's relays are quick just assume that they are clunky slow relays or simply that buzzing relays is irritating and likely to kill them faster!
Hi @wesbrooks. I don't have answers for your questions, but you may find the terms "deadband" and "hysteresis" to be useful keywords to include in searches when researching the subject.
You are welcome. I happen to be familiar with these terms through my experience using commercial temperature controllers with glass annealing kilns during a former career as a glassblower. The relays I was working with could definitely be described as "clunky" .
Glass blowing - a topic close to home: St Helens UK.
Ironically I've been watching their glass blowing demos wondering why they couldn't use a variable flame on the gas kilns. Guess single strength flame is just cheaper, easier, and requires less complex emissions control and correction.
Solid state devices (including MOSFETs) have the disadvantage that a failure mode is failed closed, so for safety you tend to need a mechanical relay/contactor anyway to enable/disable the heater unless it is a very under powered heater (like this one on the DIN celcius board) that is intrinsically safe. In other words it is highly unlikely to cause any failiures if locked on at 100% duty indefinitely.
A lot of cheap 3D printers miss this out and it's part of the reason you hear of extrusion printer fires.
All that said a high power heater in a system with little thermal mass could be very responsive and benefit from, or perhaps need solid state control.
Anyway this is digressing from my original questions where I stated this was a learning exercise. I am interested in what to do about the deadbands at either end of the duty range, or if the PID controllers typically handle it well in cases where relays are used with suitable period and minimum on/off times to avoid chattering.
Since you did not give us details on the heater I will take a SWAG and assume it is line powered. I would use a commercial AC solid state relay, they are not that expensive and are very reliable. As for safety do it the mechanical way and use a proper bi metal heat sensitive switch.
I am not asking for circuit advice here. I want to know about best practice for the design of PID controllers. I have used the relays as an example where there are deadbands in the range.
That's great, thanks. I was begining to feel like the controller had a hand tied behind it's back. The temerature reading for example lags what's really happening, and theres x amount of time averaging which makes the reading even further from reality.