
;This is position gains tuning program. A3 input should be activated 
;before running this program.
;Due to fact that positining application greatly vary this sample program
;is an EXAMPLE of sample motion wich may not be suitable for your particular case
;due to requirements of max speed ,acceleration,deceleration and performance goals
;
;
;*************************************************************************
UNITS =1		;set user units to revolutions
;--------------------------------------------------------------------------------------------

ACCEL = 500						;500 rps*s
DECEL = 500						;500 rps*s
MAXV   = 20						;20 Rps


	VAR_REFERENCE = 1			 ;select trajectory generator as positioning source
	VAR_DRIVEMODE = 2	 		;position  mode
	VAR_ENABLE_SWITCH_TYPE=0  	;enable switch function set to "Enable only"


;--------------------------------------------------------------------------------------------
APOS = 0
WAITENABLE:
	WAIT   UNTIL IN_A3 	;wait until A3 - hardware "enable" closed

	ENABLE			;enable drive
		
	V0=0
	OUT1 = 0;              			 ;clear "fault" output
Again:	
	MOVED 0.25 				;move 1 rev
	wait time 200				;wait time to analyse "stand still" stabillity
	MOVED -0.25 				;move oppsite direction
	wait time 200				;
	GOTO Again				;execute motions in the loop 	
;
	END					;shouldn't get here anyway

;---------------------------------------------------------------------------
;In case if fult happens... it gets here!
;---------------------------------------------------------------------------
PROCESSFAULT:
;Do your fault processing here
	
	V0=1;			;do this so you can see that it was a fault
	OUT1 =1;		;indicate fault on output too
	GOTO WAITENABLE		;continue program
				
;***************************************************************************
;
ON FAULT

	RESUME PROCESSFAULT
ENDFAULT

 
