Sign in

username:

password:



Not a member?

Search lpc2000



Search tips

Subscribe to lpc2000



lpc2000 by Keywords

2106 | ADC | ARM7 | Atmel | Bootloader | CAN | CrossStudio | CrossWorks | DDS | ECos | Ethernet | ETM | FIFO | FLASH | FPGA | GCC | GDB | GNU | GNUARM | GPIO | I2C | IAP | IAR | JTAG | Kickstart | LCD | Linux | LPC | LPC-E2294 | LPC2000 | LPC2100 | LPC2104 | Lpc2106 | Lpc210x | LPC2114 | LPC2119 | LPC2124 | LPC2129 | Lpc2138 | LPC213x | LPC21xx | LPC2210 | LPC2212 | LPC2214 | LPC2292 | LPC2294 | LPC2xxx | LPC3128 | MCB2100 | Olimex | Philips | PWM | Rowley | RTC | RTOS | SPI | SSP | UART | UART0 | UART1 | ULINK | USB | Watchdog | Wiggler

Ads

Discussion Groups

Discussion Groups | LPC2000 | Re: Stepper Motor Driver (LPC21xx, etc.)

Discussion group dedicated to the Philips LPC2000 family of ARM MCUs

Stepper Motor Driver (LPC21xx, etc.) - Kevin Townsend - Sep 16 14:54:01 2008

I was wondering if anyone knows of any publicly available stepper motor
drivers or code for the LPC21xx (LPC2148 in my case)? I have a 4 wire
bi-polar stepper that I would like to control, and was hoping to find a
decent ARM7 example to at least start from since I've never tried to
use a stepper motor before.

Has anyone here tried reliably driving three stepper motors using an
LPC2148 or similar device, that could offer some insight or experience
on it?

Kevin.
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )


Re: Stepper Motor Driver (LPC21xx, etc.) - "Charles R. Grenz" - Sep 16 14:58:46 2008

Kevin Townsend wrote:
> I was wondering if anyone knows of any publicly available stepper motor
> drivers or code for the LPC21xx (LPC2148 in my case)? I have a 4 wire
> bi-polar stepper that I would like to control, and was hoping to find a
> decent ARM7 example to at least start from since I've never tried to
> use a stepper motor before.
>
> Has anyone here tried reliably driving three stepper motors using an
> LPC2148 or similar device, that could offer some insight or experience
> on it?
>
> Kevin.
>

Hi Kevin,

Contact me directly so we can discuss.

regards,
Charles

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - "J.C. Wren" - Sep 16 15:03:51 2008

Well, *that's* no fun. It sounded like it would be an interesting thread.

On Tue, Sep 16, 2008 at 2:58 PM, Charles R. Grenz <
c...@simplestep.com> wrote:

> Hi Kevin,
>
> Contact me directly so we can discuss.
>
> regards,
> Charles
[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - rtstofer - Sep 16 15:23:39 2008

--- In l...@yahoogroups.com, "J.C. Wren" wrote:
>
> Well, *that's* no fun. It sounded like it would be an interesting
thread.

It is always worth looking for 'Jones on Steppers' on Google. Allegro
Microsystems builds a lot of stepper driver chips (Sanken).

Richard

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - "Charles R. Grenz" - Sep 16 15:29:31 2008


rtstofer wrote:
> --- In l...@yahoogroups.com, "J.C. Wren" wrote:
>> Well, *that's* no fun. It sounded like it would be an interesting
> thread.
>
> It is always worth looking for 'Jones on Steppers' on Google. Allegro
> Microsystems builds a lot of stepper driver chips (Sanken).
>
> Richard
>
Hi Richard,

Yes you are correct and if you look at Jones on Steppers you will find a link to us. What I want to ask Kevin is how fast he wants to move the motors, etc. Also if you are in Europe then another company to look at is Trinamic. They make a great motor driver chip.

regards,
Charles

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - Kevin Townsend - Sep 16 15:57:23 2008

Is it realistic to implement something using only an ARM7 processor, or
is it just not worth the effort? I'm not objectionable to using an
external chip, but would have preferred a software approach if
possible ... though I have no idea how feasible that would be (ergo
this post).

Kevin
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - "Charles R. Grenz" - Sep 16 16:02:12 2008

Kevin Townsend wrote:
> Is it realistic to implement something using only an ARM7 processor, or
> is it just not worth the effort? I'm not objectionable to using an
> external chip, but would have preferred a software approach if
> possible ... though I have no idea how feasible that would be (ergo
> this post).
>
> Kevin

Hi Kevin,

You will need to use an external driver and you will not have enough time to perform all the necessary control directly from the 2148. That's the short answer. What I was going to ask you are the following:

1) What is the fastest steps per second you are going to run?
2) Are you going to need microstepping?
3) Are you going to run all 3 motors at the same time?
4) Are you going to need acceleration/deceleration?
5) What is the current per phase of the largest motor?
6) What is the operating voltage of the driver?

