<p>I built a smart kegarator that tracks temperatures and controls the compressor to provide very tight temperature control, all written in go (and some javascript for the web interface). The system allows you to set a temperature range for a number of sensors and ensure that your beers are at the perfect temperature. It also tracks when the compressor is on and provides a total run time with cost estimate (you have to provide your cooler power draw in watts and your power cost in cents per KW/h).</p>
<p><a href="https://github.com/traetox/kegarator">https://github.com/traetox/kegarator</a></p>
<p>The whole system is one '!' away from controlling a heater (distillery), so if you are interested in rigging it in that direction let me know.</p>
<hr/>**评论:**<br/><br/>41xx: <pre><p>This is fantastic! I didn't think that Go was designed for embedded systems. What hardware are you running this on? Any chance of writing up the full build?</p></pre>Manbeardo: <pre><p>The README.md on the Github page lists the hardware it's running on:</p>
<ul>
<li>Raspberry Pi</li>
<li>Some temp sensors</li>
<li>An SSR kit from sparkfun</li>
<li>A standard chest freezer</li>
</ul></pre>adampresley: <pre><p>That is pretty dang cool.</p></pre>john10x: <pre><p>Nice! I would be interested in controlling heating for brewing ales.
It does seem though that the modulation of the temperature could be more closely controlled. Doesn't it just fluctuate between the minimum and maximum which is a fairly wide range. Can you develop some system where it tunes itself to a target more closely based on the rate the temperature changes over time? Say for example it takes 1 minute for the temp to drop 1C with the compressor on and 5 minutes for the temp to rise 1C with the compressor off, you could set a time for the compressor to run based on how far away it is from the desired temp, and then a minimum amount of time for the compressor to be off. This would allow a very tight bound without cycling the compressor too much.</p></pre>traetox: <pre><p>You are one 100% correct, I am actively building that system out now. The tricky part for me is detecting when it needs to "break out" of the algorithm on rapid temperature changes (this happens when I open the freezer door to change out a keg or grab a can). I am also trying to weigh the impact of short rapid compressor engagements. The short periodic starts aren't a problem for a burner, but its not awesome for a compressor.</p>
<p>My genetic algorithm experience doesn't go much beyond a single course in school and some reading, so if you know of some good prior work throw it my way.</p></pre>jeffrallen: <pre><p>Before you go all genetic on this thing, use what fridges already use, PID controllers. See godrone.io for a PID controller you can look at.</p></pre>traetox: <pre><p>Well when you provide some such a simple and well proven system for this problem it makes me sad. I kind of want to go all rube goldberg on this thing, but I suppose a PID would be a much better idea. Thanks for the tip.</p></pre>Rudd-X: <pre><p>Not so fast. Wait till you have to tune it.</p>
<p>And, also, you will need to incorporate hysteresis elements in order not to destroy your compressor. Perhaps you'll feed the sensed temperature to the hysteresis algorithm and use its output to feed the PID but that destroys the advantage of the PID. Perhaps you'll feed the output of the PID into the hysteresis algorithm and use its output as a signal to control the compressor. In the end you must reduce the output of the PID to start/stop (and hold) signals.</p>
<p>Really up to you, but decisions, decisions, make sure to plot the behaviors under several scenarios and include the scenario where you open the fridge door. </p>
<p><em>But</em>, at least you will save a monstrous amount of work. And your contractee / employer will thank you for it.</p>
<p>Fascinating nonetheless.</p></pre>
这是一个分享于 的资源,其中的信息可能已经有所发展或是发生改变。
入群交流(和以上内容无关):加入Go大咖交流群,或添加微信:liuxiaoyan-s 备注:入群;或加QQ群:692541889
- 请尽量让自己的回复能够对别人有帮助
- 支持 Markdown 格式, **粗体**、~~删除线~~、
`单行代码`
- 支持 @ 本站用户;支持表情(输入 : 提示),见 Emoji cheat sheet
- 图片支持拖拽、截图粘贴等方式上传