I am having difficulty controlling motor direction with the Easydriver
board from SparkFun/Brian Schmalz. My drives turn one direction (or
the other if I reverse the pins) but ignore my attempts to reverse.
I am using an Armite (rev 2, Kernel 7.21) to control an EasyDriver
(v3). I am attempting to drive one of several small bipolar stepper
motors. I am running the Armite off USB power, and the motor drive
power is from a small 0-15v/3A DC bench supply. The grounds are tied
together. The motors are 4 and 6 pin NEMA 17 motors with either 152
ohms/phase or 12.5 ohms/phase.
Stepping works well for me on all motors tried, with a good range of
control over speed and no especially excessive heat.
Unfortunately, I seem to be unable to control the direction pin using
simple code. I am wondering if I need a pullup/down (the Armite uses
3.3v logic), whether there are timing issues when changing direction,
or if there is something else wrong.
The complete code I'm using is:
#include <PULSE.bas>
#define INPUT 0
#define OUTPUT 1
#define PULSE 500
#define STEP_PIN 2
#define DIR_PIN 3
#define STEP PULSOUT(STEP_PIN, PULSE)
'#define DIR_CCW LOW(DIR_PIN)
'#define DIR_CW HIGH(DIR_PIN)
#define DIR_CCW OUT(DIR_PIN) = 0
#define DIR_CW OUT(DIR_PIN) = 1
DIR(DIR_PIN) = OUTPUT
DIR_CCW
for j = 0 to 100
for i = 0 to 3200
'print " ", j
STEP
'wait(100)
next
wait(1000)
if (j MOD 2) = 1 then
print "DIR_CW"
DIR_CCW
else
print "DIR_CCW"
DIR_CW
endif
next
Thanks,
Dave Witten
Stepper motor
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
Dave,
The Easy Driver needs 5V logic for both the step and direction pins. If you have
the option of using open drain outputs, then using pull up resistors on both
lines should allow you get to to 5V.
*Brian
-----Original Message-----
From: ARMexpress@yahoogroups.com [mailto:ARMexpress@yahoogroups.com]On Behalf Of
pork_u_pine2000
Sent: Sunday, January 25, 2009 6:59 PM
To: ARMexpress@yahoogroups.com
Subject: [ARMexpress] Difficulty changing stepper direction - EasyDriver +
Armite
I am having difficulty controlling motor direction with the Easydriver
board from SparkFun/Brian Schmalz. My drives turn one direction (or
the other if I reverse the pins) but ignore my attempts to reverse.
I am using an Armite (rev 2, Kernel 7.21) to control an EasyDriver
(v3). I am attempting to drive one of several small bipolar stepper
motors. I am running the Armite off USB power, and the motor drive
power is from a small 0-15v/3A DC bench supply. The grounds are tied
together. The motors are 4 and 6 pin NEMA 17 motors with either 152
ohms/phase or 12.5 ohms/phase.
Stepping works well for me on all motors tried, with a good range of
control over speed and no especially excessive heat.
Unfortunately, I seem to be unable to control the direction pin using
simple code. I am wondering if I need a pullup/down (the Armite uses
3.3v logic), whether there are timing issues when changing direction,
or if there is something else wrong.
The complete code I'm using is:
#include <PULSE.bas>
#define INPUT 0
#define OUTPUT 1
#define PULSE 500
#define STEP_PIN 2
#define DIR_PIN 3
#define STEP PULSOUT(STEP_PIN, PULSE)
'#define DIR_CCW LOW(DIR_PIN)
'#define DIR_CW HIGH(DIR_PIN)
#define DIR_CCW OUT(DIR_PIN) = 0
#define DIR_CW OUT(DIR_PIN) = 1
DIR(DIR_PIN) = OUTPUT
DIR_CCW
for j = 0 to 100
for i = 0 to 3200
'print " ", j
STEP
'wait(100)
next
wait(1000)
if (j MOD 2) = 1 then
print "DIR_CW"
DIR_CCW
else
print "DIR_CCW"
DIR_CW
endif
next
Thanks,
Dave Witten
[Non-text portions of this message have been removed]
The Easy Driver needs 5V logic for both the step and direction pins. If you have
the option of using open drain outputs, then using pull up resistors on both
lines should allow you get to to 5V.
*Brian
-----Original Message-----
From: ARMexpress@yahoogroups.com [mailto:ARMexpress@yahoogroups.com]On Behalf Of
pork_u_pine2000
Sent: Sunday, January 25, 2009 6:59 PM
To: ARMexpress@yahoogroups.com
Subject: [ARMexpress] Difficulty changing stepper direction - EasyDriver +
Armite
I am having difficulty controlling motor direction with the Easydriver
board from SparkFun/Brian Schmalz. My drives turn one direction (or
the other if I reverse the pins) but ignore my attempts to reverse.
I am using an Armite (rev 2, Kernel 7.21) to control an EasyDriver
(v3). I am attempting to drive one of several small bipolar stepper
motors. I am running the Armite off USB power, and the motor drive
power is from a small 0-15v/3A DC bench supply. The grounds are tied
together. The motors are 4 and 6 pin NEMA 17 motors with either 152
ohms/phase or 12.5 ohms/phase.
Stepping works well for me on all motors tried, with a good range of
control over speed and no especially excessive heat.
Unfortunately, I seem to be unable to control the direction pin using
simple code. I am wondering if I need a pullup/down (the Armite uses
3.3v logic), whether there are timing issues when changing direction,
or if there is something else wrong.
The complete code I'm using is:
#include <PULSE.bas>
#define INPUT 0
#define OUTPUT 1
#define PULSE 500
#define STEP_PIN 2
#define DIR_PIN 3
#define STEP PULSOUT(STEP_PIN, PULSE)
'#define DIR_CCW LOW(DIR_PIN)
'#define DIR_CW HIGH(DIR_PIN)
#define DIR_CCW OUT(DIR_PIN) = 0
#define DIR_CW OUT(DIR_PIN) = 1
DIR(DIR_PIN) = OUTPUT
DIR_CCW
for j = 0 to 100
for i = 0 to 3200
'print " ", j
STEP
'wait(100)
next
wait(1000)
if (j MOD 2) = 1 then
print "DIR_CW"
DIR_CCW
else
print "DIR_CCW"
DIR_CW
endif
next
Thanks,
Dave Witten
[Non-text portions of this message have been removed]
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
--- In ARMexpress@yahoogroups.com, "Brian Schmalz" <brian.schmalz@...>
wrote:
>
> Dave,
>
> The Easy Driver needs 5V logic for both the step and direction pins.
If you have the option of using open drain outputs, then using pull up
resistors on both lines should allow you get to to 5V.
>
> *Brian
>
> -----Original Message-----
> From: ARMexpress@yahoogroups.com
[mailto:ARMexpress@yahoogroups.com]On Behalf Of pork_u_pine2000
> Sent: Sunday, January 25, 2009 6:59 PM
> To: ARMexpress@yahoogroups.com
> Subject: [ARMexpress] Difficulty changing stepper direction -
EasyDriver + Armite
>
>
>
> I am having difficulty controlling motor direction with the Easydriver
...
>
> [Non-text portions of this message have been removed]
>
Wow, That was quick! Thanks, I wasn't sure since the A3967 sheet
seemed to suggest 3.3 might work.
Greatly appreciated,
Dave
wrote:
>
> Dave,
>
> The Easy Driver needs 5V logic for both the step and direction pins.
If you have the option of using open drain outputs, then using pull up
resistors on both lines should allow you get to to 5V.
>
> *Brian
>
> -----Original Message-----
> From: ARMexpress@yahoogroups.com
[mailto:ARMexpress@yahoogroups.com]On Behalf Of pork_u_pine2000
> Sent: Sunday, January 25, 2009 6:59 PM
> To: ARMexpress@yahoogroups.com
> Subject: [ARMexpress] Difficulty changing stepper direction -
EasyDriver + Armite
>
>
>
> I am having difficulty controlling motor direction with the Easydriver
...
>
> [Non-text portions of this message have been removed]
>
Wow, That was quick! Thanks, I wasn't sure since the A3967 sheet
seemed to suggest 3.3 might work.
Greatly appreciated,
Dave
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
Yup, that driver chip will use 3.3 just fine, however, the EasyDriver supplies
the driver with 5V for it's logic level input, so that's what all logic inputs
(step and direction) need to be.
Does the Armite allow for open drain outputs?
*Brian
-----Original Message-----
From: ARMexpress@yahoogroups.com [mailto:ARMexpress@yahoogroups.com]On Behalf Of
pork_u_pine2000
Sent: Sunday, January 25, 2009 7:12 PM
To: ARMexpress@yahoogroups.com
Subject: [ARMexpress] Re: Difficulty changing stepper direction - EasyDriver +
Armite
--- In ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com, "Brian
Schmalz" <brian.schmalz@...>
wrote:
>
> Dave,
>
> The Easy Driver needs 5V logic for both the step and direction pins.
If you have the option of using open drain outputs, then using pull up
resistors on both lines should allow you get to to 5V.
>
> *Brian
>
> -----Original Message-----
> From: ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com
[mailto: ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com]On
Behalf Of pork_u_pine2000
> Sent: Sunday, January 25, 2009 6:59 PM
> To: ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com
> Subject: [ARMexpress] Difficulty changing stepper direction -
EasyDriver + Armite
>
>
>
> I am having difficulty controlling motor direction with the Easydriver
...
>
> [Non-text portions of this message have been removed]
>
Wow, That was quick! Thanks, I wasn't sure since the A3967 sheet
seemed to suggest 3.3 might work.
Greatly appreciated,
Dave
[Non-text portions of this message have been removed]
the driver with 5V for it's logic level input, so that's what all logic inputs
(step and direction) need to be.
Does the Armite allow for open drain outputs?
*Brian
-----Original Message-----
From: ARMexpress@yahoogroups.com [mailto:ARMexpress@yahoogroups.com]On Behalf Of
pork_u_pine2000
Sent: Sunday, January 25, 2009 7:12 PM
To: ARMexpress@yahoogroups.com
Subject: [ARMexpress] Re: Difficulty changing stepper direction - EasyDriver +
Armite
--- In ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com, "Brian
Schmalz" <brian.schmalz@...>
wrote:
>
> Dave,
>
> The Easy Driver needs 5V logic for both the step and direction pins.
If you have the option of using open drain outputs, then using pull up
resistors on both lines should allow you get to to 5V.
>
> *Brian
>
> -----Original Message-----
> From: ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com
[mailto: ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com]On
Behalf Of pork_u_pine2000
> Sent: Sunday, January 25, 2009 6:59 PM
> To: ARMexpress@yahoogro <mailto:ARMexpress%40yahoogroups.com> ups.com
> Subject: [ARMexpress] Difficulty changing stepper direction -
EasyDriver + Armite
>
>
>
> I am having difficulty controlling motor direction with the Easydriver
...
>
> [Non-text portions of this message have been removed]
>
Wow, That was quick! Thanks, I wasn't sure since the A3967 sheet
seemed to suggest 3.3 might work.
Greatly appreciated,
Dave
[Non-text portions of this message have been removed]
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
--- In ARMexpress@yahoogroups.com, "Brian Schmalz" <brian.schmalz@...>
wrote:
>
> Yup, that driver chip will use 3.3 just fine, however, the
EasyDriver supplies the driver with 5V for it's logic level input, so
that's what all logic inputs (step and direction) need to be.
>
> Does the Armite allow for open drain outputs?
>
> *Brian
>
>
Under 'General Interfacing' the documentation says:
Both the ARMexpress and the ARMmite can be directly connected to 5V
TTL devices. The output voltage for these ARM devices ranges from
0.4V to 2.9V when driving upto 4mA of current. Most TTL devices will
recognize these as valid logic levels (normally defined to be 0.8 and
2.0V)
Inputs
The ARMexpress and ARMmite may also be directly connected to 5V TTL
outputs. If they are TTL compatable the voltage levels of the TTL
output would normally be (0.4 and 3.4V), though they may go higher.
The inputs for these ARM devices are 5V compatable.
Tieing to Supply lines
The ARMexpress and ARMmite inputs may be connected directly to a GND
pin, but if connecting to a fixed voltage supply, then a 1K or greater
resistor in series is recommended. This is the same recommendation
for any TTL compatable device. The reason being is that the 5V supply
may exceed the 5V at times, or if that voltage is available before the
power supply to the CPU, large currents may flow through the
protection diodes in the CPU.
Interfacing to higher voltages
A resistor divider may be used to connect the ARMexpress and ARMmite
to voltages that go higher than 5V. The picture below shows a
connection appropriate for a 24V signal. A 100K resistor is connected
from the input to IO(11) and then an 11K resistor connects IO(11) to
GND. This will divide that 24V input to vary between 0 and 2.4V.
No specific mention of Open Drain, but plenty of interfacing examples.
It may well be whatever the LPC2103 spec. says that matters.
-- Dave
wrote:
>
> Yup, that driver chip will use 3.3 just fine, however, the
EasyDriver supplies the driver with 5V for it's logic level input, so
that's what all logic inputs (step and direction) need to be.
>
> Does the Armite allow for open drain outputs?
>
> *Brian
>
>
Under 'General Interfacing' the documentation says:
Both the ARMexpress and the ARMmite can be directly connected to 5V
TTL devices. The output voltage for these ARM devices ranges from
0.4V to 2.9V when driving upto 4mA of current. Most TTL devices will
recognize these as valid logic levels (normally defined to be 0.8 and
2.0V)
Inputs
The ARMexpress and ARMmite may also be directly connected to 5V TTL
outputs. If they are TTL compatable the voltage levels of the TTL
output would normally be (0.4 and 3.4V), though they may go higher.
The inputs for these ARM devices are 5V compatable.
Tieing to Supply lines
The ARMexpress and ARMmite inputs may be connected directly to a GND
pin, but if connecting to a fixed voltage supply, then a 1K or greater
resistor in series is recommended. This is the same recommendation
for any TTL compatable device. The reason being is that the 5V supply
may exceed the 5V at times, or if that voltage is available before the
power supply to the CPU, large currents may flow through the
protection diodes in the CPU.
Interfacing to higher voltages
A resistor divider may be used to connect the ARMexpress and ARMmite
to voltages that go higher than 5V. The picture below shows a
connection appropriate for a 24V signal. A 100K resistor is connected
from the input to IO(11) and then an 11K resistor connects IO(11) to
GND. This will divide that 24V input to vary between 0 and 2.4V.
No specific mention of Open Drain, but plenty of interfacing examples.
It may well be whatever the LPC2103 spec. says that matters.
-- Dave
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
Looking at the spec for the A3967, it wants 0.7 * Vcc
For 5V, that's 3.5V (this is not TTL)
Now an ARMmite can't drive above 3.3V, but you should be able to use a
pullup resistor to 5V, and rather than driving it high, you should
disable the driver. As the A3967 is a light load, a 1K or 2K should
be OK.
Actually the fastest would be to drive it HIGH then release it--
HIGH (pin)
INPUT (pin) ' will release the pin
For 5V, that's 3.5V (this is not TTL)
Now an ARMmite can't drive above 3.3V, but you should be able to use a
pullup resistor to 5V, and rather than driving it high, you should
disable the driver. As the A3967 is a light load, a 1K or 2K should
be OK.
Actually the fastest would be to drive it HIGH then release it--
HIGH (pin)
INPUT (pin) ' will release the pin
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
--- In ARMexpress@yahoogroups.com, "basicnode" <bruce@...> wrote:
>
> Looking at the spec for the A3967, it wants 0.7 * Vcc
>
> For 5V, that's 3.5V (this is not TTL)
>
> Now an ARMmite can't drive above 3.3V, but you should be able to use a
> pullup resistor to 5V, and rather than driving it high, you should
> disable the driver. As the A3967 is a light load, a 1K or 2K should
> be OK.
>
> Actually the fastest would be to drive it HIGH then release it--
>
> HIGH (pin)
> INPUT (pin) ' will release the pin
>
Thanks!
Ok, now I know where my difficulties come from. But I'm not sure that
I quite get the last bit. You mean that if I just want to release the
motor I drive the direction pin HIGH, then do INPUT? You are not
suggesting that I can switch direction, are you?
It appears tha I have to do level translation through a transistor
(and add a third supply voltage) to be able to make this go both
directions.
-- Dave
>
> Looking at the spec for the A3967, it wants 0.7 * Vcc
>
> For 5V, that's 3.5V (this is not TTL)
>
> Now an ARMmite can't drive above 3.3V, but you should be able to use a
> pullup resistor to 5V, and rather than driving it high, you should
> disable the driver. As the A3967 is a light load, a 1K or 2K should
> be OK.
>
> Actually the fastest would be to drive it HIGH then release it--
>
> HIGH (pin)
> INPUT (pin) ' will release the pin
>
Thanks!
Ok, now I know where my difficulties come from. But I'm not sure that
I quite get the last bit. You mean that if I just want to release the
motor I drive the direction pin HIGH, then do INPUT? You are not
suggesting that I can switch direction, are you?
It appears tha I have to do level translation through a transistor
(and add a third supply voltage) to be able to make this go both
directions.
-- Dave
-
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: Stepper motor
If you put a pull up resistor on the line, then you can simulate an open
drain output by switching the pin between an OUTPUT driven LOW, and an
INPUT (where the pull up resistor will put the line up to +5V). This
should work out quite well, and not need any transistors or other level
translations.
*Brian
From: ARMexpress@yahoogroups.com [mailto:ARMexpress@yahoogroups.com] On
Behalf Of pork_u_pine2000
Sent: Monday, January 26, 2009 12:26 PM
To: ARMexpress@yahoogroups.com
Subject: [ARMexpress] Re: Difficulty changing stepper direction -
EasyDriver + Armite
--- In ARMexpress@yahoogroups.com <mailto:ARMexpress%40yahoogroups.com>
, "basicnode" <bruce@...> wrote:
>
> Looking at the spec for the A3967, it wants 0.7 * Vcc
>
> For 5V, that's 3.5V (this is not TTL)
>
> Now an ARMmite can't drive above 3.3V, but you should be able to use a
> pullup resistor to 5V, and rather than driving it high, you should
> disable the driver. As the A3967 is a light load, a 1K or 2K should
> be OK.
>
> Actually the fastest would be to drive it HIGH then release it--
>
> HIGH (pin)
> INPUT (pin) ' will release the pin
>
Thanks!
Ok, now I know where my difficulties come from. But I'm not sure that
I quite get the last bit. You mean that if I just want to release the
motor I drive the direction pin HIGH, then do INPUT? You are not
suggesting that I can switch direction, are you?
It appears tha I have to do level translation through a transistor
(and add a third supply voltage) to be able to make this go both
directions.
-- Dave
[Non-text portions of this message have been removed]
drain output by switching the pin between an OUTPUT driven LOW, and an
INPUT (where the pull up resistor will put the line up to +5V). This
should work out quite well, and not need any transistors or other level
translations.
*Brian
From: ARMexpress@yahoogroups.com [mailto:ARMexpress@yahoogroups.com] On
Behalf Of pork_u_pine2000
Sent: Monday, January 26, 2009 12:26 PM
To: ARMexpress@yahoogroups.com
Subject: [ARMexpress] Re: Difficulty changing stepper direction -
EasyDriver + Armite
--- In ARMexpress@yahoogroups.com <mailto:ARMexpress%40yahoogroups.com>
, "basicnode" <bruce@...> wrote:
>
> Looking at the spec for the A3967, it wants 0.7 * Vcc
>
> For 5V, that's 3.5V (this is not TTL)
>
> Now an ARMmite can't drive above 3.3V, but you should be able to use a
> pullup resistor to 5V, and rather than driving it high, you should
> disable the driver. As the A3967 is a light load, a 1K or 2K should
> be OK.
>
> Actually the fastest would be to drive it HIGH then release it--
>
> HIGH (pin)
> INPUT (pin) ' will release the pin
>
Thanks!
Ok, now I know where my difficulties come from. But I'm not sure that
I quite get the last bit. You mean that if I just want to release the
motor I drive the direction pin HIGH, then do INPUT? You are not
suggesting that I can switch direction, are you?
It appears tha I have to do level translation through a transistor
(and add a third supply voltage) to be able to make this go both
directions.
-- Dave
[Non-text portions of this message have been removed]