Yaskawa MP940-MW+ User Manual

TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Subject: MotionWorks+ Simple Template Program
Product: MP-940, MotionWorks+ v2.83 or later
Who should read this document?
Anyone is who is attempting to program an MP-940 Machine Controller, using MotionWorks+ programming environment. This document illustrates a standardized template program to be used while programming the MP-940 with MotionWorks+. The template includes three main programs:
1) Supervisor
2) Manual
3) Automatic
In addition, eight subroutines are called from two of the main programs. The subroutines include:
1) Jog Forward
2) Jog Reverse
3) Homing
4) Indexing with Programmable Limit Switch (PLS)
5) Gearing
6) Camming
7) Torque
8) Latch with PLS
The program described in this document is meant to be used a starting point for virtually all MP-940 with MotionWorks+ applications. Make use of the subroutines that are appropriate for the application and discard the subroutines that are not.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 1 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Table of Contents
Summary............................................................................................................................4
Programs ............................................................................................................................4
Program Definition ........................................................................................................4
Program Guidelines .......................................................................................................5
1: Supervisor ..................................................................................................................6
Start-up.......................................................................................................................7
Fault Detection...........................................................................................................8
Disable Handler .........................................................................................................8
Fault Recovery...........................................................................................................9
2: Manual .....................................................................................................................10
3: Automatic.................................................................................................................11
Subroutines ......................................................................................................................12
02 Jog +........................................................................................................................12
03 Jog –........................................................................................................................12
04 Home.......................................................................................................................13
05 Move .......................................................................................................................13
Programmable Limit Switch (PLS) .........................................................................14
Timer........................................................................................................................14
06 Gear.........................................................................................................................15
Engaging/Disengaging.............................................................................................15
Running....................................................................................................................16
07 Cam.........................................................................................................................16
Engaging ..................................................................................................................16
Disengaging .............................................................................................................16
08 Torque.....................................................................................................................17
09 Latch .......................................................................................................................17
Latch Target Block ..................................................................................................18
Configuration ...................................................................................................................18
System Parameters.......................................................................................................19
System Properties ........................................................................................................20
SGDH.......................................................................................................................21
MP940......................................................................................................................22
COM1 ......................................................................................................................23
COM2 ......................................................................................................................24
Network....................................................................................................................25
External Encoder......................................................................................................26
Data..................................................................................................................................26
Constants......................................................................................................................27
Network........................................................................................................................28
Tables...........................................................................................................................29
Variables ......................................................................................................................30
I / O ..............................................................................................................................31
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 2 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Local Input functionality .........................................................................................32
Local Output functionality.......................................................................................33
System Variables .........................................................................................................34
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 3 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Summary
This document outlines the details of a template example program for an MP-940/SGDH system. In particular, it was designed with the Yaskawa demonstration (YEA Part # DEMO4700) unit in mind; however, it can be modified to suit virtually any application, and is commonly used as a starting point when programming the MP940 using MotionWorks Plus.
There are three main programs: Supervisor, Manual, & Automatic. The Supervisor program is the only of the three that is auto-starting. Once it starts and some conditions are satisfied, it starts both Manual & Automatic program. In addition, there are seven subroutines: 02 Jog+, 03 Jog-, 04 Home, 05 Move, 06 Gear, 07 Cam, 08 Torque, and 09 Latch.
While the Manual & Automatic programs may be running, various conditions must be met for them to start a sub-routine. All of these programs, as well as the configuration for the system will be discussed. This will be completed in the order that a program in MotionWorks+ is laid out, according to the Project Explorer window.
Programs
The Programs folder contains the following: Supervisor, Manual, and Automatic programs.
Program Definition
Using MotionWorks+ up to eight main programs or tasks are possible. A program can run in either the High or Low speed Scan. The action or blocks in the program will update at the selected scan rate.
Auto start is also a possibility for each program. This template program has one program that is auto starting (Supervisor). Once that program has started and various conditions have been satisfied, it will start the other programs. If the supervisor detects a fault, error, or other event it will stop the other programs. This programming methodology creates a solid infrastructure to build from so that each individual program does not have to monitor for errors, there is one program the does that and coordinates appropriately.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 4 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Lastly, a task can be Active or not. A deactivated program may be some code for feature that is not available in a particular machine. Keep in mind; deactivated programs still count towards the maximum of eight total tasks.
Program Guidelines
As a guideline it is recommended that each “program” contain a maximum of 64 total blocks including all subroutine blocks called from within the program (not including start and stop blocks). [Version 2.83 of MotionWorks+ includes an update to the compiler that lifts this restriction, but it is still a good programming practice] In this example, the Supervisor program utilizes 34 blocks; the Manual program utilizes 35 blocks; the Automatic program utilizes 44 blocks. In addition, it is also recommended that execution of motion effecting blocks, only be active in one program at a time. For this reason, the Manual and Automatic routines are interlocked such that they can only operate exclusively.
Blocks that affect motion include the following:
Move Axis Jog Stop Home CAM Change Dynamics Define Position Gear Latch Target Scale CAM Servo Enable Torque Slave Offset
The Supervisor routine utilizes the Servo ON, Stop, and Change Dynamics block, but is closely monitoring the other programs to ensure that there is no overlapping. Some precautions must still be followed with the use of Motion Effecting blocks.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 5 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
1: Supervisor
The Supervisor is quite daunting at first glance, however, once broken down it is not that difficult to follow. It can be separated into four distinct sections: Start-up, Fault Detection, Disable Handler, and Fault Recovery.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 6 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Start-up
The start-up section encompasses block 3-6, 10, and 31. It is responsible for startup. Block 31 is executed only once (upon power up) and can be useful for setting user variables, or outputs that need to be reinitialized at power up, but may be variables themselves. Block 3 has the condition “False” in and provides a point to loop back the end of the flow chart, and ensures that all blocks have connections. The balance of the blocks regulates a normal start up.
Block 4 must see the rising edge of Local_Input1, this assures that input was activated to enable system, rather than just left on all of time. Block 5 enables the servo. Local_Output1 and (user variable) [SystemOk] is set in Block 6. The [System Ok] variable is used by the two other main programs a signal that it is Ok to execute. The last block (10) starts the other main programs (Manual and Automatic). Lastly Local_Output4 is set if the system had been previously homed. Only a power cycle will clear the [Homed] bit indication.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 7 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
Fault Detection
After the start-up section has been completed successfully, the next section, and the section that the program will be in most is the Fault Detection / Disable loop. All of the If Event (including a special If Fault) blocks are designed to detect various faults and errors in the system. When an error is detected, the next block that is executed is a Set Variable block that sets an internal flag to trap the type of error that occurred and may also capture some pertinent data. Lastly, Set Variable block (27) is executed, which sets an internal fault flag and clears the SystemOk flag, then execution continues to disable handler. If the user simply turns off of the enable input (Local_Input1), execution continues to disable handler. One thing to keep in mind is that block 21 does not detect ServoPack warning conditions. ServoPack warning conditions include any A.9x (where x = 0 – F) alarm code display on SGDH display. The programmer may want to include additional code to detect these conditions and notify the operator. For example A.91 is a torque overload warning, indicating that continued operation of the machine at this rate will result in an A.71 or A.72 torque overload alarm.
Disable Handler
When a fault or a normal disable is detected, this section of code executed. The first block (29) stores the commanded and actual position (these may be useful in a recovery routine). Next, the other main programs are halted; the servo is commanded to go to zero speed (25), then stop (26), and lastly the Servo Off block (8) is executed.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 8 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
If a fault has occurred block (28) will direct execution to the fault recovery section, otherwise block (9) is executed. Block (9) clears all of the outputs that may have inadvertently left on. The Disable handler and the fault recovery routine both make use of Block (20). It is simply a timer that ensures everything has settled down before attempting a restart. After block (20) execution continues back to block (3).
Fault Recovery
Once it has been determined that a fault occurred and the appropriate blocks have executed, the program ends up in the fault recovery section. Block (16) sets an output to indicate that a fault has occurred (in the case of the demo box, it actually sets all eight outputs). Input block (17) waits to see the rising edge transition of SGDH input SI-4 (coincidently, the Servo Alarm Reset input when the ServoPack is used alone). Reset fault block (18) is a special block that will reset any ServoPack alarm that does not require a power cycle to reset. Lastly, Set Variable blocks 19 and 38 clear the alarm output and take care of clearing all of the internal error bits. Block (20) was discussed above in the Disable Handler section. Conveniently, the blocks in the fault detection section latch the fault type so the operator can tell what type of fault occurred prior to resetting it. For example if the user variable ‘ErrorCPU’ = 1, then user will know that a MP-940 CPU error occurred. The error code is trapped in another user variable, ‘ErrorCPUCodeTrap.’ Be sure to check these prior to activating the alarm reset, as the bit indications are cleared during an alarm reset sequence.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 9 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
2: Manual
Functions typically performed while in a “manual” mode are included in the manual main program. While this program is executing it is waiting for the user to activate an input to select a subroutine program. As long as no input is selected the program scans the blocks in order of 3, 4, 5, 6, 9, and 11 then back to 3.
Two key features in this program are important to mention. First, if event block (3) detects if (user variable) [SystemOk] is true. As long as this condition is true the program will stay running (recall SystemOk is controlled by the supervisor program). Second, input block (4) ensures that (Manual Mode) [!Local_Input2] has been selected. This is a critical interlock that guarantees that more than one main program is not attempting motion at the same time. This can be especially unsettling if one program is running the servo in camming mode and another program is attempting to jog.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 10 of 34 eng/PubNumber/MCD
TECHNICAL NOTE
MOTION PRODUCT AND ENGINEERING GROUP
3: Automatic
]
Functions typically performed while in an “automatic” mode are included in the automatic main program. While this program is executing it is waiting for the user to activate an input to select a subroutine program. As long as no input is selected, and not in manual mode, the program scans the blocks in order of 3, 4, 5, 8, 11, 14 then back to 3.
Two key features in this program are important to mention. First, if event block (3) detects if (user variable) [SystemOk] is true. As long as this condition is true the program will stay running (recall SystemOk is controlled by the supervisor program). Second, if event block (4) ensure that (Auto Mode) [Local_Input2] has been selected (in other words if the machine is not in manual mode, it is in automatic mode) & (homing sequence has been completed) [Homed] = true. This is a critical interlock that guarantees that more than one main program is not attempting motion at the same time. This can be especially unsettling if one program is running the servo in camming mode and another program is attempting to jog.
If a user puts the machine in automatic mode, attempts to execute an automatic subroutine, nothing will happen, as execution is held at block 4.
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
5/22/2003 11 of 34 eng/PubNumber/MCD
Loading...
+ 23 hidden pages