Best suited feedback mechanism for motorized gate valve.

Thread Starter

Electrodood

Joined Aug 31, 2023
23
Hi, I landed on the simple design below for motorising a gate valve after complex iterations.
Screenshot 2025-01-16 224944.pngWhatsApp Image 2025-01-16 at 22.50.16_abb1426f.jpgI need a feedback for when the valve is open/closed. I know that I can use an optical sensor or a rotary encoder along with a microcontroller but I guess that might be overkill. It is not about the cost, I could set up an stm8s003f3p6 for less than 0.50 US dollars, but I think may be overlooking a simple solution. The main problem is that I am using a DC motor w/o inbuilt feedback, I want to keep it that way so it is easier to replace with whatever motor that is available down the road when this breaks. The valve needs about 6.5 revolutions to open/close.

I welcome any criticisms to improve my design. Thanks in advance.
FYI the motor rpm is 30 and the gear ratio is 2:1
 

ronsimpson

Joined Oct 7, 2019
4,645
I have drilled a hole in the large gear or add an arm, or bump.
Use a lever switch to close at the hold or bump.
1737048762688.png
There are many kinds of switches like this. This one has a wheel on the end. Some are flat.
1737048776313.png
Now I see you need to measure 6.5 turns.
In my car there is a gear with a notch cut into it (see red lines). The notch goes around the center 7 times. There is a finger that is in the ditch and senses when the finger is at turn1 or turn 6.5.
1737049399874.png
 

WBahn

Joined Mar 31, 2012
32,702
Hi, I landed on the simple design below for motorising a gate valve after complex iterations.
View attachment 340503View attachment 340504I need a feedback for when the valve is open/closed. I know that I can use an optical sensor or a rotary encoder along with a microcontroller but I guess that might be overkill. It is not about the cost, I could set up an stm8s003f3p6 for less than 0.50 US dollars, but I think may be overlooking a simple solution. The main problem is that I am using a DC motor w/o inbuilt feedback, I want to keep it that way so it is easier to replace with whatever motor that is available down the road when this breaks. The valve needs about 6.5 revolutions to open/close.

I welcome any criticisms to improve my design. Thanks in advance.
FYI the motor rpm is 30 and the gear ratio is 2:1
How bad is it if the valve doesn't get closed completely? By basing things on the number of revolutions, you risk just "almost" closing the valve.

What happens if the motor attempts to go beyond what is needed to open/close the valve? Specifically, do bad things happen like things breaking? If not, is it possible to sense the increased torque associated with the point at which the valve reaches the end of its travel?
 

MisterBill2

Joined Jan 23, 2018
27,159
Add another bump or two and have them hit a switch twice per revolution. It is a DC motor so you know which way you are telling it to go. So now you have half turn position resolution.
 

WBahn

Joined Mar 31, 2012
32,702
You could watch the current in the motor. At the end the current gets very high.
That was my first thought, but he says he wants to be able to change out the motor with whatever's available, presumably without having to then go and readjust his sensing system. I suppose one possibility is to detect with the valve step stops moving.
 

LesJones

Joined Jan 8, 2017
4,511
Add a further reduction pair of gears (Or toothed belt.) with a ratio of about 8 : 1 so that this gear does a bit less than 1 revolution for the 6.5 revolutions of the gate valve. You could then pot a disk with a notch in it. This notch could actuate two limit micro switches.

Les.
 

WBahn

Joined Mar 31, 2012
32,702
Add a further reduction pair of gears (Or toothed belt.) with a ratio of about 8 : 1 so that this gear does a bit less than 1 revolution for the 6.5 revolutions of the gate valve. You could then pot a disk with a notch in it. This notch could actuate two limit micro switches.

Les.
And if the valve ends up needing 6.4 or 6.6 revolutions to close?
 

MisterBill2

Joined Jan 23, 2018
27,159
What it gets down to is first, how accurate does it need to be, and second, how much effort or expese is tyhe TS willing to invest. The spiral slot could be quite accurate and have good resolution, but it will take some serious effort.
 

Thread Starter

Electrodood

Joined Aug 31, 2023
23
How bad is it if the valve doesn't get closed completely? By basing things on the number of revolutions, you risk just "almost" closing the valve.

What happens if the motor attempts to go beyond what is needed to open/close the valve? Specifically, do bad things happen like things breaking? If not, is it possible to sense the increased torque associated with the point at which the valve reaches the end of its travel?
Really good question, I should have answered it in the original post.
This is for selecting which overhead tank the pump should send water to, so it does not need a tight seal. Half a turn results in about 10th of the opening distance. If we necessarily had to do ± 0.5 revolutions, I believe we can accommodate that, but anything more than that is not possible.
The motor stalls and stops after fully opened/closed position. Ill see of the motor draws more current when it stalls. Do let me know if there are other ways to detect this stalling behaviour.

Also, I should have said this too, but I only need open and close positions. I don't need partial open positions.

Thanks a bunch
 

Thread Starter

Electrodood

