How to fill a bath
By Dermot Tynan, over 6 years ago.
It seems straightforward enough to fill a bath. We know how to do it instinctively, but how do we program a computer to do it?
Let’s start with some assumptions. Assume we have a hot and cold tap, and we can control the flow on each tap. Also assume we can measure the average temperature of the water in the bath tub. Finally, assume we can measure the height of water in the bath. This last one is so we know when we’re done.
We’ll denote t as the measured temperature and l as the measured height of water. For that matter, we can refer to h as the amount of hot water, where 0.0 ≤ h ≤ 1.0 and c as the amount of cold water, again in the range 0.0 ≤ c ≤ 1.0.
Ultimately, we’re going to use a PID Controller to do the actual hard work of adjusting the taps. But before we get into that, we need to refine our equations just a bit, and also learn how to walk before we try to start running. (See what I did there? Running? Bath? Oh, never mind).
Upcoming Missions
- Galway Bay Loop, Waiting for Vessel Availability
Search
Recent Posts
- May 2023 (1 post)
- April 2023 (1 post)
- March 2023 (1 post)
- February 2023 (2 posts)
- March 2022 (3 posts)
- March 2021 (1 post)
- August 2020 (1 post)
- May 2019 (1 post)
- April 2018 (1 post)
- November 2017 (1 post)
- April 2017 (1 post)
- November 2016 (1 post)
- September 2016 (1 post)
- August 2016 (1 post)
- January 2014 (2 posts)
- October 2013 (7 posts)
- September 2013 (1 post)
- August 2013 (3 posts)
- June 2013 (3 posts)
- May 2013 (4 posts)
- April 2013 (3 posts)
- March 2013 (9 posts)
- February 2013 (8 posts)