regards,
Charles
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - Kevin Townsend - Sep 16 16:19:31 2008

Charles:

Thanks for the replies.

> 1) What is the fastest steps per second you are going to run?

The longest distance the motor will need to drive an object will be=20
around 1m, so I would guess that 200 steps per second is probably=20
sufficient, or a maximum of 400, since the aim is smooth,=20
controllable motion more than speed.

> 2) Are you going to need microstepping?

Probably not. 1.8=B0 is more than likely precise enough.

> 3) Are you going to run all 3 motors at the same time?

There are ocassions where I will need to run all three, yes, though=20
if necessary it may be possible to restrict movements to two axis=20
even if three would be preferrable.

> 4) Are you going to need acceleration/deceleration?

Yes, since I will need to ease into and out of the motion over a=20
variable amount of time. (For 10 seconds of movement, the user may=20
rquire 2 seconds of ease in and 2 seconds of ease out, for example.)=20=20
This 'easing' in and out is essential to get decent results for the=20
intended application.

> 5) What is the current per phase of the largest motor?

I need to do some tests to determine which motors I will end up=20
using, since I need to support a load of up to about 8 KGs. I have=20
ordered a few motors to try, but I can't say for the moment until I=20
do some tests.

> 6) What is the operating voltage of the driver?

Again, it depends on what motor I find that can most dependable=20
support an appropriate load. In any case, I will need to keep things=20
12V or under for the motors if its possible.

PS: If you prefer, I don't mind emailing you about this. Just let=20
me know your preference.

Kevin
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - "Charles R. Grenz" - Sep 16 16:26:34 2008


Kevin Townsend wrote:
> Charles:
>
> Thanks for the replies.
>

>
> Kevin
>

Hi Kevin,

Yes please contact me directly since this is more of directing you so you will not waste time playing with ideas that will be a dead end.

regards,
Charles

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - Robert Adsett - Sep 16 16:47:20 2008

At 04:01 PM 9/16/08 -0400, Charles R. Grenz wrote:
>Kevin Townsend wrote:
> > Is it realistic to implement something using only an ARM7 processor, or
> > is it just not worth the effort? I'm not objectionable to using an
> > external chip, but would have preferred a software approach if
> > possible ... though I have no idea how feasible that would be (ergo
> > this post).
> >
> > Kevin
>
>Hi Kevin,
>
> You will need to use an external driver and you will not have
> enough time to perform all the necessary control directly from the 2148.
> That's the short answer. What I was going to ask you are the following:

Will not enough time seems somewhat pessimistic (depends on how fast you
are expecting to move the motors of course). Many a moon ago I did two
axis microstepping on a Z80 and on a 5MHz 186. A 2148 with timing
peripherals would run circles around those setups. Then again we were
running slow enough for open loop to be sufficient.

Robert

http://www.aeolusdevelopment.com/

