Skip to main content

Item Sets and Attribute Tolerances

Item Sets and the FAI Diameter Attribute​

Reference Materials: Item Sets

Product (Items) are naturally grouped in Item Classes. However it is possible that you may want to group a set of items that are in different classes when configuring check sheets that should only be enabled for a certain grouping of products. Item Sets can also be used to group together items that share a common set of tolerance specifications and the ability to do this really simplifies the management of tolerances rather than having to specify the same tolerances for every product you have.

Item Sets

Use the Item Sets to open up the Item Set Editor. you can add, edit and delete Item sets here.

Select any number of items and press the Item Sets to link these items together.

Note An item can only belong to one item set at a time, ensuring clarity in determining which tolerances apply.

From Item Sets →

All nine machined parts are in one item class, CoreForge\WIP\Machined, but they belong to three families with different specs. An item set groups items when the item classes don't match the grouping you need. Each item can belong to only one item set.

Create the item sets
  1. Navigate to Configuration → Quality → Item Sets and click the pencil icon (Edit Item Sets) on the left side to open the item set editor.
  2. Create three enabled item sets: Coupling Pins, Precision Rods and Shaft Cores.
  3. Link CP-2024, CP-6061 and CP-7075 to Coupling Pins, the PR- items to Precision Rods, and the SC- items to Shaft Cores.

Reference Materials: Attribute Tolerances

Tolerances​

One or more specifications (or tolerances) can be added to an attribute. A tolerance can be applied to all items by leaving the Asset, Item and Item Set fields blank. Otherwise, the Asset and Item selectors can be used to set tolerances by individual item, asset or item set. To add a new tolerance, click the

Add Tolerance button on the left of the Tolerance tab.

When a check is to be taken, it will first check if a tolerance exists for the current item. If no tolerance is found, it will check if the current item belongs to an item set that has a tolerance. If no item set tolerance has been configured, it will use the tolerance defined for all items.

Only enabled tolerances are used. Clear a tolerance's Enabled checkbox to stop it applying without deleting it; the next best-fit enabled tolerance is used instead. A new tolerance starts enabled, and the table's Enabled column shows each one's setting.

Attributes

Tolerance Parameters

  • LEL Lower Entry Limit: Defines the minimum value that can be entered.
  • LSL Lower Spec Limit: Defines the lower Pass / Fail condition. Failing values will be highlighted red.
  • LCL Lower Control Limit: Defines the lower limit condition. Values below the LCL will be considered as passing but will be highlighted orange.
  • Target: Defines the expected ideal value
  • UCL Upper Control Limit: Defines the upper limit condition. Values exceeding the UCL will be considered as passing but will be highlighted orange.
  • USL - Upper Spec Limit: Defines the upper Pass / Fail condition. Failing values will be highlighted red.
  • UEL - Upper Entry Limit: Defines the maximum value that can be entered.
note

Tolerance parameter values must make logical sense or will be highlighted in red as a warning. For instance, the Upper Entry Limit cannot be smaller than the Lower Entry Limit.

An attribute is a named quality variable, such as a diameter, that check items can refer to. Its tolerances can be set per asset, item, item set, or for all items, so the check item doesn't need a hard-coded spec.

Create the FAI Diameter attribute
  1. Navigate to Configuration → Quality → Attributes.

  2. Create the folder CoreForge and a sub-folder underneath called Machining.

  3. Create an attribute FAI Diameter in the folder CoreForge\Machining.

  4. On its Tolerance tab, add one tolerance for each item set (all values in mm):

    Item setLELLSLLCLTargetUCLUSLUEL
    Coupling Pins9.859.909.9510.0010.0510.1010.15
    Precision Rods14.8014.8814.9415.0015.0615.1215.20
    Shaft Cores24.7024.8224.9125.0025.0925.1825.30
    Show the FAI Diameter Attributes
    FAI Diameter Attributes
  5. Make sure Enabled is checked (it is for a new tolerance), and save.

A value between the control and spec limits passes but is highlighted as a warning. A value outside the spec limits (LSL/USL) fails. A value outside the entry limits (LEL/UEL) can't be entered.

Check Your Work​

Check your work

Copy this script into the Ignition Designer Script Console (Tools → Script Console) and run it. It checks that the three item sets are enabled with the right three parts each, that FAI Diameter is in CoreForge\Machining, and that it has an enabled tolerance for each item set with the limits in the table. Each check prints PASS or FAIL with what to fix. It doesn't change anything.

Show the check script
checkLesson-itemSets.py
# Kanoa Quality Training - check "Item Sets and Attribute Tolerances" (First Article Inspection, lesson 1)
#
# Run in the Ignition Designer Script Console (Tools > Script Console), in the
# project that inherits KANOA_SCRIPTS. It only reads; it changes nothing.
# Every check prints PASS or FAIL with what to fix, then a summary.

ITEM_SETS = [
('Coupling Pins', ['CP-2024', 'CP-6061', 'CP-7075']),
('Precision Rods', ['PR-2024', 'PR-6061', 'PR-7075']),
('Shaft Cores', ['SC-2024', 'SC-6061', 'SC-7075']),
]
ATTRIBUTE = 'CoreForge\\Machining\\FAI Diameter'
LIMITS = ['lel', 'lsl', 'lcl', 'tgt', 'ucl', 'usl', 'uel']
TOLERANCES = {
'Coupling Pins': [9.85, 9.90, 9.95, 10.00, 10.05, 10.10, 10.15],
'Precision Rods': [14.80, 14.88, 14.94, 15.00, 15.06, 15.12, 15.20],
'Shaft Cores': [24.70, 24.82, 24.91, 25.00, 25.09, 25.18, 25.30],
}

