Hi , i’m working on a project of controlling a 12v dc motor that it will open and close a valve according to the input and the speed.
I have the speed
I have the how much meters per hour it goes
But i cant understand how i have to think to get
Lets say, i insert a value 25 m/h, and speed is showing 40 m/h, how im gonna write the code so it will check the speed and if its bigger than my input it will turn motor left if it’s lower right so somehow it will stabilise to my input
I know its more complicated thats for sure still thank you, one more fast question, lets say i made it through relays but when it gets close to my input speed 40 it goes up 41 and then goes down 39, what i can do for that? Should i make the relay work for less time if the difference is less than 3 ? Or should i not use relay in general an check for another way
Im measuring the speed/meters/mph through a rotary encoder. And there is a valve that i mount a 12 volt dc motor on top of it that will turn left and right to open and close it, when i open it the speed increase when i close it the speed decrease. So the question was what way should i use to control the motor so it will stabilise to my input, my input is 40 m/h , the screen shows 30 m/h so it have to open to get to 40 and stop
It is mounted on a wheel and the wheel goes on top of a hose the hose is moving and the rotary is gathering the speed.
The valve is a simple 3 inch brass gate valve, when i open the valve the hose reel faster, when i close it the hose reel slower.
Motor is 12 volt Bosch window regulator motor, 13 Nm torque, 2 pin connector
I dont have any position feedback, but what i think is i don't have to even know, cause even if its fully closed it will have to open it to match my input speed
Please explain more about these relays. What you are using to control the on/off of the motor, possibly the speed it runs, and the the direction it turns.
Thats the motor im gonna use it have 2 pins which it will get connected one to each relay i think im still not sure if it is the best way to do it . And the through Arduino i will program it to turn left or right to open or close the valve, maybe use a command like/ open relay for 1 sec ,check the speed, if the difference is more than 10 m/h open again for 1 sec etc. dont know how else to think. With my low experience and research i come up with this idea. If you think there is a better way please you are welcome
You need to know when fully open and fully closed so you do not try and drive the motor against the valve stops and damage something, possibly the motor.
Have you measured the current that the motor draws at 12V?
You need to know this to make sure the relay contacts can handle the current.