From the Divided by a Common Language File (Edited to protect the guilty)
ME - "I'd like to get Price and delivery for connector Part # XXXXX"
Dist./Rep - "$X.XX Lead time 37 days"
ME - "Anything we can do about lead time? 37 days seems a bit high."
Dist./Rep - "that is the lead time given because our stock is live.... we
currently have stock."
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - "Charles R. Grenz" - Sep 16 16:57:08 2008


Robert Adsett wrote:
> At 04:01 PM 9/16/08 -0400, Charles R. Grenz wrote:
>> Kevin Townsend wrote:
>>> Is it realistic to implement something using only an ARM7 processor, or
>>> is it just not worth the effort? I'm not objectionable to using an
>>> external chip, but would have preferred a software approach if
>>> possible ... though I have no idea how feasible that would be (ergo
>>> this post).
>>>
>>> Kevin
>> Hi Kevin,
>>
>> You will need to use an external driver and you will not have
>> enough time to perform all the necessary control directly from the 2148.
>> That's the short answer. What I was going to ask you are the following:
>
> Will not enough time seems somewhat pessimistic (depends on how fast you
> are expecting to move the motors of course). Many a moon ago I did two
> axis microstepping on a Z80 and on a 5MHz 186. A 2148 with timing
> peripherals would run circles around those setups. Then again we were
> running slow enough for open loop to be sufficient.
>
> Robert
>

Hi Robert,

I designed one with a 8051 running at 4MHz and also with a 6800 at 2MHz. It was an update to an old design that used a 4004! Did yours run linear motion and more then 1 axis of control? Also considering the processors you where using I would also assume you where using unipolar over bipolar with no microstepping?

I am talking with Kevin now and that 200 sps is probably not going to work considering the mass he has to move (which may mean a gear head with a 10:1 ratio will be involved or better) which means he is now at 2K sps per axis.

Yes I am being pessimistic but I am assuming that he will need some processor time left to do other things. ;-)

regards,
Charles
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - rtstofer - Sep 16 16:58:46 2008

--- In l...@yahoogroups.com, "Kevin Townsend" wrote:

> > 6) What is the operating voltage of the driver?
>
> Again, it depends on what motor I find that can most dependable
> support an appropriate load. In any case, I will need to keep things
> 12V or under for the motors if its possible.
>

The thing is, 12V motors are almost never run on 12V. More than
likely it will be several times this value.

The idea is to have excessive voltage available in the early part of a
step to overcome the winding inductance. That's why all the neat
chips have a current sense feature that controls the winding current
via PWM. When you start talking about microstepping, PWM is what
makes it work. There are proportional winding currents all controlled
by PWM.

This is one application where software MIGHT be able to produce an
acceptable driver under some conditions but it will never be as
capable as a hardware solution.

I would really prefer that this thread continue on this forum rather
than go off line. It is a topic in which I have a large interest and
absolutely no relevant experience.

Richard

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - Robert Adsett - Sep 16 19:11:15 2008

At 04:56 PM 9/16/2008 -0400, Charles R. Grenz wrote:

> > Will not enough time seems somewhat pessimistic (depends on how fast you
> > are expecting to move the motors of course). Many a moon ago I did two
> > axis microstepping on a Z80 and on a 5MHz 186. A 2148 with timing
> > peripherals would run circles around those setups. Then again we were
> > running slow enough for open loop to be sufficient.
> >
> I designed one with a 8051 running at 4MHz and also with a 6800
> at 2MHz. It was an update to an old design that used a 4004! Did yours
> run linear motion and more then 1 axis of control? Also considering the
> processors you where using I would also assume you where using unipolar
> over bipolar with no microstepping?

It was basically ran a two axis X-Y table, sine wave excitation for
micro-stepping.
> I am talking with Kevin now and that 200 sps is probably not
> going to work considering the mass he has to move (which may mean a gear
> head with a 10:1 ratio will be involved or better) which means he is now
> at 2K sps per axis.
>
> Yes I am being pessimistic but I am assuming that he will need
> some processor time left to do other things. ;-)

Well, now you are getting picky:)

We were doing data acquisition at the same time but that probably slowed us
down waiting for the lock-amp to settle.

