Skip to main content
feres_cherif
Associate II
March 21, 2013
Question

PWM for stepper motor

  • March 21, 2013
  • 4 replies
  • 950 views
Posted on March 21, 2013 at 23:29

hi all,

please i need help. I have to generate 2 signals PWM like this:

0690X000006037BQAQ.jpg

I think that we should insert a dead time. How to do it plz?
    This topic has been closed for replies.

    4 replies

    Tesla DeLorean
    Guru
    March 21, 2013
    Posted on March 22, 2013 at 00:14

    Set up two timers, with 50/50 duty, and frequency you want. Program the 90 degree phase difference via the CNT register of one timer with respect to the other.

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
    feres_cherif
    Associate II
    March 22, 2013
    Posted on March 22, 2013 at 11:07

    Thx Clive, i'll try it

    feres_cherif
    Associate II
    March 22, 2013
    Posted on March 22, 2013 at 12:50

    Hi Clive, please can you help me ? what is the value of this register (cnt)

    Tesla DeLorean
    Guru
    March 22, 2013
    Posted on March 22, 2013 at 14:25

    If

      TIM_TimeBaseStructure.TIM_Period = 300 - 1;

    For Duty

      TIM_OCInitStructure.TIM_Pulse = 300 / 2; // 50% for duty

    For Phase

    Delta in CNT for one timer vs other will be 75, ie 300 / 4  for 25% or 90 degree phase shift

    Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..