Monitoring machine conditions from a connection to a machine's control is simple with MachineMetrics. By connecting the MachineMetrics edge device to the control that is configured properly, you'll receive many data items including machine utilization, alarms, spindle cutting, controller mode, loads, speeds, feeds, etc. These data items are automatically mapped by MachineMetrics.
In order to properly monitor throughput, we need to collect part count. This almost always comes from the part counter on the machine (also known as the work counter). Controls often have multiple part counters, and these counters are incremented by the program's G-code that is running on the machine. Programs are often complex, with controls given to operators to skip areas of a program, run multiple parts on a pallet, to stop before the end of the bar, etc. Therefore, getting part counts correct can also be complicated. This document serves as a guide to help you configure part counts so they exactly match the parts being produced from your machine.
Step 1 - Ensure the Correct Part Counter is Selected
In MachineMetrics settings click on "Workcenters" then "Integration Advanced" you will see "Part Metric". The default is "Detect Parts on All Counters". Change this to the part metric that matches the one on the machine that you wish you use for counting parts.
The machine diagnostics page is a useful tool to determine the value of each part counter. Write down the value of each part counter (typically each path has its own counter). When a part has completed, write down the values again. The value that incremented properly (typically by 1) is probably the counter you should be using.
In the above screenshot, we can see this machine has two part counters (highlighted in yellow) but only one of them is counting - the Path 2 part counter. This will be the correct part counter to select in this machine's settings.
Step 2 - Ensure the Proper M code or Macro is used to increment the counter
We have found that the standard part count M-codes works well for most of our customers. If you have not added an M-code or Macro for incrementing part counts in your code, you must do so. Each machine make has it's own documented M-code for incrementing parts, but the universal macro that works for almost all machines for incrementing the counter by 1 is:
#3707 = #3707 + 1
In the above macro, the "+1" represents the number of parts to be counted each time the machine sees this code. If multiple parts are made per program, you can edit this number to reflect that.
The best place to add this macro would be near the end of the program before M99, M30, or M02.
Typically these changes can be applied to the machine profile in your post-processor so that whenever a program is posted to a machine, it has the correct code applied and new programs will contain the proper part count macro or M code.
For more complicated machining, such as multi-pallet machines, subprograms with their own counts, or cases where block-delete is commonly used, some changes to the control might be required. This is because areas where the M code is typically contained might be skipped, or might be run more than once. In these cases, our recommendation is that the machine's control be configured to not increment the part counter with the standard M codes. Instead, we can use the standard Macro as defined above. Parameters on the machine control may need to be changed.
FANUC FOCAS Controls
You can configure your FANUC control to count on any M code Except M98 and M99. If your machine is double counting you can use these steps to remove extra part count M codes or isolate to just the part count macro.
1.) In MDI mode press "System" hardkey followed by "parameter" softkey. use page down key to scroll to 6700
2.) Change parameter 6700 bit 0 (Furthest bit to right) to 1 (on)
3.) Change 6710 to desired M code to count on.
4.) 6700 bit 0 dictates 0= count on M2, M30 or an M code specified by parameter 6710 or 1= only count on M code specified by parameter 6710
6710 = M code to count on - this can be any available M code except M98 and M99
5.) System may need reboot for parameter changes to take place.
Check with Manufacturer/FANUC before changing parameters to make sure the parameters are not in use by any other features.
Many Okuma machines count on M89, If yours is not or not doing so accurately, you can use the following method:
1) Open up the MTConnect application on your machine's control.
2) Open up the "Device Configuration" page.
3) Select what variable(s) you would like to use for the part count.
4) You will need to add a common variable code within your program to increment the part counter. An example of this is VC1=VC1+2 (this will increment Common Variable 1 two parts per count). Add this common variable code near the end of the program for best results.
5) When the common variable code and MTConnect Common Variable settings are finished, you will need to notify MachineMetrics of the variable used so that our configuration can match.