【发布时间】:2019-03-24 16:54:15
【问题描述】:
我目前正在使用 arduino 开发水流控制系统。目标是我可以使用 arduino 设置水流的温度。
我有一个 Y 形的软管部分。在 Y 形件的左上臂上,我有恒定的冷水流,大约 12°C。在 Y 件的右上臂上,我有一个阀门,我可以用它来调节我混合的热水量。热水温度约为 50°C。为了调节热水的摄入量,我使用了伺服电机,它将阀门转动到某个位置。 在 Y 的下部,我有一个温度传感器,它告诉我水的混合温度。
我想出的将水混合到特定温度的算法如下所示:
1. Calibrate by calculating the minimum and maximum temp and corresponding servo positions
1.1 set the servo position to the absolute minimum, wait for 10 seconds and get the temperature -> minTemperature, minPos
1.2 set the servo position to the absolute maximum, wait for 10 seconds and get the temperature -> maxTemperature, maxPos
2. Set the mixing temperature to X°C
2.1 (maxTemp-minTemp)/(maxPos-minPos) = p °C/pos
Which means that changing the position by 1 position changes the mix temperature by p °C
2.2 minPos + (x-minTemp) / p = targetPos
3. If abs(measuredTemp-x)>Tolerance than do 2.
当涉及到现实生活中的实施时,这种方法是否可行?其他的热调节电路是怎么做的?
【问题讨论】:
-
看起来PID 是你想要的。不要期望整个伺服位置范围内的比例。
标签: algorithm arduino temperature