I am new to the arduino and have been looking through the forums for information on how to control a stepper motor with a 0-10Vdc input. All I can find is control by a potentiometer.
I am in a bit of a time pinch to develop a device for a project that will control a stepper valve with a 0-10Vdc input signal. The stepper motor drives the valve in one direction from 0 - 100% open and then I will need to drive it 100 - 0% by reversing the direction. In other words, if the input is 5vdc, it needs to drive the motor in the open direction for half of the time it takes to drive the valve 100% open which will be 50% open. If the input changes to 2.5vdc, it will then need to reverse direction and close for a quarter of the time it takes for full travel and stop. this should be the 25% open position of the valve. This is basically taking an analog input and converting it to an incremental position of a stepper valve.
After thinking about this, I understand that it is going to take some time to develop the timing to get this accurate. I just need a place to start.
Can anyone help point me in the right direction of a program or set of programs to start working with?
I am jumping in head first, and I need to get it done pretty quickly if possible, so any help is appreciated.
I have an Arduino Uno and purchased the Adafruit Motor/Stepper/Servo Shield for Arduino kit - v1.2. It looked to me from the specifications that it would be able to control the following.
Stepper motor type
Bi-polar - permanent magnet
Step mode
2 phase full step
Phase resistance
52 Ω ±10%
Step angle
7.5° (motor),
0.9° (lead screw),
Gearing ration 8.5:1. (38/13)2:1
Nominal voltage
(Constant voltage drive) 12 V dc -4% +15%,
Phase current
(Using chopper drive) 100 mA RMS -4% +15%,
Max. total power
Voltage / current drive: 5.5 / 1.3 W (UL: NEC class 2)
Step rate
150 steps/sec. (constant voltage drive)
0-300 steps/sec. 300 recommended
I would really like confirmation that the hardware looks compatible and then ANY help getting started with a program and leading me in the right direction will be greatly appreciated.
How do I control a stepper motor with a 0-10Vdc input?
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I control a stepper motor with a 0-10Vdc input?
That motor looks compatible with the Motor Shield.
In the case of your 10v input, we only need to scale that down to an acceptable range for the Arduino - 0-5v. That can be done simply with a resistor voltage divider. You can make one of these with 2 10K resistors. Connect the two resistors in series. Connect one end to ground, one end to your 0-10v signal and connect the mid-point to your analog input.
Actually, it is very much the same. The potentiometer input needs to be converted to a voltage before the Arduino can measure it.how to control a stepper motor with a 0-10Vdc input. All I can find is control by a potentiometer.
In the case of your 10v input, we only need to scale that down to an acceptable range for the Arduino - 0-5v. That can be done simply with a resistor voltage divider. You can make one of these with 2 10K resistors. Connect the two resistors in series. Connect one end to ground, one end to your 0-10v signal and connect the mid-point to your analog input.
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
Re: How do I control a stepper motor with a 0-10Vdc input?
Okay. Great. I felt like I was making it too hard.
I will give it a try.
Thanks.
I will give it a try.
Thanks.
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
Re: How do I control a stepper motor with a 0-10Vdc input?
I have made some really good progress. I can drive the stepper motors and the voltages and currents have matched up great it seems so far. I haven't learned to make it sing yet, but I am learning the programming at a reasonable rate.
My question now is how do I physically create input connections to the motor shield?
I need one analog input and one digital input.
I understand that I can use any of the analog inputs, but I would like to have a terminal connection for the input and I can't see how to do this with the configuration of the board.
Also, I would like to create a jumper for a digital input.
What is the best way physically, without having to modify the board too much to create a connection point?
At this point, I am thinking that I will have to solder wires to a set of external terminals.
Is there a better way of getting this done on the motor shield board?
My question now is how do I physically create input connections to the motor shield?
I need one analog input and one digital input.
I understand that I can use any of the analog inputs, but I would like to have a terminal connection for the input and I can't see how to do this with the configuration of the board.
Also, I would like to create a jumper for a digital input.
What is the best way physically, without having to modify the board too much to create a connection point?
At this point, I am thinking that I will have to solder wires to a set of external terminals.
Is there a better way of getting this done on the motor shield board?
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I control a stepper motor with a 0-10Vdc input?
There is a row of breakout holes adjacent to the header pins on the shield. You can solder female header strips in those holes, then plug your wires into those headers.
http://www.adafruit.com/products/598
http://www.adafruit.com/products/598
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
Re: How do I control a stepper motor with a 0-10Vdc input?
I would like to add a terminal to the board for my 0-5 or 0-10Vdc input.
Can I add a terminal to AO5 (as shown in the attachment) and parallel the inputs over to another input...say 3 or 4 hiding the 10k ohm resistors configured as described in your last reply under the board?
I could then use other inputs for a jumper where the program says if the jumper is on, then control by input Analog input 5 (ignoring input 4) and if the jumper is off, control by input 4 (and ignore input 5)... which would be the 0-10vdc input converted to 0-5vdc?
My biggest concern is having 10Vdc (in parallel to another input) on Analog input 5 while it is being read as 5vdc on another input.
I feel like I am rambling.... tired I guess.
Hope this question makes sense.
Can I add a terminal to AO5 (as shown in the attachment) and parallel the inputs over to another input...say 3 or 4 hiding the 10k ohm resistors configured as described in your last reply under the board?
I could then use other inputs for a jumper where the program says if the jumper is on, then control by input Analog input 5 (ignoring input 4) and if the jumper is off, control by input 4 (and ignore input 5)... which would be the 0-10vdc input converted to 0-5vdc?
My biggest concern is having 10Vdc (in parallel to another input) on Analog input 5 while it is being read as 5vdc on another input.
I feel like I am rambling.... tired I guess.
Hope this question makes sense.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I control a stepper motor with a 0-10Vdc input?
If I understand your drawing correctly, you are connecting 10v to the A-5 pin and making a voltage divider between that and ground, with A-4 connected to the center. You should not connect the 10v directly to any Arduino pin. Anything over 5.5v can damage the Arduino. You should wire that resistor directly from your 10v terminal to the A-4 pin.
Putting the resistors on the bottom of the board should not be a problem. Just double-check for clearance when assembling so you don't have any shorts.
Putting the resistors on the bottom of the board should not be a problem. Just double-check for clearance when assembling so you don't have any shorts.
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
Re: How do I control a stepper motor with a 0-10Vdc input?
In my new design, I have scrapped the 0-10V option. I am sticking to 0-5v as an input only.
I need to add a terminal for the 0-5vdc input to the board for control.
There is a 6X19 hole array that I can not find any reference to what these holes are to be used for.
If these are provided for adding components and have no connections, I'll use a few of these for my terminals.
Can you please confirm that those holes are just holes not connected to anything and I can simply run a couple wires underneath the board from my input and common to my newly added terminals?
Thanks.
I need to add a terminal for the 0-5vdc input to the board for control.
There is a 6X19 hole array that I can not find any reference to what these holes are to be used for.
If these are provided for adding components and have no connections, I'll use a few of these for my terminals.
Can you please confirm that those holes are just holes not connected to anything and I can simply run a couple wires underneath the board from my input and common to my newly added terminals?
Thanks.
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
Re: How do I control a stepper motor with a 0-10Vdc input?
This question refers to the new version of the motor shield.
- darby
- Posts: 9
- Joined: Mon Feb 11, 2013 12:46 am
Re: How do I control a stepper motor with a 0-10Vdc input?
Also, what is the diameter of the holes and distances between them?
I need this so I can pick my terminals.
I need this so I can pick my terminals.
- adafruit_support_bill
- Posts: 88154
- Joined: Sat Feb 07, 2009 10:11 am
Re: How do I control a stepper motor with a 0-10Vdc input?
That is a prototyping area. You can use it for anything you like.
Holes are on 0.1" centers and are approximately 0.04" in diameter.
Holes are on 0.1" centers and are approximately 0.04" in diameter.
- Franklin97355
- Posts: 23940
- Joined: Mon Apr 21, 2008 2:33 pm
Re: How do I control a stepper motor with a 0-10Vdc input?
This might be an option https://www.adafruit.com/products/196
Please be positive and constructive with your questions and comments.