initial condition:
Motor is homing from outside:
C2 = 0 C1= 0
MN = ?
MF = XXXX steps (known) forward
MB = XXXX steps (known) backward
MO = XXXX steps (known) open position
Idle routine:
looking for where to go... (mod 2, mod 3, mod 4, fastopen, fastclose)
checkset subroutine
check my pos:
read C2
MN=MB, C2=MF +/- DELTA (dead band)
RT
MN=MF, C2=MB +/- DELTA (dead band)
RT
(MA MF and MN=MF), C2=MO +/- DELTA (dead band)
RT
if I m in startup+:
set next move to startup- (MB)
return subroutine
if I m in startup-:
set next move to startup+ (MF)
return subroutine
if I m open (MO):
MA to startup+ (MF)
set next move to startup- (MB)
mod 2
call chekset
waiting for trigger
...
mod 3
call chekset
waiting for trigger
...
mod 4
call chekset
waiting for trigger
...
fastopen
MA to open pos
fastclose
if in open pos
MA to startup+
|