Greetings everyone. I am new to Arduino and in the middle of a rather simple project. T need to control the opening of 8 1-1/4" gate valves. The valves are mechanical and take 10 full turns to fully open. I need to control the valve openings to meter the amount of air that will flow through them, lets say 1% flow to 100% flow.
Each valve will have a Nema 23 stepper motor attached and will have a mechanical advantage of 3:1. 30 turns of the stepper motor will open the valve 100%, therefor 15 turns of the stepper motor will open the valve 50%.
The motors are 1.8 deg/step.
The motors will be driven by Microstep dm542 Drivers, one for each motor.
To control these motors I have an Arduino Uno R3.
I would like to use a sliding scale, like an equalizer, to control how many times the motors will turn, with the top of the scale they turn 30 times. Then reversing the scale to reverse the motors back to zero. Does that make sense?
When all is done, my goal is this: 4 motors will control the flow of air on 4 valves for the intake, and the other 4 motors will control the flow of air on 4 valves on the exhaust. I will have two sliding scales, one for intake, one for exhaust. The sliding scale will range from 1%open to 100%open. another way to look at this, I need the ability to control the number of steps the motors will turn with a sliding scale, with the maximum number of steps being set.
in this case I believe my motors are 200 steps per turn, x 10 turns so a maxumum of 2000 steps, x3 because of mechanical advantage, so 6000 steps when the scale is set to 100%
That's the mechanics of it, which I understand. What I don't understand and need to learn is how do I program the Arduino to operate the valves? Im new to this and I don't know where to start. I need some guidance as I don't know how to write code. Your input would be appreciated!
Start with the examples on the AccelStepper library.
Add a switch at one end of the motion range for setting the position to a known (top/bottom) value.
Do it yourself and draw a block diagram that describes all physical, electrical and logical interfaces from your project.
There is one problem you do not mention, so i suppose you are not aware of it.
You cannot position a stepper absolutely until you know it is positioned at e.g. your zero point. When your system starts you don't know where your stepper is positioned. You need a so called 'homing procedure' where you move your stepper to a known position. This can be a limit switch that is activated by the stepper when it reaches this reference point. Is there anything similar at your mechanic of the valves that can be used for homing?
Not only do you need to learn how to write code but you also need to learn some basic electronics so you will understand how to interface you motors, etc. to an arduino.
Good place to start:
Unless your gates are rectangular in shape, the ratio of turns to air volume will be extremely non-linear! You will have to run tests to find the numeric values so you can program the air flow vs. turns.
Thank you, will look into this!
Regarding home position, a limiting switch is not an option. the only part that can activate a switch is within a housing with no access, however, can I just home the system when the valves are closed?
Regarding the ratio in air volume, this is true. In fact 100% open will be reached well before 100% is reached. This is fine as we're not working off of true numbers, more from feel. If the sweet spot read as 60%, then we use 60%, it won't matter how much the true value of airflow is.
Thanks again for all the tips. Ill start studying now...
And your Arduino will know this how?
Well, if there was a limit switch then I'll assume the switch will tell the Arduino it has reached Home position, but there is no place to put a limit switch. Therefore can we have a "home" switch? When the valves are closed, you push the button to home the system. Would that work?
Only if you manually closed the valve. Would not a better system monitor the air flow and adjust the valve to get the flow you desire?
In this circumstance closing the valve manually and then homing it would be the preferred solution. If the system is powered down, is there any objection to manually turning the valves to their closed position, then powering up the unit and setting Home position?
I don’t have any. If this was my system, I would often forget to do this each time!
That's probably your only option. Let on program start run all steppers to close the valves. Hope that nothing will break when the motors continue running at the mechanical limit. Eventually reduce the current limit for the homing procedure.
What torque is required to turn the valve through it's full range?
What torque does your motor / gearbox produce?
Good idea.
You have a long way to go.
In the end you may find that your idea is not feasible
Some controllers have current sense outputs which could be used instead of a limit switch to allow the Arduino to sense when the valves are fully closed. Unfortunately your drivers don't seem to have that feature.
Thanks for all your input. I could zero the valves on start up, but here lies a problem. If I loose power, then I need to zero the valves again upon start up. In this situation that is not an option, but here is an idea: I have a potentiometer that's telling the motor how many turns to go at a given selection. Could I not add another potentiometer, say a 10 turn potentiometer that could tell the Arduino at what position the valve is in at any given time?
Yes. If you can add a 10 turn pot to give you feedback on position, then the solution is much easier: you can drive the stepper turning to the desired value of the feedback pot.