The text of a manual · part 28 of 47
Bulletin 2803 VIM Vision Input Module User Manual: 12 - Using Math Tools, pages 237 to 246
Pages 237 to 246 of 404, from Bulletin 2803 VIM Vision Input Module User Manual
The original document is the PDF (26 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Allen-Bradley 2803-VIM2
Page 237
Chapter
Setting the Acceptance Range
12
Using Math Tools 12-l 7
Once you have selected the operator and operands, you can access the Acceptance Range menu for the math tool; by accessing the Acceptawe Range menu, you can observe the current result value of the math tool, and set the upper and lower limits (the acceptance range) for the math tool. As with the line gage and window acceptance ranges, when the result of the math tool is not within the specified acceptance range for an inspection, the math tool fails, resulting in an inspection reject decision (Exception: Range limits do not apply with either the AND or OR operator). The math tool result range is subject to these limitations: l
For logical operations (AND or OR), the math tool result is always 0 (zero), and the range limits do not apply. The accept / reject decision (0 =Accept, 1 = Reject) is instead displayed as the current result value in the acceptance range display.
l
For all other operations, the math tool results are limited to a range from a lower limit of 0 to an upper limit of 65,534. If a result of greater than 65,534 is achieved, the resdt value reads 65,535, and the math tool fails.
Note: If an operand fails, the math tool result will still be computed as usual, unless the failed tool is a line gage which was unable to detect an edge. In this case, the math tool result is 65,535, and the math tool fails. To demonstrate how to set the acceptance range for the math tool, access the Acceptance Range menu, as described below: Your Action Pick the Acceptance Range icon on the Mat,h Tool menu.
Comments When you pick the Acceptance Range (“HI/LO”) icon on the Math Tool menu, the Acceptance Range menu appears:
Acceptance Range Icon f I
Acceptance Range Menu
/ Lower limit
\ Current result value
Upper limit
Page 238
Chapter 72-72
12
Using Math Tools
Setting the Acceptance Range (continued)
Comments
Your Action Observe the math tool result.
On the right side of the Acceptance Range menu are three numbers, separated by “c = ” signs. The middle number is the current result value of the math tool.
Select the limit (upper or lower) you want to change.
The lower limit is the left number of the three numbers displayed on the right side of the menu, the upper limit is the number on the right (Note: Default values are displayed for the limits initially). To select either limit, pick that limit with the light pen. The selected limit is underlined.
Acceptance Range Menu increase Limit icon f
P Decrease Limit Icon
4 increment Select icon
Select the increment.
Increase or decrease limit.
Pick the Increment SeZect icon to set the amount by which the selected limit will change when you pick the Increase Limit or Decrease Limit icon. Picking the Increment Select icon, cycle through the increment choices - 1, 10,100, and 1000.
To increase the selected limit by the amount shown on the Increment Select icon, pick the Increase Limit icon. You can increase the limit to a maximum of 65,534. To decrease the selected limit by the amount shown on the Increment Select icon, pick the Decrease Limit icon. You can decrease the limit to a value of 0. Note: The VIM2 module does not allow you to set the upper limit to a value lower than the lower limit, or to set the lower limit to a value higher than the upper limit.
When finished, pick the OK icon Picking the OK icon at this point returns the Math Tool to display the Math Tool menu. menu.
Page 239
Chapter
Setting the Acceptance Range (continued)
I2
Using Math Tools 12- 13
Using the Learn Mode and other Run Mode Functions The VIM2 module features a variation of its run mode called the learn mode. In learn mode, the VIM2 accumulates statistics for each enabled inspection tool, based on a number of trial inspections. Use of the learn mode can be helpful in determining the optimal acceptance range for inspection tools and probes. The VIM2 module also features a number of other run mode options, which can be helpful in refining your configuration. See Chapter 13 for more information regarding learn mode and other run mode options.
Accessing Statistics
Your Action Pick the Acceptance Range icon to access the Acceptance Range menu.
use of the
When you run the VIM2 module in learn mode, you accumulate statistics for all enabled visions tools and probes. To observe the collected statistics for a math tool, first access the Acceptance Range menu on the Math Tool menu: Comment5 Picking the Acceptance Range icon on the Math Tool menu displays the Acceptance Range menu.
Acceptance Range Icon
” I
/
Lower limit
I
\ Upper limit
Current result value
Pick the current result.
On the right side of the Acceptance Range menu are three numbers, separated by ” < = ” signs. The middle number is the current resuZt of the math tool. When you pick this number, the statistics are displayed (see diagram next page), and the current tool display disappears from the screen.
Pick the current result again to remove the statistics display.
Picking the current result again removes the statistics from the screen, and the current tool display reappears.
Page 240
Chapter 12- 74
12
Using Math Tools
Accessing Math Tool Statistics (continued)
Total of triggers processed
Total failures for this math too/
Lowest result collected
Highest result collected
Average of all results collected
Note: The results of failed inspections for the math tool are not included in the Zoruest,highest, and average values. These statistics are based on passing inspections only. Therefore, for preliminary trial runs, you may want to set the acceptance range to extreme limits initially, for the purpose of collecting statistics for all inspections.
Page 241
Chapter
Math TOO/ Examples
AND
OR
I2
Using Math Tools 72-75
This section provides examples demonstrating each of the eight types of math tool operation - AND, OR, Minimum, Maximum, Add, Subtract, Multiply, and Divide.
Minimum
Maximum
Add
Subtract
Multiply
Divide
For example purposes, these procedures refer to the target pattern included with this manual. See the “Quick Start Procedure” in Chapter 6 to set up the VIM2 module, peripheral equipment, and target pattern. Note: The VIM2 Decision outputs (including the Decision swingarm output, Decision LED and Decision discrete bit) always indicate a reject decision when any one of the enabled math tools, line gages, or windows fails, and indicate an accept decision when none of the tools fail. In order distinguish an individual math tool (or other tool) accept or reject result from the general inspection accept / reject decision, you must obtain the individual tool result from the results block (this means you must use a PLC and/or serial host). See Chapters 14 and 15, and Appendix C, for information regarding the use of the results block.
Using AND
The AND operator performs a logical AND of the accept / reject status of the selected operands (constants are not allowed as operands). For the AND operator, an accept decision (tool result within acceptance range) is a logic true; a reject (tool result not within acceptance range) is a logic false. If all of the selected operands are true (accept) the math tool result status is accept. If at least one of the operands is false (reject), the math tool result status is reject. The stored numerical result (in the results block) of the AND operation is always 0 (zero); measured results do not apply to the AND operator. Note, however, that the math tool accept / reject status is displayed when you access the acceptance range. The value listed is always either 0 or 1: 0 - (accept) if all tools had an accept decision 1 - (reject) if at least one tool had a reject decision Acceptance Range -The acceptance range has no meaning for the AND operation; the range limits are ignored.
Page 242
Chapter 72-76
Using AND (continued)
12
Using Math Tools
Example AND Operation
Suppose you want to measure two distinct workpiece features, such as the large black rectangle and small white square in threshold image 2 (shown below). For example, locate the edges of the black rectangle using upper (edge) functions of line gages 1-4; measure the width of the ulhite square with lower (width) functions of line gages 5 and 6.
Line Gages 1-6 shown on threshold image 2 (when configuring the line gages, only one line gage is displayed at a time).
You can group all the results for the black rectangle measurements (upper functions of line gages l-41, for example, using math tool 1, and the AND operator: AND Operator
Line Gage - Upper Function
Example Math Tool Menu first part ”
Line Gage 1
Math’Tool Menu second part
The math tool shown above ANDs together the results of the upper functions of line gages 1,2,3, and 4. That is, if any of the upper functions of the four line gages fails, the math tool fails, and the decision status is 1 (reject); if none fail, the math tool passes, and the decision status is 0 (accept). Then, by simply checking for a 1 in the decision status of math tool 1 in the results block, you can find out if an inspection failure was due to one of the four measurements of the large rectangle.
Page 243
Chapter
Using AND (continued)
12
Using Math Tools
Example
12-17
AND Operation
(continued)
In a similar fashion, you can AND together the results of the two line gages which measure the white square. You can group the results for white square measurements (lower functions of line gages 5 and 6), for example, using math tool 2 and the AND operator, as shown below:
Line Gage - f ower Function
_
Example Math Tool Menu first part wage
5
Example Math Tool Menu second part
The above math tool 2 ANDs together the decision status of the lower functions of line gages 5 and 6. That is, if either of the two line gages fails, the math tool fails, and the decision status is 1 (reject); if neither fails, the math tool passes, and the decision status is 0 (accept). By simply checking for a 1 in the decision status of math tool 2 in the results block, you can find out if an inspection failure was due to one of the measurements of the white square.
Using OR ml
The OR operator performs a logical OR of the accept /reject status of the selected operands (constants are not allowed as operands). For the OR operator, an accept decision (tool result within acceptance range) is a logic true; a reject (tool result not within acceptance range) is a logic false. If at least one of the selected operands is true (accept) the math tool result status is accept. If all of the operands are false (reject), the math tool result status is reject. The stored numerical result of the OR operation is always 0 (zero); measured results do not apply to the OR operator. Note, however, that the OR accept / reject status is displayed when you access the acceptance range. The value listed is always either 0 or 1: 0 - (accept) if any selected tool had an accept decision 1 - (reject) if none of the tools had an accept decision Acceptance Range - The acceptance range has no meaning for the OR operation, the range limits are ignored.
Page 244
Chapter 12-18
Using OR (continued)
12
Using Math Tools
Example OR Operation Suppose you want to measure the size of a distinct workpiece feature, such as the small white square in threshold image 2 (shown below), using a rectangular window to count white pixels. Suppose the workpiece can be positioned so that the small white square might end up on either the right side of the large black rectangle, or on the left side (the workpiece is rotated 180 degrees). In this case, you decide to use two rectangular windows (windows 2 and 3), positioning one over each of the two possible locations of the white square (Note: Threshold images 2 and 3 must be set up identically to show the white square box; windows 2 and 3 have the same acceptance range; window 3 is set up with the workpiece rotated so the white square appears on the left side of the black rectangle).
Window 2 positioned on threshold image 2
Window 3 positioned on threshold image 3 with workpiece rotated
Page 245
Chapter
Using OR (continued)
12
Using Math Tools 12-19
Example OR operation
(continued)
In using windows 2 and 3 to measure the same feature in two different possible locations, only one of the two windows can pass during any one inspection (the white square can only be in one of the two positions). However, if both windows fail during the inspection, then the white square box fails to meet the measurement criteria. You can use a math tool with an OR operator to combine the window 2 and 3 results into a single accept / reject result, as shown below:
Example Math Tool Menu first part
Example Math Tool Menu second part
Wind0h
+GiwP
The above math tool 3 ORs together the results of windows 2 and 3. That is, if either one of the windows passes, the math tool 3 result is 0 (accept); if both fail, the math tool 3 result is 1 (reject). By checking the result of math tool 3 in the results block, you can find out if either window passes, or if both failed. And, if either window passes, you know that the white square box passes the inspection criteria.
Using Minimum III&/
The Minimz~m operator compares the selected operands (the operands are either the measured results of selected vision tools, or a selected constant value). The math tool outputs the minimum value among the selected operands.
Example Minimum Operation
Suppose you want to measure the distance between the edges of two workpiece features, and that this distance must be above a certain minimum for the workpiece to be acceptable. To do this, you can use several line gages to measure the “gap” between the two edges, then use math tool with the Minimz~m operator to determine the lowest result among the selected line gages. You can then set the acceptance range of the math tool to reject the workpiece if the “gap” is too small at any point along the edges.
Page 246
Chapter 72-20
12
Using Math Tools
Example Minimum Operation (continued) In this case, for example, you decide to use line gages l-4 to measure the distance across the white square, at various points, in threshold image 2 (see diagram below). Then you use a math tool to find the minimum result among the four line gages. If this result is too small, the part is rejected.
Using Minimum (continued)
Note: In this case, the line gages are each set to vertical, and the Color icon of each is set to white pixels. The function icon of each is set to the first function icon - see page 9-18 - so that the line gage lower function counts the number of pixels across white square. The acceptance ranges for each of the line gages’ functions is set to extreme values, so that the line gages will not fail individually (instead, the acceptance range of the math tool with the Minimum operator is set to distinguish between acceptable or rejected workpieces).
-------
Line Gages l-4 shown on threshold imageZ...
I ------_ . _ . measuring the “gap” between the two edges
The math tool 4 shown below compares the results of the lower functions of line gages 1-4. The math tool result is the lowest of the four line gage results. You set the acceptance range so that if the math tool result is too small, the math tool fails, and the VIM2 outputs a reject decision. Line Gage -Lower
Function
Example Math Tool Menu first part
LineGag/e2 Example Math Tool Menu second pat-t
,,
YeCpgeJ,,
, f
A
,
LineGage