PDA

View Full Version : Problem with Stepper.



robodam
11-03-2009, 08:25 AM
Can anyone help me out. I have a Unipolar Stepper motor having 14 teeths on its rotor and with 6 wires. I puchased it from Everest sales, 629 LRM NewDelhi.I have programmed it with the following code:
ORG 0H
MOV A,#66H
MOV R0,#32
HERE: RR A
MOV P2,A
ACALL DELAY
DJNZ R0,HERE
DELAY: MOV R3,50
BACK:MOV R4,255
HERE4:DJNZ R4,HERE4
DJNZ R3,BACK
RET


END

The motor is working fine,but the problem is on starting ,the motor revolves nearly 180 degree. on pressing reset , it turnes again same angle.But second time I press reset it starts taking nearly 3 complete revolution.I am using iboard 8051 withL293 drivers to drive the motors.
Please help!!! :?

allbits
11-03-2009, 10:00 PM
post the circuit dia.

robodam
11-04-2009, 12:17 AM
I puchased Iboard 8051 from TRI. It has motor driver on it and motor interfacing on board itself. I directly made the connection from the board to the stepper.

vikas
11-04-2009, 07:23 AM
Then why dont you ask TRI. TRI is perfectly capable of handling such support requests and can help you better since they designed the circuit and have full details of it.

Ri is not a TRI support forum.Why so many people buy at TRI And then come here looking for how to use ??? .

robodam
11-04-2009, 09:43 AM
Sir,I am not asking how to use.
Through Ri I only wanted to know ,is anything wrong with the code. 8)

allbits
11-04-2009, 11:55 PM
the code depends on your circuit. Without the circuit, there is no point in looking at the code.

So when i ask you about the circuit, what you tell me is your board, form which i understand you expect me to browse tri website, find the board, request for a circuit diagram, and debug the code and help you??

I will, if you pay me.

I hope you get the real point i am making here.

Adwait
11-05-2009, 04:14 PM
tri's iBoard has motors connected to P1.4-7 and P2.4-7

Its been ages since i have dome 8051 Assembly so i dont want to look into it. But code seems right.
If it is giving variable behavior on rest, make sure your subroutines are right. Also call a small delay before you start your program. it's a good practise

allbits
11-05-2009, 08:54 PM
That code WONT work.

If it seems to work, its probably because the controller is resetting. The code is not in an infinite loop. There have to be some instruction before the delay routine.

Take a good look and you will know what i mean.

robodam
11-08-2009, 12:51 PM
Sir,This code is to turn the stepper for some fixed degrees,So i don't think there is any need of infinite loop.In my stepper motor there are 14 teeths so I cant get accurate angle by calculation.But this program is ideally for the stepper with 15 teeths.