# hi i need to increase my stepper motor speed using 89s52 timmer intruppet

Status
Not open for further replies.

#### ud23

##### Advanced Member level 3
hi i am using H bridge mosfet driver to run stepper motor with d flip-flop i am getting speed of 20rpm at frequency of 50hz(PWM) i need to run it at maximum speed of 200rpm. I tried changing my frequency up to 50khz but motor not moves and get stuck.need help i am using timer2 as intruppt.

#### kalbun

##### Full Member level 2
Hi, I think the first frequency is 5 kHz and not 50 Hz, isn't it?
You could try using half steps, this could help the motor to run more smoothly. Also be sure that there is no interrupt overrun, in that case you need to increase the clock and/or optimise the code to take less time.

#### ud23

##### Advanced Member level 3
is it possible to generate microsecond delay using for loop in C?If yes then pls send me that delay routine bcz i think to run motor fast i need 2k or 5khz frequency.

dont use sms or short hand typing skills in this forum... type the complete words by spending few more seconds. this is the last warning and further posts and thread of yours will be deleted without informing you if continued

Last edited by a moderator:

#### alexan_e

Is your motor able to run at 200 RPM?
With a 200 step motor (1.8°) you need 40000 steps/sec.

The 50Hz is a very low frequency for PWM you should probably go to 1KHz or higher but the PWM frequency in general can not change the speed of the motor (unless it is very low and slows down the motor), the duty ratio of the PWM is the one that can control the current of the motor but this is not the speed , it is the torque.
The rotation speed is based on the steps you provide to the motor coils not the PWM, if you can provide faster steps and the torque is enough then you can get faster rotation.
Sometimes to get fast rotation speed you have to apply a gradual acceleration because the motor may not be able to follow that fast step rate.

Alex

#### ckshivaram

##### Advanced Member level 5
if you need 1.085microseconds delay( if you use 11.0592Mhz) in keil there is a inbuilt function to give you that delay
it is _nop_()

for using this you should use intrins.h header file

Code:
 #include <intrins.h>

Status
Not open for further replies.