The following code only causes the stepper motor to oscillat

The following code only causes the stepper motor to oscillate in a small section. How can it be modified to allow the stepper motor to make a full revolution? This is using an 8051, connected to a 7404 then to 4 transistors and fianlly to the stepper motor (J835L, 120ohm, 7.5deg, unipolar). Using Port 2 of the 8051, P2.0 through P2.3.

Connection info:
Connect the stepper motor, J835L, using the HEX inverter outputs (pins 2, 4, 6, 8) and transistor interface that can source current for the J835L stepper motor. Use the following information to setup the hardware.
+5V White Wire from J835L Stepper Motor to Interface Circuit
GND Black wire from 8051 Trainer
Q1Collector Yellow Wire from J835L Base of Q1 to Pin 2 of 7404
Q2 Collector Purple Wire from J835L Base of Q2 to Pin 4 of 7404
Q3 Collector Orange Wire from J835L Base of Q3 to Pin 6 of 7404
Q4 Collector Blue Wire from J835L Base of Q4 to Pin 8 of 7404

ORG 0000H
MOV A, #33H
L1: MOV P2,A ;MOVE DATA TO PORT2: P2 DATA TO DRIVER CIRCUIT
RR A ;ROTATE RIGHT - CLOCKWISE
ACALL DELAY
SJMP L1
DELAY:
MOV R2, #10
HERE3:   MOV R3, #100 ;HERE TO RETURN IS TIMING STEP OF MOTOR
HERE2:    MOV R4, #255 ;TIMING
HERE: DJNZ R4, HERE
DJNZ R3, HERE2
DJNZ R2, HERE3
RET
END

Solution

for the given stepper motor for each step movement is 7.5 degree, so it need

360/7.5=48 steps for full revolution,

No. of teeth= 12,

movement in 4 steps( for full drive mode)=30 degree

To move the rotor 360 degrees, we need to send 12 consecutive four-step sequences, since 12×4 steps x 7.5 degrees = 360 degrees.

so please try this code:

ORG 0000H
MOV A, #33H
L1: MOV P2,A ;MOVE DATA TO PORT2: P2 DATA TO DRIVER CIRCUIT
RR A ;ROTATE RIGHT - CLOCKWISE
ACALL DELAY
SJMP L1
DELAY:
MOV R2, #12
HERE3:   MOV R3, #100 ;HERE TO RETURN IS TIMING STEP OF MOTOR
HERE2:    MOV R4, #255 ;TIMING
HERE: DJNZ R4, HERE
DJNZ R3, HERE2
DJNZ R2, HERE3
RET
END

so we need to rotate

The following code only causes the stepper motor to oscillate in a small section. How can it be modified to allow the stepper motor to make a full revolution? T
The following code only causes the stepper motor to oscillate in a small section. How can it be modified to allow the stepper motor to make a full revolution? T

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site