acceleration of stepper motor

cancel
Showing results for 
Search instead for 
Did you mean: 

acceleration of stepper motor

499 Views
poojafsingh
Contributor I

hello,

i am currently working on acceleration of steeper motor using LPC1768. there is a acceleration table for it which i have to follow. can anyone help me with code on how to approach. by PWM or by timer or by following some library.

the table looks like this.

pastedImage_1.png

Labels (1)
0 Kudos
6 Replies

419 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Pooja,

You are right, if you use two winding of stepper motor, it is okay to use MCPWM module, the CTimer module is NOT capable of controlling the motor.

BR

XiangJun Rong

0 Kudos

419 Views
poojafsingh
Contributor I

how do i approach with MCPWM?. i saw a application note which uses MCPWM to control the BLDC. http://www.strong-ic.com/upload/1336633627_407.pdf . but in this note it uses a hall ssensor to get the position of the motor.

all i need to know is if i want to accelerate my stepper motor in 40 steps(may be using for loop) each time i might have to change to different time according to the table. so how do i solve that problem.

0 Kudos

419 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Pooja,

First of all, as you know that the stepper motor does not need closed loop, the hall sensor is NOT required.

Regarding the accelerating table, i think you can develop a table based on your required accelerating curve which define the PWM cycle time and duty cycle, you can use PIT to generate ISR, in the ISR you can assign the one vector in the table to the registers of PWM which can specify the PWM cycle time and duty cycle.

Hope it can help you

BR

XiangJun Rong

0 Kudos

419 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi, Pooja,

Do you just ONE PWM signal to control stepper motor?

If you just need one PWM signal to control stepper motor, you can use 50% duty cycle PWM to control motor, the PWM signal can be from CTimer or PWM modules.

For example

Pulse rate(pps)                       PWM cycle time(ms),      PWM duty cycle,

111                                         9                                          50%

179                                         5.58                                      50%

....................

1033                                       0.968,                                    50%

Assume that the PCLK is 10MHz, the match3 of CTimer controls the cycle time of PWM signal, the match0 control the PWM duty cycle, this is the list:

Pulse rate(pps)                       PWM cycle time(ms),      PWM duty cycle,   match3 register,          match0 register

111                                         9.027                                    50%                      90270                          90270/2=24135

179                                         5.58                                      50%                      55800                          55800/2

....................

1033                                       0.968,                                    50%                    9680                              9880/2

From firmware, you have to generate interrupt for each PWM cycle, then in ISR, compute the updated match3 and match0 register value.

If you need two or more PWM signals to control stepper motor, you have to use PWM signal from PWM module, because there is timing requirement for the two PWM signals.

Hope it can help you

BR

XiangJun Rong

0 Kudos

419 Views
poojafsingh
Contributor I

i came across motor control PWM (MCPWM)in LPC1768. will that help ?. 

0 Kudos

419 Views
poojafsingh
Contributor I

Thank you xiangjunrong‌ for the reply. I am using 4 pins to control the motor with PWM. So the timing for each PWM has to be controlled? 

0 Kudos