Presentation is loading. Please wait.

Presentation is loading. Please wait.

Safety Framework and Program Management

Similar presentations


Presentation on theme: "Safety Framework and Program Management"— Presentation transcript:

1 Safety Framework and Program Management
Trio Training Safety Framework and Program Management

2 Course Overview In this module you build on the pre reading to program a motion manager program. By the end you should have an understanding of the following concepts: Error detection and handling Program management

3 Program Structure Drives Disabled Drives Enabled Machine Disabled
Motion Error Drives Disabled Machine Active Machine Datuming Running Motion Drives Enabled

4 Running and Stopping programs
RUN “program_name” [, process] Runs a program on a particular process The process can be left off and it will run on the highest process number available Program must exist else an error occurs at runtime STOP Stops the current program STOP “program_name” [, process] Stops a specified program The process can be left off and it will stop all instances of the program HALT Stops all programs

5 Stopping Motion Motion can be stopped either across all axis or on a single axis CANCEL Stops the running move on the base axis RAPIDSTOP Stops the motion on all axis CANCEL(2) and RAPIDSTOP(2) Stops the motion, clears buffered moves and the PMOVE

6 Printing You can print information to terminal windows in Motion perfect, the serial ports or to a file. PRINT “text” Prints text to channel 0 on the coordinator PRINT#channel, “text” Prints text to specified channel Channel 5 is a terminal window in Motion Perfect Other channels are shown in the manual

7 Print status message to user Exits to MACHINE ACTIVE
Machine Disabled Machine Datuming Running Motion Motion Error Active Drives Disabled Enabled Machine Disabled Stop running programs Stop all motion Set status Machine status Datuming status Print status message to user Exits to MACHINE ACTIVE Master Switch ON

8 Machine Disabled machine_disabled: REPEAT
STOP "TUNING" 'Stop all programs from running STOP "DATUMING" STOP "MOTION1" RAPIDSTOP(2) 'Stop all motion WAIT IDLE AXIS(0) 'Wait for motion to stop WAIT IDLE AXIS(1) OP(8,OFF)'switch off status LED WDOG=OFF datum_complete=0 'set datum status flag OP(9,OFF) 'set datum status led PRINT#5, "Machine Idle" PRINT#5, "Turn switch 2 ON to start“ WAIT UNTIL IN(2)=ON 'wait for machine to be turned ON RUN "STARTUP" 'apply initial settings GOSUB machine_active UNTIL FALSE STOP

9 Print status message to user Select program to run Drives
Machine Active Enable Drives Set Status Print status message to user Select program to run Datum Motion Exits to MACHINE DATUM Master switch ON and datum not complete Exits to RUNNING MOTION Master Switch ON and datum complete Exits to MOTION ERROR On Motion Error Exits to Machine Disabled Master switch OFF Machine Disabled Datuming Running Motion Motion Error Drives Enabled Machine Active

10 Machine Active machine_active: WHILE IN(2)=ON
WDOG=ON 'Enables the motors OP(8,ON)'Turn on machine active lamp PRINT#5,"Press button 3 to" IF datum_complete THEN PRINT#5, "start motion" ELSE PRINT#5, "start datuming" ENDIF WAIT UNTIL IN(3)=OFF OR IN(2)=OFF OR MOTION_ERROR WAIT UNTIL IN(3)=ON OR IN(2)=OFF OR MOTION_ERROR IF MOTION_ERROR THEN GOSUB motionerror ELSEIF datum_complete AND IN(2)=ON THEN GOSUB running_program ELSEIF NOT datum_complete AND IN(2)=ON THEN GOSUB datuming WEND RETURN

11 Machine Datuming Run DATUMING program Drives Enabled
Disabled Running Motion Motion Error Active Drives Enabled Run DATUMING program Exits to MACHINE ACTIVE Datuming Complete Exits to MOTION ERROR On Motion Error Exits to Machine Disabled Master switch OFF Machine Datuming

12 Machine Datuming datuming:
RUN "datuming",2 'move the motors to the home switch 'Stall this program until homing is complete WAIT UNTIL PROC_STATUS PROC(2)<>0 OR IN(2)=OFF OR MOTION_ERROR WAIT UNTIL PROC_STATUS PROC(2)=0 OR IN(2)=OFF OR MOTION_ERROR IF MOTION_ERROR THEN GOSUB motionerror ELSEIF IN(2)=ON THEN datum_complete=1 'set homing status flag OP(9,ON) 'set homing indicator PRINT#5, "Homing Complete" ENDIF RETURN

13 Select motion program from switch Run motion program
Running Program Machine Disabled Datuming Motion Error Active Drives Enabled Select motion program from switch Run motion program Exits to MACHINE ACTIVE Program Complete Exits to MOTION ERROR On Motion Error Exits to Machine Disabled Master switch OFF Running Motion

14 Running Program running_program:
ON (IN(4,5)+1)GOTO prog_a, prog_b, prog_c' select program from switch GOTO continue prog_a: RUN "tuning",2 PRINT#5, "Running Tuning" prog_b: prog_c: continue: 'Stall this program until motion is complete WAIT UNTIL PROC_STATUS PROC(2)<>0 OR IN(2)=OFF OR MOTION_ERROR WAIT UNTIL PROC_STATUS PROC(2)=0 OR IN(2)=OFF OR MOTION_ERROR IF MOTION_ERROR THEN GOSUB motionerror ELSEIF IN(2)=ON THEN PRINT#5, "Program Complete" ENDIF RETURN

15 Clearing Errors When an error occurs all SERVO are set to off and the error is held in AXISSTATUS Errors can be cleared using the DATUM command DATUM(0) Special instance of datum Resets AXISSTATUS errors Following error warning Remote drive communication error Remote drive error Following error exceeds limit

16 Print status message to user Flash status lamp Clear motion error
Machine Disabled Datuming Running Motion Active Drives Enabled Motion Error Print status message to user Flash status lamp Clear motion error Exits to MACHINE Disabled Master switch OFF

17 Motion Error motionerror: PRINT#5, "Motion Error!"
PRINT#5, "Axis ";ERROR_AXIS[0] PRINT#5, "Cycle switch 2 to restart." REPEAT 'flash status lamp OP(8,ON) WA(200) OP(8,OFF) UNTIL IN(2)=OFF DATUM(0) 'clears motion error SERVO AXIS(0)=ON 'Activates the servo closed loop SERVO AXIS(1)=ON RETURN

18 Task Please add a new program “MAIN” to your project
Follow the handout Chapter 4 to create the state machine


Download ppt "Safety Framework and Program Management"

Similar presentations


Ads by Google