- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我目前正在使用 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.
当涉及到现实生活中的实现时,这种方法是否可行?其他热调节电路是怎么做的?
最佳答案
这基本上可以工作,但是您应该解决几个问题:
伺服位置和温度之间的关系不会是线性的。至少在 4 个不同位置进行校准并拟合三次多项式。
因为阀门有很大的摩擦力,而且现成的伺服系统中的定位算法并不出色,所以当您命令从较低位置移动到位置“X”时,它到达的位置是当您命令从更高位置移动到相同位置“X”时,它到达的位置不同。您应该针对升温和降温校准不同的曲线,并确保您命令的运动缓慢接近所需温度,以获得可重复的结果。
根据校准曲线到达正确位置后,如果温度不合适,您可以慢慢朝它移动并调整校准。您可能想假设错误来自输入温度的差异并相应地进行调整。
关于algorithm - 温度调节电路Arduino,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55326201/
我有一个骨架化的体素结构,如下所示: 实际结构比这个例子大很多有没有办法找到结构中的闭环?我尝试将其转换为图形并使用基于图形的方法,但它们都存在图形没有节点位置的空间信息的问题,因此图形可以具有多个同
我正在尝试使用 Stem 启动 Tor 连接,然后列出所选的节点。 使用他们网站上的其他问题和常见问题解答,我可以做其中之一,但不能同时做。 例如,我可以启动一个 Tor 电路 tor_proce
问题如下:考虑三个输入 A、B、C,找到一个带有 AND、OR 和 NOT 门的 bool 电路,使得输出不是(A),不是(B),不是(C),最多使用 2 个 NOT盖茨。 我想用prolog找到电路
我连接了两个按钮和五个 LED。在电路中它的顺序是按钮,五个LED和按钮。 LED 的顺序从左到右(从第一个按钮开始)红色、绿色、蓝色、绿色和红色。我使用蓝色(中间)LED 来区分左侧和右侧。按下左按
我是一名优秀的程序员,十分优秀!