crabking
Junior Member level 1
help me with my code and my circuit.i made a linear robot,,,it will grip then slide to opposite position then go back to its original position..
the problem is the stepper motor i used did not work properly..it only vibrate
here is the code
here is the code:
clear
ti var byte
c var byte
z var byte
ti=100
trisb=0
gripper open(cw the gripper stepper):
for z=1 to 2
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay
gripper open1(cw the gripper stepper):
for z=1 to 2
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay3
close(reverse gripper stepper):
for z=1 to 2
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay1
close1(reverse gripper stepper):
for z=1 to 3
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay4
delay:
portb=0
pause 2000
goto close
delay1:
portb=0
pause 2000
goto loop
delay2:
portb=0
pause 2000
goto open1
delay3:
portb=0
pause 2000
goto close1
delay4:
portb=0
pause 2000
goto loop1
delay5:
portb=0
pause 2000
goto open
loop(cw the slider):
for c=0 to 11
portb=8
pause ti
portb=4
pause ti
portb=2
pause ti
portb=1
pause ti
next c
pause 2000
goto delay2
loop1(ccw the slider):
for c=0 to 11
portb=1
pause ti
portb=2
pause ti
portb=4
pause ti
portb=8
pause ti
next c
goto delay5
end
here is the circuit:
if you have idea please help..
the problem is the stepper motor i used did not work properly..it only vibrate
here is the code
here is the code:
clear
ti var byte
c var byte
z var byte
ti=100
trisb=0
gripper open(cw the gripper stepper):
for z=1 to 2
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay
gripper open1(cw the gripper stepper):
for z=1 to 2
portb=128
pause ti
portb=64
pause ti
portb=32
pause ti
portb=16
pause ti
next z
goto delay3
close(reverse gripper stepper):
for z=1 to 2
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay1
close1(reverse gripper stepper):
for z=1 to 3
portb=16
pause ti
portb=32
pause ti
portb=64
pause ti
portb=128
pause ti
next z
goto delay4
delay:
portb=0
pause 2000
goto close
delay1:
portb=0
pause 2000
goto loop
delay2:
portb=0
pause 2000
goto open1
delay3:
portb=0
pause 2000
goto close1
delay4:
portb=0
pause 2000
goto loop1
delay5:
portb=0
pause 2000
goto open
loop(cw the slider):
for c=0 to 11
portb=8
pause ti
portb=4
pause ti
portb=2
pause ti
portb=1
pause ti
next c
pause 2000
goto delay2
loop1(ccw the slider):
for c=0 to 11
portb=1
pause ti
portb=2
pause ti
portb=4
pause ti
portb=8
pause ti
next c
goto delay5
end
here is the circuit:
if you have idea please help..