Roy Spiller
New Member
Hi I have enclosed a part of the program I am using to spool tape off one spool to another spool. It is working fine it stops just before the end and then move on to rewind. I would like to change it slightly I would like to stop and reverse at a point I select. At the moment the count is about 11600 pulses from each encoder on each spool when they meet they stop and reverse. D.1 and b.1 are my counters I have added the extra 3 to w11 to make sure the two counts don’t meet at the start. I would like to stop at about 30 pulses short of the finish I can’t add a number to w10 before it starts because it will stop when it reaches that number. So I’m stuck.
brake:
high b.6
pause 150
low c.5
w10 = 0 ;supply motor pulse
w11 = 3 ;takeup motor pulse
low a.6 ;c.1 motor brake off
low b.6 ;c.2 motor brake off
low b.3 ;supply motor dir
low b.7 ;takeup motor dir
pwmout c.1, 199, 630
pwmout c.2, 199, 300
do
If pinD.1 <> bit0 Then
bit0 = bit0 ^ 1
w10 = w10 + 1
End If
If pinB.1 <> bit1 Then
bit1 = bit1 ^ 1
w11 = w11 + 1
End If
if w10 = w11 then high b.6 high a.6 goto rewind ; brakes on and led on
end if
loop
any help would be a Appreciated
Best regards
Roy
brake:
high b.6
pause 150
low c.5
w10 = 0 ;supply motor pulse
w11 = 3 ;takeup motor pulse
low a.6 ;c.1 motor brake off
low b.6 ;c.2 motor brake off
low b.3 ;supply motor dir
low b.7 ;takeup motor dir
pwmout c.1, 199, 630
pwmout c.2, 199, 300
do
If pinD.1 <> bit0 Then
bit0 = bit0 ^ 1
w10 = w10 + 1
End If
If pinB.1 <> bit1 Then
bit1 = bit1 ^ 1
w11 = w11 + 1
End If
if w10 = w11 then high b.6 high a.6 goto rewind ; brakes on and led on
end if
loop
any help would be a Appreciated
Best regards
Roy