Joined Aug 31, 2023
23
You could watch the current in the motor. At the end the current gets very high.
I just measured it. Normally it draws around 70mA at 11.35 volts. When it stalls however it draws 600mA. This could be a good indicator i assume. But as WBahn pointed out it may not be good when the motor eventually breaks down and I need to replace it. But it all depends on how hard it would be to recalibrate the current sensor as I have no prior experience with it. I need about 6 of these and I think it will help going with a microcontroller as I could use it to detect failure modes such as current not peaking in an average preset interval.
How should I go about measuring the current to the motor?
Thanks
 

Sensacell

Joined Jun 19, 2012
3,767
Measuring the motor current is sketchy for the following reason:

The current only increases AFTER the energy stored in the rotating mass of the motor has been dumped into the gear train, it's too late then.
The gears will be loaded up (jammed) with a torque that can be much higher than the stall torque of the motor, - you cannot un-jam it using the motor alone.

Consider a 10 turn analog pot, for rough "which turn am I in now?" positioning, along with a cam switch for final positioning.

This setup could recover from a power outage in the middle of a cycle, which a simple switch could not- you would never know which turn you are lost in.
 

crutschow

Joined Mar 14, 2008
38,316
How should I go about measuring the current to the motor?
Put a small resistor in series with the motor return current to ground and measure the voltage across it with the A/D converter in a micro.
For example a 5Ω resistor would give 0.35V at the 70mA run current, and 3V at the 600mA stall current.
What is the motor operating voltage?

Will you be using a bridge connection to reverse the motor direction?
 

WBahn

Joined Mar 31, 2012
32,702
I just measured it. Normally it draws around 70mA at 11.35 volts. When it stalls however it draws 600mA. This could be a good indicator i assume. But as WBahn pointed out it may not be good when the motor eventually breaks down and I need to replace it. But it all depends on how hard it would be to recalibrate the current sensor as I have no prior experience with it. I need about 6 of these and I think it will help going with a microcontroller as I could use it to detect failure modes such as current not peaking in an average preset interval.
How should I go about measuring the current to the motor?
Thanks
You can use a current sense resistor, probably in the low side (between the motor and "ground"). To allow for future motor replacements (within reason), you can have the MCU record the nominal and max current, perhaps in a calibration mode that is activated by a switch (pushbutton) when a new motor is put in. You need a micro that has nonvolatile memory, but those are all over the place these days.

But one thing to be careful about (and test to be sure), if the motor stalls, it's because it applied its maximum amount of torque to the valve, which means that it tightened it that hard. So how much torque is then needed to break it loose? If it needs any more torque than what the motor can deliver under stall conditions, the motor will stall just trying to break it free. One way to handle this would be to limit the current profile so that full current is available at the beginning of the motion and then only a fraction of that, perhaps 1/3 of stall current or 3x of normal running current, for the rest of that cycle.
 

WBahn

Joined Mar 31, 2012
32,702
@Electrodood : Is there any reason why it has to be a gate valve, given that you are only interested in on and off?

Why can't you just use a solenoid valve (they make latching valves that only need to be powered when changing state, but I think they are quite a bit more expensive)?

Or use a ball valve, which only requires a 90° turn and reaches full-on and full-off a bit before the stops so that you can set your system to move the handle just far enough without hitting the stop.

Also, this type of valve is going to be pretty immune to jamming so that you can use your motor to full stall and still be able to move it the other way (as long as the full stall torque isn't enough to physically damage the valve).
 

Ya’akov

Joined Jan 27, 2019
10,226
Or use a ball valve, which only requires a 90° turn and reaches full-on and full-off a bit before the stops so that you can set your system to move the handle just far enough without hitting the stop.
Ball valves are my friend, and together we hate gate valves. (Of course there are applications where gate valves are king, but none of them happen around my house.) Unless the valve is very large, the ball valve will show you that it I possible to have plumbing that doesn't make you want to... do bad things.

The other advantage of the ball valve is the ease with which it is possible to buffer actuation with a simple spring. Combined with current sensing, it should just work for a long time.
 

LesJones

Joined Jan 8, 2017
4,511
Another possible method to detect tha motor stalling is to mount the motor on bearings (One on each end.) and use springs to prevent the motor rorating. Use micro switches to detect when the motor moves too far against the spring restraint.
I have used the current detection method to detect the end of travel when opening and closing curtains. This has worked for more than 10 years without any problems.
This is the schematic of the unit. It uses a PIC16F84 but almost any microcontroller could be used.

CurtainSch.jpg

The current limit is detected by sensing the voltage across low value resistors and comaparing this with a voltage set by a potentiometer so it is easy to change the setting. The code also limits the time allowed to reduce the risk of burning out the motors. The above schematic controls a pair of curtains closing from each side of the window. In this application power to the unit is controlled with a plug in timer which switches on for about 2 minutes in the morning and the evening. The last direction of movement is stored in the in EEPROM so it knows which direction to move the curtains. I can supply the code for this which could be a basis for your application.

Les.
 

MisterBill2

Joined Jan 23, 2018
27,159
How do they detect the end of motion of the power windows in a car??? That will be a good scheme to copy. My experience with gate valves as that while they do allow full flow when open, they seldom provide a solid shutoff when closed.
 
Top