Most of the details have been blown away by the sands of time. I don't
remember much about the actual stepping rate, we were running 0.8um
substeps as I recall and it would take a few seconds to move a cm at full
speed as I recall. The load was rather small though.

Robert

Another sign of the end of civilization, our technical magazines are
getting chatty
From an EETimes product descriptions 2006/08/09
".... systems that can sample gobs of inputs simultaneously"
Now just what is the technical definition for gobs again?
http://www.aeolusdevelopment.com/
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - Cool Dude - Sep 17 0:38:40 2008

hi charles,
Do u have any Idea on V F drives(speed control of Motor)

Raj

----- Original Message ----
From: Charles R. Grenz
To: l...@yahoogroups.com
Sent: Wednesday, September 17, 2008 12:28:28 AM
Subject: Re: [lpc2000] Stepper Motor Driver (LPC21xx, etc.)
Kevin Townsend wrote:
> I was wondering if anyone knows of any publicly available stepper motor
> drivers or code for the LPC21xx (LPC2148 in my case)? I have a 4 wire
> bi-polar stepper that I would like to control, and was hoping to find a
> decent ARM7 example to at least start from since I've never tried to
> use a stepper motor before.
>
> Has anyone here tried reliably driving three stepper motors using an
> LPC2148 or similar device, that could offer some insight or experience
> on it?
>
> Kevin.
>

Hi Kevin,

Contact me directly so we can discuss.

regards,
Charles

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Re: Stepper Motor Driver (LPC21xx, etc.) - HM2 - Sep 17 1:21:15 2008

I did a design with a LPC2104 and an Allegro A3977. Works excellent. I considered trying to do the logic control inside the ARM, but it's simply not worth it. You've got to use some kind of power driver chip anyway in most cases. You can do it with discrete mosfets, but there's a lot more to running a stepper motor elegantly. Depending on the speed it is running the control can switch from voltage to current. There are issues with inductive decay at different rates. A basic MCU just doesn't have all the resources to do this built in. The A3977 does already. I am using microsteping and acceleration/deceleration, variable speeds, variable loading, and more. Just managing the clock is really enough calcs for the ARM to do already, among it's other tasks. Running the motor itself is better left to something like the A3977.

If you are just going to run a motor crudely at a single constant speed than you can probably get away with just some mosfets and the ARM. But if you want smooth motor performance, microstepping, variable speeds, etc. in my opinion you need a proper motor controller. They do things you can't do with any MCU. Steppers can generate a lot of vibration and generate resonance at different rates with the mounting structure. Microstepping operates it as a sine wave which is much smoother. How a stepper behaves is very much a matter of how it is driven. The difference can be whether the motor sounds like a chain saw or sewing machine.

Chris.

[Non-text portions of this message have been removed]
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - elektrknight - Sep 17 1:43:07 2008

Kevin,

>
> Is it realistic to implement something using only an ARM7
processor, or
> is it just not worth the effort? I'm not objectionable to using an
> external chip, but would have preferred a software approach if
> possible ... though I have no idea how feasible that would be (ergo
> this post).

Implementing motion controller on any LPC21xx will not be a problem,
ARM7 core running at 60 MHz has enough processing power for
even a very complex algorithms.

To get an idea have a look at the Fab@home project here:

http://www.fabathome.org/

source code is here:

http://sourceforge.net/projects/fabathome/

It happens to include motion controller implemented on
lpc2148 plus a PC based fronted which is using USB to
talk to it.

The only catch is to actually drive your motor you *will need*
an external driver either a chip or a stepper amplifier that
can provide power to your motor. Lpc2148 is a CMOS chip and can
output +/- 4 mA per pin which is not enough to drive any stepper
motor that I know.

Check the Electronics section to get an idea of what is needed
for even a fairly small stepper motors used by the Fab@home
3D printer.

http://www.fabathome.org/wiki/index.php?title=Fab
%40Home:Model_1_Electronics

>
> Kevin
>

Pawel
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

