Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Stepper Motor and PWM enquiries

Status
Not open for further replies.

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! :D
 
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! :D

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??
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top