Author Topic: lpc2103: PWM for Stepper Motor  (Read 7456 times)

0 Members and 1 Guest are viewing this topic.

Offline s.mosfetTopic starter

  • Contributor
  • Posts: 48
lpc2103: PWM for Stepper Motor
« on: February 12, 2011, 04:28:30 pm »
I should control 2 Stepper Motors with the LPC2103 microcontroller (ARM).
It supplies:
- 4 timers
- each timer can produce 3 PWM signals.
The problem is that i should produce 4 PWM signals to control the motor with 4 phases (see pic)...

How to do this?
 

Offline mikeselectricstuff

  • Super Contributor
  • ***
  • Posts: 13745
  • Country: gb
    • Mike's Electric Stuff
Re: lpc2103: PWM for Stepper Motor
« Reply #1 on: February 12, 2011, 05:33:39 pm »
You wouldn't use PWM mode as you want to control the position of both edges.
The set/clear on match functions are probably useable for this if there are enough pins.
Youtube channel:Taking wierd stuff apart. Very apart.
Mike's Electric Stuff: High voltage, vintage electronics etc.
Day Job: Mostly LEDs
 

Alex

  • Guest
Re: lpc2103: PWM for Stepper Motor
« Reply #2 on: February 12, 2011, 05:37:34 pm »
Are you allowed to use external ICs or you must only use the NXP MCU?
« Last Edit: February 12, 2011, 06:08:40 pm by Alex »
 

Offline JohnS_AZ

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
    • About.me
Re: lpc2103: PWM for Stepper Motor
« Reply #3 on: February 12, 2011, 05:58:28 pm »
You wouldn't use PWM unless you wanted to microstep the motors. Plain digital outputs into a driver transistor should do fine.
I'm either at my bench, here, or on PokerStars.
 

Offline s.mosfetTopic starter

  • Contributor
  • Posts: 48
Re: lpc2103: PWM for Stepper Motor
« Reply #4 on: February 12, 2011, 06:28:37 pm »
i would use only the MCU (and a driver IC..)

....
Can i use the PWM outputs to make these types of signals?
or i must create it with the code?
 

Offline JohnS_AZ

  • Frequent Contributor
  • **
  • Posts: 499
  • Country: us
    • About.me
Re: lpc2103: PWM for Stepper Motor
« Reply #5 on: February 12, 2011, 06:42:16 pm »
Even if you use PWM, you'll still need to step the outputs in the proper sequence to drive the motor.

You can either do the step sequence in code, or you can add external circuitry to generate it.  I would do it in code.
I'm either at my bench, here, or on PokerStars.
 

Alex

  • Guest
Re: lpc2103: PWM for Stepper Motor
« Reply #6 on: February 12, 2011, 06:45:54 pm »
Then you can use a Capture-Compare module or even a timer connected to the main clock with a suitable divided.

As mentioned, you do not need to use PWM for single or half stepping. The final application might be a bit noisy when the motors are rotating.

There are external drivers that you can just assert the direction and then send clock pulses for the required number of steps. They include the power drivers (H-bridges). I have used one from ST in the past and still have the schematic on paper if you want to go down that route and simpy use a stepper motor in your applications.

Hvae a look on Microchip, they have an excellent app-note on stepper motors fundamentals.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf