6-2 步进电动机实现两轴联动直线运动程序(5)
发布时间:2021-06-08
发布时间:2021-06-08
电动机,dsPIC,自动控制,程序
Subr w5,#1,w5 Mov w2,ACCAL Mov w3,ACCAH Clr ACCAU
Sftac A,w4 Sftac A,w5 Mov ACCAH,w6 Mov tL,w2 Mov tH,w3
Repeat #17
div.ud w2,w6 mov w0,ACCAL clr ACCAH
sftac A,w4
sftac A,w5
Goto TB10
TB9:
Subr w4,#1,w4 Mov w2,ACCAL Mov w3,ACCAH Clr ACCAU
Sftac A,w4 Mov ACCAH,w6 Mov tL,w2 Mov tH,w3
Repeat #17
div.ud w2,w6 mov w0,ACCAL clr ACCAH
sftac A,w4
TB10:
Mov ACCAH,w0 mov w0,Ty goto TB12
TB11:
Clr Ty Clr NYL Clr NYH TB12:
MOV Tx, w0 MOV w0, OC7R
Mov w0,PR2 MOV Ty, w0 MOV w0, OC8R