Stepper Motor and PWM enquiries

dannyboy

New Member
Anyone noes how to write the PWM codes in C to drive a stepper motor?
I'm currentll using a PIC18F452 and MPLAB 6.40 for the testing....

thanx!
 
dannyboy said:
Anyone noes how to write the PWM codes in C to drive a stepper motor?
I'm currentll using a PIC18F452 and MPLAB 6.40 for the testing....

thanx!

You wouldn't normally use PWM for a stepper motor (at least I wouldn't), you simply power the various coils in the sequence you want, full or half step, and for the direction you want. I don't see the use of PWM at all?.

I would probably do it using a table, with interrupt routines providing the stepping speed, with each step accessing the next entry in the table. It's probably easier to use seperate tables for forward and reverse, rather than try and step backwards through a table. For half stepping you simply use tables twice as long.
 
Thanx Nigel Goodwin & falleafd....

but do u guys have any examples on PWM or using tables for stepper motor??
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…