bitteritdown
Well-Known Member
- Joined
- Nov 12, 2017
- Messages
- 147
- Reaction score
- 41
Coding a control loop for step mashing.
The obvious is a PID loop.
How well does a basic loop work:
while true
delta = desired_temp - measured_temp;
if delta > 0
set ssr on
else
set ssr off
end if
delay 20ms
end while
Yes, thank you both, I thought as much but just needed verification from those who have gone before me.
It will be single vessel Brew In A Basket (solid walls), 5500w element, constant recirculation, temp probe on mash cap input (top side). Though I've been eyeing a two vessel system (HLT/boil kettle and BIAB mash tun).
that psuedo-code you have there is the P (proportional) part. It's a PID loop with I and D set to zero.
<ACADEMIC> Thats not exactly accurate, but you know that. There is no actual error calculated. </ACADEMIC>
?? delta is the error
delta = desired_temp - measured_temp;
Can better made SSR's handle a 20ms switch cycle? Does it shorten their life span? I would guess a normal PID implementation also switches faster as it approaches the set point (though not constantly like this bang-bang).
I would start by looking at the PID library in the arduino playground. It's simple implementation is easy to follow. I have modified it to add a max integral setting to limit the integral windup you get otherwise.Yes, absolutely agree that 20ms resolution for heating applications is unnecessary and won't provide a noticeable difference in performance. The output percentage / cycle time makes sense and gives me a hint as to how to code the entire PID algorithm.
Enter your email address to join: