Tobruk Posted July 22, 2018 Share Posted July 22, 2018 Hello everyone! I'm having problems with the design of a three-stage aquatuner project I'm building now. The stages are as follows: Pump polluted water to the aquatuner tank. Stop when full. Temperature rises above >90 degrees - proceed to the third stage. Pump water out. And then the cycle repeats. The first stage is relatively simple - see the schema: Now off to the second stage. The third stage is where I have the problem. What it should do is: Check if the water has been almost pumped out (<10 kg on the lowest tile) Stop the pump that pumps water out Start pumping in new polluted water up to the highest tile (>50 kg) But one of the problems is that the temp sensor may still show over 90 degrees, and so the pump will keep running, effectively stopping me from bringing fresh water in. In general, what I find problematic is keeping the pump disabled for the duration of the first stage after the cycle completes. How should you design the third stage? Any suggestions welcome Link to comment Share on other sites More sharing options...
Lilalaunekuh Posted July 22, 2018 Share Posted July 22, 2018 34 minutes ago, Tobruk said: In general, what I find problematic is keeping the pump disabled for the duration of the first stage after the cycle completes. If I can assume you know how big your water tank is, and I think you fill your tank at 10Kg polluted water / s, I would have at least 2 solutions: 1.) Use a And-gate to check the temperature just if your tank is filled (Highest tile above 50Kg) => Could result in some overheating, if you have not enough water to fill your tank (So I would recommend using the same logic to start the auquatuner just if your tank is full) 2.Use some tempshift plates and a buffer gate to have enough time that your temp sensor can cool down. Link to comment Share on other sites More sharing options...
TLW Posted July 22, 2018 Share Posted July 22, 2018 State machines, yo! Add another SR latch. >90 degrees SETs the latch, <10 kg RESETs the latch. Latch output goes to the pump. If you give a better description of exactly what you want I can help you better. Numbered list of states, what inputs cause states to switch, and what outputs each state has. So for instance: (Filling): [inlet on, pump off] high water off -> state 1. high water on -> state 2. (Waiting): [inlet off, pump off] temperature low -> state 2. temperature high -> state 3. (Draining): [inlet off, pump on] low water off -> state 3. low water on -> state 1. Link to comment Share on other sites More sharing options...
Tobruk Posted July 22, 2018 Author Share Posted July 22, 2018 4 minutes ago, TLW said: Add another SR latch. >90 degrees SETs the latch, <10 kg RESETs the latch. Latch output goes to the pump. If I understand it correctly, the machine in this setting would get barely above >10 kg, then the aquatuner would raise the temperature rapidly above 90 degrees, and the draining would commence. No time for filling the tank fully. 5 minutes ago, TLW said: f you give a better description of exactly what you want I can help you better. Numbered list of states, what inputs cause states to switch, and what outputs each state has. So for instance: I'll try, though I don't know exactly how to enumerate it in this manner. P.S If I use different names for similar states (i.e low water vs. high water) I'm using two different sensors). If I use OFF/ON nomenclature, I'm using one sensor that can give ACTIVE/STANDBY signals. Filling [inlet in, pump off, aquatuner off] 1. low water (<10) -> keep state 1 2. high water (>50) -> state 2 3. high temperature (>90) -> keep state 1 (important, because the temp sensor may otherwise activate the pump) Aquatuner operating [inlet off, pump off, aquatuner on] 1. high temperature ON (>90) -> state 3 2. high temperature OFF (<90) -> keep state 2 Draining [inlet off, pump on, aquatuner off] 1. low water (<10) -> state 1 2. high water (>50) -> keep state 3 3. high temperature (>90) -> keep state 3 (-||-) 23 minutes ago, Lilalaunekuh said: If I can assume you know how big your water tank is, and I think you fill your tank at 10Kg polluted water / s, I would have at least 2 solutions: 1.) Use a And-gate to check the temperature just if your tank is filled (Highest tile above 50Kg) => Could result in some overheating, if you have not enough water to fill your tank (So I would recommend using the same logic to start the auquatuner just if your tank is full) 2.Use some tempshift plates and a buffer gate to have enough time that your temp sensor can cool down. Something like that? Link to comment Share on other sites More sharing options...
TLW Posted July 22, 2018 Share Posted July 22, 2018 14 minutes ago, Tobruk said: If I understand it correctly, the machine in this setting would get barely above >10 kg, then the aquatuner would raise the temperature rapidly above 90 degrees, and the draining would commence. No time for filling the tank fully. Ah, I see now. You want it to completely fill first. Got it. 15 minutes ago, Tobruk said: P.S If I use different names for similar states (i.e low water vs. high water) I'm using two different sensors). If I use OFF/ON nomenclature, I'm using one sensor that can give ACTIVE/STANDBY signals. Sounds good. You have a high water sensor (on/off), a low water sensor (on/off), and a high temperature sensor (on/off). You have a number of ambiguities there (if you have a 'keep' and a 'go to state' which one takes priority?). Is this right? (X == 'don't care') Filling [inlet in, pump off, aquatuner off] if high temperature on, low water X, high water X keep state Filling (important, because the temp sensor may otherwise activate the pump) if high temperature off, low water on, high water on: <don't care> if high temperature off, low water off, high water on: goto Operating if high temperature off, low water on, high water off: keep state Filling if high temperature off, low water off, high water off: keep state Filling Aquatuner Operating [inlet off, pump off, aquatuner on] if high temperature on, low water X, high water X (>90) -> goto Draining if high temperature off, low water X, high water X (<90) -> keep state Operating Draining [inlet off, pump on, aquatuner off] if high temperature on, low water X, high water X -> keep state Draining if high temperature off, low water on, high water on: <don't care> if high temperature off, low water off, high water on: keep state Draining if high temperature off, low water on, high water off: goto state Filling if high temperature off, low water off, high water off: keep state Draining Link to comment Share on other sites More sharing options...
Tobruk Posted July 22, 2018 Author Share Posted July 22, 2018 10 minutes ago, TLW said: Is this right? Yes, the list of states seems ok to me. One thing I'd like to point out is that the high water and low water sensors cannot be active at the same time, because >50 on the highest tile and <10 on the lowest tile are mutually exclusive. 10 minutes ago, TLW said: (if you have a 'keep' and a 'go to state' which one takes priority?). I think "keep" just meant "ignore" to me, the way you mark it with X or "dont care". Link to comment Share on other sites More sharing options...
Tobruk Posted July 22, 2018 Author Share Posted July 22, 2018 2 hours ago, TLW said: Filling [inlet in, pump off, aquatuner off] if high temperature on, low water X, high water X keep state Filling (important, because the temp sensor may otherwise activate the pump) if high temperature off, low water on, high water on: <don't care> if high temperature off, low water off, high water on: goto Operating if high temperature off, low water on, high water off: keep state Filling if high temperature off, low water off, high water off: keep state Filling Aquatuner Operating [inlet off, pump off, aquatuner on] if high temperature on, low water X, high water X (>90) -> goto Draining if high temperature off, low water X, high water X (<90) -> keep state Operating Draining [inlet off, pump on, aquatuner off] if high temperature on, low water X, high water X -> keep state Draining if high temperature off, low water on, high water on: <don't care> if high temperature off, low water off, high water on: keep state Draining if high temperature off, low water on, high water off: goto state Filling if high temperature off, low water off, high water off: keep state Draining I think I have figured everything out. This project took me a whole day to crack, but it's more or less finished. This is the plan of the machine: The schema is fully functional and you can test it on this website: http://simulator.io/board/jBA0DN5HQz/41 Clicking the squares with "zeroes" activates them to "one" and they send an ACTIVE signal. Clicking them again disables them. Link to comment Share on other sites More sharing options...
sl4de Posted July 22, 2018 Share Posted July 22, 2018 2 hours ago, TLW said: Filling [inlet in, pump off, aquatuner off] if high temperature on, low water X, high water X keep state Filling (important, because the temp sensor may otherwise activate the pump) if high temperature off, low water on, high water on: <don't care> if high temperature off, low water off, high water on: goto Operating if high temperature off, low water on, high water off: keep state Filling if high temperature off, low water off, high water off: keep state Filling Aquatuner Operating [inlet off, pump off, aquatuner on] if high temperature on, low water X, high water X (>90) -> goto Draining if high temperature off, low water X, high water X (<90) -> keep state Operating Draining [inlet off, pump on, aquatuner off] if high temperature on, low water X, high water X -> keep state Draining if high temperature off, low water on, high water on: <don't care> if high temperature off, low water off, high water on: keep state Draining if high temperature off, low water on, high water off: goto state Filling if high temperature off, low water off, high water off: keep state Draining I recently played around with these things as well and after quick study of your states, I think I have a design to share. The bottom hydro sensor has to be set to "below", other two sensors are "above". One thing to keep in mind though is that it can take quite some time to completely drain and refill a tank of this size. If it is not okay for the aquatuner to shut down for a while whenever the tank has to be drained, this might be insufficient Link to comment Share on other sites More sharing options...
Sevio Posted July 22, 2018 Share Posted July 22, 2018 @Tobruk Is there a particular reason why you want it to run in stages rather than having a continous-flow system? Link to comment Share on other sites More sharing options...
Tobruk Posted July 22, 2018 Author Share Posted July 22, 2018 2 hours ago, Sevio said: @Tobruk Is there a particular reason why you want it to run in stages rather than having a continous-flow system? I'm trying a set-up with three liquid chambers. Therefore, I don't want to make the processes continuous, because it would be counterproductive. For example, water being cooled would be made hot again by incoming new supply. If, however, I divide the process into stages, water can be properly cooled, replaced, and cooled again, without each of the stages interrupting each other. Link to comment Share on other sites More sharing options...
TLW Posted July 22, 2018 Share Posted July 22, 2018 2 hours ago, sl4de said: I recently played around with these things as well and after quick study of your states, I think I have a design to share. The bottom hydro sensor has to be set to "below", other two sensors are "above". One thing to keep in mind though is that it can take quite some time to completely drain and refill a tank of this size. If it is not okay for the aquatuner to shut down for a while whenever the tank has to be drained, this might be insufficient This doesn't match the state diagram. This will turn on/off the aqua tuner based only on the high water level. Whereas the aqua turner should only turn off once the temperature raises too high. Link to comment Share on other sites More sharing options...
martosss Posted July 23, 2018 Share Posted July 23, 2018 Here's what I managed to cook, notice that it has not been tested, so it might need some tweaking, but the basic logic should be ok. state 1) water <10kg => start pumping => reach >50kg on top? => stop pumping and go to state 2) state 2) cool water => temperature above 90°? => go to state 3) state 3) empty tank => reach <10kg on bottom? => go to state 1) The idea is that you have 3 states, each controlled by a Memory gate(SR latch in your notation, I'll stick to the game terminology). A transition depends on the end condition of the previous state + inactivity of the following state. Therefore we have AND gate, connecting the reset condition "-1" + "NOT" active state "+1" Possible optimization should be the removal of those AND + NOT gates in case you don't need the extra condition that the 3rd state is not active(since it can't be for some reason, but I haven't thought about that, I leave it to you... or not ). OK, after some more gazing at it, I think I can conjecture that the AND-NOT gate is needed when the input-sensor can fluctuate( in out case temperature might change however it likes, starting state 3 randomly while state 1 is active. Therefore we need the AND-NOT gates between 2) and 3)(after 2) and before 3) ) that connect with the temperature sensor. We also need the AND-NOT gates between 1) and 2), since while 3) is pumping the water out, the water level in the beginning might still be >50 and turn on the aquatuner if we don't have them. However, we can remove the AND-NOT gates between 3) and 1), since water level won't fall below 10kg while the aquatuner is working(unless it evaporates all the water or the water leaks out from somewhere .. which shouldn't happen ) Also optimization of the gate positioning might be necessary, I tried ordering them, but .. they're quite spacious. The thing I'm not exactly sure about is the signal switching speed. It seems it takes some time for signals to propagate and I think that might cause problems in some cases. However, I think this setup should be solid regarding that and even without the top AND-NOT gates(just attach the "<10?" sensor directly to the input of the 1st memory gate and remove excess cables between 1) and 2) on the right). I hope that helps. P.S. Forgot to upload the picture! Here it is! Link to comment Share on other sites More sharing options...
Tobruk Posted July 23, 2018 Author Share Posted July 23, 2018 5 hours ago, martosss said: I have tested your design and it works wonderfully! Definitely better than what I designed. Hats off to you EDIT: If anyone wants to test it before committing to it in ONI, here's the interactive version: https://simulator.io/board/bgsB8tHqK9/1 Link to comment Share on other sites More sharing options...
BlueLance Posted July 23, 2018 Share Posted July 23, 2018 I am not sure if you wanted only a room sized solution, but if you had 3 rooms you could do the same job without having to wait for the room to fill/empty. I just have 3 rooms, all the same size, the top one fills with water and drops the contents to the middle room which has the aquatuner, when the middle room is full a door closes stopping more water from entering. when the water gets too hot it drops into the third chamber, the chamber door closes and the top chamber which should be full again drops its contents into the second chamber. Chamber 1 fills constantly until it is full. Chamber 1 dumps its contents into chamber 2 Chamber 2 runs until it gets too hot (115 degrees for me) Chamber 2 dumps its contents into chamber 3 Repeat stages 2-4 Link to comment Share on other sites More sharing options...
sl4de Posted July 23, 2018 Share Posted July 23, 2018 19 hours ago, TLW said: This doesn't match the state diagram. This will turn on/off the aqua tuner based only on the high water level. Whereas the aqua turner should only turn off once the temperature raises too high. This is absolutely true when looking at the logic, however my reasoning is that turning on the draining pump (which also blocks the inlet) will result in the high water level sensor turning off. Therefore turning on the pump when temp gets too hot will indirectly disable the aquatuner. And it will stay disabled until the tank is first completely drained and then completely filled again, as in the state diagram. Im aware there might be some seconds of delay before the aquatuner shuts off, also if coolant escapes the tank for any reason it will stop until the tank is filled again. So you are right that this does not match the state diagram. From a practical standpoint however i consider this a neat optimization to save some gates which i wanted to share. Link to comment Share on other sites More sharing options...
martosss Posted July 23, 2018 Share Posted July 23, 2018 7 hours ago, BlueLance said: I am not sure if you wanted only a room sized solution, but if you had 3 rooms you could do the same job without having to wait for the room to fill/empty. I just have 3 rooms, all the same size, the top one fills with water and drops the contents to the middle room which has the aquatuner, when the middle room is full a door closes stopping more water from entering. when the water gets too hot it drops into the third chamber, the chamber door closes and the top chamber which should be full again drops its contents into the second chamber. Chamber 1 fills constantly until it is full. Chamber 1 dumps its contents into chamber 2 Chamber 2 runs until it gets too hot (115 degrees for me) Chamber 2 dumps its contents into chamber 3 Repeat stages 2-4 You also have to make sure that chamber 3 doesn't overflow and that chamber 1 has enough water. Other than that it might be much faster and cheaper this way than with using 2 water pumps. However, my logic setup should be the same, just change the liquid shutoff and water pump with a door. On 7/22/2018 at 10:07 PM, sl4de said: I recently played around with these things as well and after quick study of your states, I think I have a design to share. The bottom hydro sensor has to be set to "below", other two sensors are "above". One thing to keep in mind though is that it can take quite some time to completely drain and refill a tank of this size. If it is not okay for the aquatuner to shut down for a while whenever the tank has to be drained, this might be insufficient Looking at your solution now, it is optimized logically very well, so I'd use that if I was the OP. Moreover, you can further combine it with BlueLance's suggestion and use a door instead of the water pump / water shutoff in case of additional rooms below / above where you store hot/cool water. Link to comment Share on other sites More sharing options...
BlueLance Posted September 11, 2018 Share Posted September 11, 2018 Why not use a three room system stacked vertically, Top room is filling tank, middle is aquatuner tank and bottom is pumping tank. 1st tank is always filling, second will empty via a door into the third tank once temperature reaches the specified amount. Once the second tank is emptied and door closes the first tank dumps its water into it via a door. Link to comment Share on other sites More sharing options...
Tobruk Posted September 11, 2018 Author Share Posted September 11, 2018 4 minutes ago, BlueLance said: Why not use a three room system stacked vertically, Top room is filling tank, middle is aquatuner tank and bottom is pumping tank. 1st tank is always filling, second will empty via a door into the third tank once temperature reaches the specified amount. Once the second tank is emptied and door closes the first tank dumps its water into it via a door. Yes, that was suggested and I think it's a very clever approach, but I'm going for the stages just for the sake of it Link to comment Share on other sites More sharing options...
NanoD Posted September 11, 2018 Share Posted September 11, 2018 I am not sure if you were thinking about this kinda of set up. I have lower chamber that will cool down the liquid while it is cooling, the upper chamber is filling up with new liquid. And when it is cool enuf it will start to pump out and when that is done the upper chamber will dump the liquid down. Link to comment Share on other sites More sharing options...
BlueLance Posted September 12, 2018 Share Posted September 12, 2018 On 11/09/2018 at 9:47 AM, Tobruk said: Yes, that was suggested and I think it's a very clever approach, but I'm going for the stages just for the sake of it I was the one who suggested it but I do not know why i said it twice in two separate ways haha Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.