Re: PICS as replacements for L297s
Posted by
Alan Rothenbush
on 2001-04-21 10:05:28 UTC
> Subject: Re: Re: PICs as replacements for L297sIan;
>
> A number of people say they have gone through the torment of programming
> PICs to drive steppers etc., so how about someone sharing their knowledge?
I'd be quite happy to share the knowledge, but in at least one case, I've
sold the design and therefore it's not really mine to give away.
But let me add a few things.
1. It wasn't a torment. It wasn't really that hard at all. Basic operation
came quick - optimized to ABSOLUTE maximum performance took a bit longer,
but my first attempt actually served me well for two years.
Hint: ensure you understand the shape and nature of the signals coming
out of the PCs parallel port. CNCPro uses roughly 50% duty cycle
square waves, while others use short ( 2 - 20uS ) duration pulses
or either positive or negative polarity. There seems to be no
standard and perfectly reasonable cases can be made for all three
signalling schemes.
If using a PIC with an interrupt, it's all no big deal. If using the
ubiquitous F84, though, you have to be a bit more clever to ensure
operation with all three types of signals. It IS possible, though,
as the F84, while officially lacking an interrupt, has something
even better for this particular task !
2. PIC programming isn't THAT hard. TimG seemed to pick it up more or less
from ground zero in a few days. Took me about two months, so somewhere in
the middle should be a reasonable target.
But resist the temptation to use Basic .. in fact, just don't do it for
THIS sort of project. For projects less time-critical, go right ahead.
But for this one, learn assembly language.
Do yourself a favour and DON'T use Microchip's assembler.
Use CVASM16 from Tech-Tools .. it's an 8051 like assembler that uses mnemonics
that are almost human readable. It will be a little bit more work to use some
of the other tools you might need, but the learning curve is a lot shorter.
3. Download all the applications notes from SGS-Thomson and NJR/Ericcson on
stepper motors. Once those have been read and understood, the actual code
required is simple enough to visualize.
A PIC replacement for an L297 or a 3517 in full step is about 25 lines of
code, half step about double that. Add another 10 lines or so of
initialization code and you're done.
Alan
--
Alan Rothenbush | The Spartans do not ask the number of the
Academic Computing Services | enemy, only where they are.
Simon Fraser University |
Burnaby, B.C., Canada | Agix of Sparta
Discussion Thread
Alan Rothenbush
2001-04-21 10:05:28 UTC
Re: PICS as replacements for L297s
Larry Edington
2001-04-21 12:06:00 UTC
Re: PICS as replacements for L297s