RE: Re: Stepper Motor Driver (LPC21xx, etc.) - Tim Mitchell - Sep 17 4:04:07 2008

Robert Adsett wrote:
> At 04:01 PM 9/16/08 -0400, Charles R. Grenz wrote:
>> Kevin Townsend wrote:
>>> Is it realistic to implement something using only an ARM7 processor,
>>> or is it just not worth the effort? I'm not objectionable to using
>>> an external chip, but would have preferred a software approach if
>>> possible ... though I have no idea how feasible that would be (ergo
>>> this post).
>>>
>>> Kevin
>>
>> Hi Kevin,
>>
>> You will need to use an external driver and you will not have
>> enough time to perform all the necessary control directly from the
>> 2148. That's the short answer. What I was going to ask you are the
>> following:
>
> Will not enough time seems somewhat pessimistic (depends on how fast
> you are expecting to move the motors of course). Many a moon ago I
> did two axis microstepping on a Z80 and on a 5MHz 186. A 2148 with
> timing peripherals would run circles around those setups. Then again
> we were running slow enough for open loop to be sufficient.
>

I am sure it will be possible to do it in software.

I have driven 4 motors with 16-microstep resolution from an 8051 running
at 16MHz, while receiving DMX512 serial data at 250KBaud, so an Arm-7
will have no problem. I used 2 simple ULN2803 darlington drivers to
power the stepper motor coils. The microstepping was done by software
pwm of the drive outputs. This product was a range of disco lighting
scanners which required smooth fast movement.

What you lose with this method is torque. If you need maximum torque
from the motors you will need to use a proper stepper driver chip which
can drive high current into the motor coils.

--
Tim Mitchell
------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )

Re: Stepper Motor Driver (LPC21xx, etc.) - ksdoubleshooter - Sep 22 11:21:17 2008

Check out this link.

http://www.embedded.com/columns/technicalinsights/56800129?
_requestid=3D437606

I've ported and tweaked that code for use on an LPC2103 and it works=20
quite well. I used an Allegro A3982 driver chip.

Jeff

--- In l...@yahoogroups.com, "Kevin Townsend" =20
wrote:
>
> Charles:
>=20
> Thanks for the replies.
>=20
> > 1) What is the fastest steps per second you are going to run?
>=20
> The longest distance the motor will need to drive an object will=20
be=20
> around 1m, so I would guess that 200 steps per second is probably=20
> sufficient, or a maximum of 400, since the aim is smooth,=20
> controllable motion more than speed.
>=20
> > 2) Are you going to need microstepping?
>=20
> Probably not. 1.8=B0 is more than likely precise enough.
>=20
> > 3) Are you going to run all 3 motors at the same time?
>=20
> There are ocassions where I will need to run all three, yes,=20
though=20
> if necessary it may be possible to restrict movements to two axis=20
> even if three would be preferrable.
>=20
> > 4) Are you going to need acceleration/deceleration?
>=20
> Yes, since I will need to ease into and out of the motion over a=20
> variable amount of time. (For 10 seconds of movement, the user=20
may=20
> rquire 2 seconds of ease in and 2 seconds of ease out, for=20
example.)=20=20
> This 'easing' in and out is essential to get decent results for=20
the=20
> intended application.
>=20
> > 5) What is the current per phase of the largest motor?
>=20
> I need to do some tests to determine which motors I will end up=20
> using, since I need to support a load of up to about 8 KGs. I=20
have=20
> ordered a few motors to try, but I can't say for the moment until=20
I=20
> do some tests.
>=20
> > 6) What is the operating voltage of the driver?
>=20
> Again, it depends on what motor I find that can most dependable=20
> support an appropriate load. In any case, I will need to keep=20
things=20
> 12V or under for the motors if its possible.
>=20
> PS: If you prefer, I don't mind emailing you about this. Just=20
let=20
> me know your preference.
>=20
> Kevin
>

------------------------------------



(You need to be a member of lpc2000 -- send a blank email to lpc2000-subscribe@yahoogroups.com )