[Git][NTPsec/ntpsec][master] makeheat: add some proportionality to the controller

Gary E. Miller gitlab at mg.gitlab.com
Wed Feb 1 22:19:06 UTC 2017


Gary E. Miller pushed to branch master at NTPsec / ntpsec


Commits:
65437cdf by Gary E. Miller at 2017-02-01T14:18:41-08:00
makeheat: add some proportionality to the controller

Funny thing, short sleep() uses as much power as computing md5!

- - - - -


1 changed file:

- contrib/makeheat


Changes:

=====================================
contrib/makeheat
=====================================
--- a/contrib/makeheat
+++ b/contrib/makeheat
@@ -26,7 +26,7 @@ parser.add_argument('-t', '--temp',
                     nargs=1,
                     type=float)
 parser.add_argument('-w', '--wait',
-                    default=[0.001],
+                    default=[0.01],
                     dest='wait',
                     help="Set delay time in seconds, default is 0.1",
                     nargs=1,
@@ -47,12 +47,14 @@ temp_gate = args.target_temp[0] - 0.6
 
 while True:
     # on a RasPi 3, 200,000 of the m.update() can be one second
-    if temp_gate > temp:
+    delta  = temp_gate - temp
+    if 0 < delta:
+        # heat it up
         m.update("Nobody inspects the spammish repetition")
     else:
         cnt = max_cnt
         # cools off slower than it heats up.
-        time.sleep(args.wait[0] * 8)
+        time.sleep(args.wait[0] * 20.0 * -delta)
 
     cnt += 1
     # read the temperature every max_cnt



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/65437cdf789a49daab78d377a7d3be17dfec7571
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ntpsec.org/pipermail/vc/attachments/20170201/ef891c8d/attachment.html>


More information about the vc mailing list