步进电机工作方式4相8拍怎么工作

步进电机工作方式4相8拍怎么工作,第1张

对四个绕组镇纳加电的次序:

四相四拍,也叫整游旅枣步:AB---BC---CD---DA ,

四相四拍,走四个整步,再次从头循环。

四相八拍,也叫半步:AB---B---BC---C---CD---D---DA---A,

四相八拍,每次神拆走半步,走8个半步,再次从头循环

MOV 20H,#00H 20H单元置初值电机正转位置指针

MOV 21H,#00H 21H单元置初值,电机反转位肢旦置指针

MOV P1,#0C0H P1口置初值,凳销防止电机上电枣饥游短路

MOV TMOD,#60H T1计数器置初值,开中断

MOV TL1,#0FFH

MOV TH1,#0FFH

SETB ET1

SETB EA

SETB TR1

SJMP $

***********计数器1中断程序************

IT1P: JB P3.7,FAN 电机正、反转指针

*************电机正转*****************

JB 00H,LOOP0

JB 01H,LOOP1

JB 02H,LOOP2

JB 03H,LOOP3

JB 04H,LOOP4

JB 05H,LOOP5

JB 06H,LOOP6

JB 07H,LOOP7

LOOP0: MOV P1,#0D0H

MOV 20H,#02H

MOV 21H,#40H

AJMP QUIT

LOOP1: MOV P1,#090H

MOV 20H,#04H

MOV 21H,#20H

AJMP QUIT

LOOP2: MOV P1,#0B0H

MOV 20H,#08H

MOV 21H,#10H

AJMP QUIT

LOOP3: MOV P1,#030H

MOV 20H,#10H

MOV 21H,#08H

AJMP QUIT

LOOP4: MOV P1,#070H

MOV 20H,#20H

MOV 21H,#04H

AJMP QUIT

LOOP5: MOV P1,#060H

MOV 20H,#40H

MOV 21H,#02H

AJMP QUIT

LOOP6: MOV P1,#0E0H

MOV 20H,#80H

MOV 21H,#01H

AJMP QUIT

LOOP7: MOV P1,#0C0H

MOV 20H,#01H

MOV 21H,#80H

AJMP QUIT

***************电机反转*****************

FAN: JB 08H,LOOQ0

JB 09H,LOOQ1

JB 0AH,LOOQ2

JB 0BH,LOOQ3

JB 0CH,LOOQ4

JB 0DH,LOOQ5

JB 0EH,LOOQ6

JB 0FH,LOOQ7

LOOQ0: MOV P1,#0A0H

MOV 21H,#02H

MOV 20H,#40H

AJMP QUIT

LOOQ1: MOV P1,#0E0H

MOV 21H,#04H

MOV 20H,#20H

AJMP QUIT

LOOQ2: MOV P1,#0C0H

MOV 21H,#08H

MOV 20H,#10H

AJMP QUIT

LOOQ3: MOV P1,#0D0H

MOV 21H,#10H

MOV 20H,#08H

AJMP QUIT

LOOQ4: MOV P1,#050H

MOV 21H,#20H

MOV 20H,#04H

AJMP QUIT

LOOQ5: MOV P1,#070H

MOV 21H,#40H

MOV 20H,#02H

AJMP QUIT

LOOQ6: MOV P1,#030H

MOV 21H,#80H

MOV 20H,#01H

AJMP QUIT

LOOQ7: MOV P1,#0B0H

MOV 21H,#01H

MOV 20H,#80H

QUIT: RETI END


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/12561701.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-26
下一篇 2023-05-26

发表评论

登录后才能评论

评论列表(0条)

保存