results = []

def check(ok, what, fix=None):
results.append(bool(ok))
if ok:
print 'PASS %s' % what
else:
print 'FAIL %s' % what
if fix:
print ' -> %s' % fix

def note(what):
print 'NOTE %s' % what

def field(row, *names):
for n in names:
if n in row and row[n] is not None:
return row[n]
return None

def text(v):
return '' if v is None else unicode(v).strip()

def key(v):
return ' '.join(text(v).lower().split())

def truthy(v):
return str(v).lower() in ('true', '1', 'yes')

def num(v):
try:
return float(v)
except:
return None

def rows(data):
# Kanoa returns a dataset, a list of dictionaries, or None
if data is None:
return []
if hasattr(data, 'getRowCount'):
cols = list(data.getColumnNames())
return [dict((c, data.getValueAt(i, c)) for c in cols) for i in range(data.getRowCount())]
return [dict(r) for r in data]

print '=' * 70
print 'Kanoa Quality Training - Item Sets and Attribute Tolerances check'
print '=' * 70

# 1. Item sets and their items
print '\n-- Item sets'
sets = rows(system.kanoa.quality.config.getItemSets({}))
setIds = {}
for name, items in ITEM_SETS:
found = [s for s in sets if text(field(s, 'itemSetName')) == name] or [s for s in sets if key(field(s, 'itemSetName')) == key(name)]
if not found:
check(False, 'Item set %s exists' % name, 'In Configuration > Quality > Item Sets, open the item set editor and add %s.' % name)
continue
s = found[0]
setIds[name] = field(s, 'itemSetId')
actual = text(field(s, 'itemSetName'))
check(actual == name, 'Item set %s exists' % name, "Found '%s'. Rename it to %s." % (actual, name))
check(truthy(field(s, 'enabled')), '%s is enabled' % name, 'Edit the item set and select Enabled.')
links = [l for l in rows(system.kanoa.quality.config.getItemSetLinks({'itemSetId': field(s, 'itemSetId')}))
if truthy(field(l, 'enabled')) or field(l, 'enabled') is None]
linked = sorted(text(field(l, 'itemName')) for l in links)
missing = [i for i in items if i not in linked]
extra = [i for i in linked if i not in items]
check(not missing and not extra, '%s has %s' % (name, ', '.join(items)),
'Link %s%s.' % (', '.join(missing) or 'nothing more', ('; unlink %s' % ', '.join(extra)) if extra else ''))

# 2. The FAI Diameter attribute
print '\n-- FAI Diameter attribute'
attrs = rows(system.kanoa.quality.config.getAttributes({}))
attr = ([a for a in attrs if text(field(a, 'path')) == ATTRIBUTE] or [None])[0]
if attr is None:
elsewhere = [text(field(a, 'path')) for a in attrs if key(field(a, 'attributeName')) == key('FAI Diameter')]
check(False, 'Attribute %s exists' % ATTRIBUTE,
("Found it at '%s'. Move it to the CoreForge\\Machining folder." % elsewhere[0]) if elsewhere else
'In Configuration > Quality > Attributes, create the folders CoreForge and Machining, then the attribute FAI Diameter in Machining.')
else:
check(True, 'Attribute %s exists' % ATTRIBUTE)

# 3. One tolerance per item set
print '\n-- Tolerances'
tols = rows(system.kanoa.quality.config.getTolerances({'attributeId': field(attr, 'attributeId')}))
for name, items in ITEM_SETS:
mine = [t for t in tols if text(field(t, 'itemSetName')) == name or (name in setIds and field(t, 'itemSetId') == setIds[name])]
# a tolerance for the item set alone, not also tied to an item, class or asset
plain = [t for t in mine if field(t, 'itemId') is None and field(t, 'itemClassId') is None and field(t, 'assetId') is None]
t = (plain or mine or [None])[0]
if t is None:
check(False, '%s has a tolerance' % name, "On FAI Diameter's Tolerance tab, add a tolerance for the item set %s." % name)
continue
wrong = ['%s %s (should be %s)' % (lim.upper(), text(field(t, lim)) or 'blank', exp)
for lim, exp in zip(LIMITS, TOLERANCES[name]) if num(field(t, lim)) is None or abs(num(field(t, lim)) - exp) > 0.0001]
check(not wrong, '%s tolerance is %s' % (name, ' / '.join('%g' % v for v in TOLERANCES[name])),
'Edit the %s tolerance: %s.' % (name, '; '.join(wrong)))
check(truthy(field(t, 'enabled')), '%s tolerance is enabled' % name, 'Edit the tolerance, select Enabled and save.')
if not plain:
note('The %s tolerance is also tied to an item, item class or asset. The lesson sets it for the item set only.' % name)

passed = results.count(True)
print '\n' + '=' * 70
print 'Result: %d of %d checks passed' % (passed, len(results))
if passed == len(results):
print 'All good. The item sets and FAI Diameter tolerances are set up.'
else:
print 'Fix the FAIL items above, then run this again.'
print '=' * 70