Process Automation
Features that let the machine do the checks and calibrations that people used to do (4.0.26~). All of them are off by default: set the devices and limits under [Show process automation ▾] in Head settings..., set the positions on the head calibration screen, then use them. Projects that do not use them behave and save files exactly as before.
| Feature | What it does | Needs |
|---|---|---|
| Path range check | Before a pattern starts, checks every position it will move to against the motor soft limits and does not run if any is outside | Motor soft limits turned on |
| Process records | One CSV line per run (board ID · cells · corrections · material · result) and a maintenance event log | Nothing (always on) |
| Material and purge | Refuses real dispensing after the pot life or shot limit, and reports when idle or periodic purging is due | Limits in the head settings |
| Needle calibration | After a needle change, measures Z (tip sensor) and XY (dot + camera) and corrects the surface Z and the needle offset | Tip sensor input · align camera · calibration plate |
| Height measurement | Measures the pattern's height points per cell and moves that cell's Z to the measured surface | Height sensor (communication · analog input) |
| Weight calibration | Dispenses test shots on a scale, finds the flow ratio and applies it to dot time and line speed | Scale (SC_Balance driver) |
Common rules
- Maintenance actions such as needle calibration, height reference, surface measurement and weight calibration move the head and may dispense material. The calibration screen buttons ask before running (18017), and the script functions wait until they finish — call them from a sequence step or
RunManualThread. - During a maintenance action that head's pattern runs, manual valve and moves are blocked, and the action is refused while another head that shares axes is running. The stop rules (Abort · machine error · exit) are the same as for patterns (chapter 13).
- Stopping — while an action runs, the calibration screen shows [Abort] in the head information line. Pressing it (or the script
Abort()) makes an emergency stop of the head motors at once, even while a move is being waited for, and turns the valve off (the same as a pattern abort). It also stops at once while waiting for the scale (zero · stable weight), and when pressed right after the confirmation, before the action has started, the action does not start. An aborted action saves nothing even if its remaining steps finish, leaves the axes where they stopped, and the head is released only after the axes have stopped. The moving axes are also stopped when the script thread ends or an exception occurs. - On failure — after a failure that comes once the axes have moved (the sensor does not turn on · a bad reading · a scale error and so on), Z is raised to the safe height, so a needle left at the tip sensor, measuring or scale height does not hit anything on the next manual move. A failure before anything moves (setup · sensor checks) leaves the axes alone, and when a move itself fails (alarm · limit · timeout) the axes are left where they stopped, so the machine does not move on its own before the cause is checked. An abort, a machine error or an exception also leaves the axes where they stopped.
- Simulation — the tip sensor, camera, height sensor and scale are not simulated. In simulation mode reference registration is refused (a fake reference used for calibration on the real machine could crash the needle), and calibration only makes the moves and saves nothing (
simulatedin the log and events). Valve use and runs since purge are not counted either. Patterns with height points make the measuring moves only, without reading the sensor (no height correction — they can be tried even without a reference, with a check warning). - In dry-run mode (
SetMode("DryRun")) maintenance that dispenses material (XY calibration · weight calibration) is refused. Tip and height measurement still work. - Every result is written to the event file of the process records (
DispEvent_date.csv) and to the log. If the project is changed during maintenance, the event is not written to the new project's records.
Settings and calibration screens
Process automation is prepared on two screens. Choose the devices and limits in the [Head settings...] window of the studio, then set the positions with the jog and register references and calibrate on the head calibration screen (studio Dispense Heads · machine page DispenseHeadCalib, chapter 5). The values in the pictures below are examples.
![[Head settings...] → [Show process automation ▾] — devices and limits per feature ( example values )](/manual/dispenser/en/disp_auto_config.png)
| Group | What you set | More |
|---|---|---|
| Material and purge | Pot life (min) · shot limit · idle purge (s) · purge every (runs) — 0 turns each off. | 10.3 |
| Needle Z calibration — tip sensor | Tip sensor (digital input, chosen with [Search…]) · search distance · search speed · Z correction limit | 10.4 |
| Needle XY calibration — dot + camera | Calibration align (an align with a mark method using the same X · Y motors as the head) · dot set (empty = the head's default set) · dot pitch · dots per plate · XY correction limit · plate height | 10.4 |
| Height measurement | Height sensor (communication object or analog input IO) · sensor scale · height limit · settle time · samples | 10.5 |
| Weight calibration | Scale (SC_Balance communication object) · shot time · shots · target weight · ratio limit · scale timeout | 10.6 |
Leaving a device box empty turns that feature off, and its group does not appear on the calibration screen (the material group is always shown). Clicking or hovering over a box shows its description on the right. Saving relinks the head at once; a wrong device name gives a warning at build.

| Group | Position boxes ( set with the jog ) | Status line | Buttons |
|---|---|---|---|
| Needle Z calibration (tip sensor) | Tip sensor X · Y [Read XY], search start Z [Read Z] | Reference time · Z difference from the reference needle | [Register Z ref] · [Calibrate Z] |
| Needle XY calibration (dot + camera) | Plate X · Y [Read XY] | Reference time · plate dots left | [Register XY ref] · [Calibrate XY] · [Plate cleaned] |
| Height measurement | Sensor offset X · Y, measure Z [Read Z] | Reference reading (time registered) | [Register height ref] · [Measure surface] |
| Weight calibration | Scale X · Y [Read XY], scale Z [Read Z] | Flow ratio · last measured weight (time) | [Calibrate weight] · [Ratio to 1] |
| Material | Material lot | Lot · minutes since registration · pot life left · shots ( / limit ) · last dispense · purge due | [Replace material] |
- Devices and limits — enter the devices and limits of the features you use in [Head settings...] and save.
- Positions — on the calibration screen, bring the needle over the tip sensor · calibration plate · scale with [XY jog] · [Z jog], enter them with [Read XY] · [Read Z] and press [Save]. The sensor offset of height measurement is the difference of the gantry positions when the sensor spot and the needle are each over the same mark.
- Register references — with the reference needle (surface Z and needle offset set), press [Register Z ref] · [Register XY ref] · [Register height ref]. The target weight of weight calibration is set right after tuning the sets — with a target of 0 [Calibrate weight] refuses without measuring, so enter a rough target, press [Calibrate weight], enter the 'Last … mg' (measured weight) of the status line as the target weight and press [Ratio to 1] (10.6).
- In production — after a needle change run [Calibrate Z] · [Calibrate XY]; after a material change enter the lot and press [Replace material]; when the viscosity changes run [Calibrate weight]. Scripts can do the same (chapter 12).
- No reference in a status line means the reference is not registered yet, and register again means the surface Z or needle offset was changed by hand after the reference — calibration and measurement are refused with that reference.
- Buttons that move the head ask before running (18017), and [Abort] appears in the head information line while an action runs (see the stop rules in 'Common rules' above).
10.1 Path range check
The dispense path (interpolation) goes directly to the driver and does not pass the motor soft limit checks. So when a pattern starts, every position it will move to is checked first — block start points, lines and arcs (including the 0° · 90° · 180° · 270° points an arc passes), end moves, and the safe · approach · dispense · retract heights, and height measuring points.
- Only axes whose soft limit (
SoftLimitUse) is turned on in the motor editor are checked, and not before homing or while homing (the same conditions as the motor soft limits). - If a position is outside, the pattern does not run, and
GetLastError()and the log show the farthest position, cell and element per axis. e.g.range error : X axis moves to 143 mm, outside the soft limit 0 ~ 127.5 mm of motor 'M_DispX' (cell 1, element 0) - It checks the real positions with the work offset, align, cell shift and needle offset applied (the stretched path when the align uses uniform scale — chapter 9). Test runs and dry runs are checked the same way.
- When the pattern has height points (10.5), block Z may be shifted during the run by up to the height limit (HeightLimit), so every Z except the safe height is checked that much up and down (the Z position in the message includes that margin, and
(Z is checked with ±… mm for height points)is added at the end).
10.2 Process records
Two CSV files a day are written to the project folder Log\Dispense\ (UTF-8 — they open directly in Excel).
| File | One line |
|---|---|
DispRun_yyyyMMdd.csv | One pattern run — start and end time, seconds, job, head, pattern, board ID, mode (Run · DryRun · SimRun · SimDryRun), result (Done · Aborted · Error), number and list of cells, last finished cell and element, work offset, align, surface Z, measured height points with min and max difference, needle offset, flow ratio, material lot and minutes since registration, valve-on count and time (ms), error, total time waited between cells on STOP (PauseMs, ms — added as the last column in 4.0.27, included in the seconds), align scale (AlignScale — the applied scale with uniform scale, 1 for rigid or no align — added as the last column in 4.0.28), cell align summary (CellAlign — align name · cell count · jig · shift and angle ranges. In a run done with cell aligns the align column is empty — added as the last column in 4.0.28, chapter 9) |
DispEvent_yyyyMMdd.csv | Maintenance events — time, head, event (TipRef · TipCal · NeedleXYRef · NeedleXYCal · HeightRef · WeightCal · FlowRatio · Material · Purge · PlateReset), result (OK · NG), details (values · reason) |
- Set the board ID with the script
SetBoardId("barcode")(kept until changed). With the value read by a barcode reader you can trace which corrections and material each board was dispensed with. - If a record file cannot be written because it is open in Excel, the lines are kept in memory and written with the next record (up to 2000 lines per file). A record failure never stops the machine.
- New columns (
PauseMs·AlignScale·CellAlign) are added at the end so that the order of the earlier columns does not change. A file that already existed on the day QMS was updated has no header name for them (the values are appended at the end of the line). - Record files older than 365 days are deleted at the first record after the date changes. Change the number of days with
"RecordDays"at the top ofHeads.json(0 = never delete). - Upper-level drivers such as MES or SECS/GEM can receive the same record through the static event
XDispenseManager.RunRecorded.
10.3 Material and purge
The material state of each head (lot · registration time · valve-on count · valve time · last dispense · runs since purge) is kept in the project file Dispense\HeadState.json. Counting continues after a restart. The file is created once material or purge limits are used, or after material registration, weight calibration, XY calibration (plate position) or a flow ratio — projects that do not use the process automation features never get it (the counts are then kept only in memory and start from 0 after a restart).
| Head setting ([Head settings...]) | Default | Behavior |
|---|---|---|
Pot life (PotLifeMin, min) | 0 = off | When this time has passed since the material was registered, real dispensing patterns are refused (dry runs still run). It also refuses when the material was never registered. |
Shot limit (MaterialShotLimit) | 0 = off | When the valve-on count since registration reaches this value, real dispensing is refused (to set the amount of one fill as a count). |
Idle purge (IdlePurgeSec, s) | 0 = off | IsPurgeDue() is true when this time has passed since the last dispense, and also when there is no dispense record at all. |
Purge every (PurgeEveryRuns) | 0 = off | IsPurgeDue() is true after this many real dispensing runs since the last purge. |
- Registering material — after changing the syringe or cartridge, enter the lot in the [Material] group of the calibration screen and press [Replace material], or call
SetMaterial("lot"). Registration sets the count and valve time to 0. - The valve-on count is how many times the valve was actually opened by patterns, calibration dots and test shots (dry runs and purges are not counted). The valve time and the last dispense time include purges and the manual valve. Runs and purges in simulation mode dispense no material, so they are not counted in any of these (they are counted in the run's own process record). In simulation mode the purge decision (
IsPurgeDue·GetIdleSec) uses separate simulation-only values, so purging is due only now and then as on the machine (not saved). - The sequence purges — the core only reports that purging is due. Purge positions and order differ per machine, so it does not move by itself. A successful
Purge()restarts the idle and periodic counts.
// Before dispensing a board — purge first if it is due
if( DISPENSE["Head1"].IsPurgeDue() )
{
if( DISPENSE["Head1"].MoveToPurge() == false || DISPENSE["Head1"].Purge(0) == false )
{
return false;
}
}
// Warn when less than 10 minutes of pot life are left ( after that Run returns false — pot life expired in GetLastError )
double left = DISPENSE["Head1"].GetPotLifeLeftMin();
if( left >= 0 && left < 10 )
{
Log("[Dispense] pot life left {0} min", left);
}10.4 Needle calibration
A new needle differs a little in length (Z) and tip position (XY). Register the reference once with the reference needle, then calibrate after each needle change: the surface Z (ZSurface) and the needle offset are corrected by the difference from the reference and saved to Heads.json (the calibration screen shows them at once).
Z — tip sensor
- Setup — a digital input that turns on when the needle tip touches it (or breaks its beam). Set the tip sensor, search distance, search speed and Z correction limit in [Head settings...], and set the tip sensor X · Y ([Read XY]) and the search start Z ([Read Z]) on the calibration screen. The search start Z must be above the sensor for any needle.
- Motion — safe Z → above the sensor → search start Z → move toward the surface at the search speed, read the Z at the moment the sensor turns on and stop → rise 0.3 mm and measure again at 1/5 speed → safe Z. It fails if the sensor does not turn on within the search distance, is already on at the start height, or the axis stops on a limit or alarm.
- Safeguards — the sensor is also watched while moving down fast to the search start Z, and the axis stops there if it turns on (start height set below the sensor, or a long needle). When a reference exists, [Calibrate Z] goes no farther than the reference Z + Z correction limit + 0.5 mm (so a missing needle or a broken sensor does not make it travel the whole search distance). If the sensor's IO module is not initialized, it fails without moving.
- [Register Z ref] — press with the reference needle whose surface Z is set. The Z where the sensor turned on and the surface Z at that time become the reference.
- [Calibrate Z] — press after changing the needle. Surface Z = surface Z at the reference + ( measured Z − reference Z ). If the difference is more than the Z correction limit (1 mm by default), nothing is changed.
- If the surface Z was changed by hand after the reference was registered, calibration is refused (
changed by hand) — that value no longer matches the reference, so register it again.
XY — dot + camera
- Setup — the camera of an align (chapter 9) moved by the same X and Y motors as the head. Teach mark 1 of that align as the calibration dot (round) — the dot is found with mark 1's shape, search area and light. Set the calibration align, dot set, dot pitch, dots per plate, XY correction limit and plate height in [Head settings...], and the plate X · Y on the calibration screen.
- The calibration align uses a mark method — the dot is found with the mark 1 teaching, so in the current job the calibration align must use a mark method (1 · 2 · 3 marks) with mark 1 taught. An edge corner align is refused before any dot is dispensed (
needle calibration align '…' uses method EdgeCorner without marks - …). - Motion — dispenses one dot with the dot values of that set at the next place on the plate (first dot + number × dot pitch, toward +X), lifts, moves the camera to that place + the calibration align's camera offset and measures the dot center (on a camera-coordinate setup the camera offset is 0, so the place itself). Dot error = measured dot − where the camera was sent.
- [Register XY ref] — press with the reference needle whose needle offset is set. The dot error at that time becomes the reference error (the remaining difference between camera and needle coordinates goes into it and cancels out — including what is left from measuring the camera offset), and the camera offset at that time is kept too.
- [Calibrate XY] — needle offset += ( dot error − reference error ). If the correction is more than the XY correction limit (0.5 mm by default), nothing is changed. It is refused before any dot is dispensed if the needle offset was changed by hand or the calibration align's camera offset was changed after the reference (the reference error would be off by that much — the calibration screen status line also shows 'register again', 4.0.28~).
- Once a dot is dispensed the plate moves to the next place whatever the result. When the plate is full (
calibration plate is full), clean it and press [Plate cleaned]. Make the dot pitch wider than the mark search area so a neighbouring dot is not found. - Setup — it works on both setups (chapter 5, two setups). The camera-coordinate setup (needle offset = camera center − needle tip, dispenser sample) uses camera offset 0, the reference-head setup (needle offset relative to the reference head) enters the camera offset in the calibration align's device settings (4.0.28~). On a reference-head setup with camera offset 0 the camera looks off the dot by the camera distance and it fails with
calibration dot not found(nothing is changed). - In simulation mode nothing is dispensed on the plate, so no plate position is used.
10.5 Height measurement
When the surface height differs per board or per cell because of thickness or warp, put height points into the pattern to measure the surface before each cell is dispensed. Each block of that cell moves its approach, dispense and end-move heights to the middle of the measured surface along its path (Z stays constant within a block).
Heights are not set point by point. The height points of a cell fit one surface, and Z is set per block from that surface (block and cell: see Terms).
| Height points in the cell | How the surface is fitted |
|---|---|
| 1 | That one height (no tilt) |
| 2, or nearly on one line | Only the slope along that line; across is taken as flat |
| 3 or more, spread out | A tilted plane (least squares) |
- Setup — a height sensor: a communication object (laser displacement sensor driver — read with
GetValue(true), -1 = failure, e.g.LS_Sick_OD2) or an analog input IO. Set the height sensor, sensor scale, height limit, settle time and samples in [Head settings...], and the sensor offset X · Y and measure Z ([Read Z]) on the calibration screen. - Surface Z = surface Z setting + Z direction × sensor scale × ( reading − reference reading ). The sensor scale is 'how much the surface moves up per sensor unit', so a distance sensor (value grows as the surface moves away) is −1 (the default) whatever the Z direction. For an analog sensor enter mm/V (negative if the voltage drops as the surface rises).
- [Register height ref] — press with the needle at the place where the surface Z was taught. The sensor is moved there and its reading becomes the reference (not available in simulation mode). The reference stays valid when needle Z calibration changes the surface Z. If the surface Z is changed by hand (new jig · re-taught on another part), the sensor measures the same change too, so it would count twice — height measurement and surface measurement are refused (
changed by hand); register the reference again. - [Measure surface] — measures and shows the surface Z at the present needle position (nothing is saved). Same as the script
MeasureSurfaceZ(x, y, /*ref*/z). - Add the points with [Height pt] in the pattern editor (6.1). Height points do not dispense and cannot be inside a line. All height points of a cell are measured before the first block of that cell — also when the run resumes in the middle of a cell.
- Nearly on one line in the table above means the narrow spread is less than 1/10 of the wide spread. The cross slope is then taken as 0 because the slope along the line is well defined, but the tilt across it would be set by measurement noise and the error grows with the distance from the points. With two points, or points exactly on one line (cross width less than 1 % of the line length), the cross direction is assumed flat and not checked — for a part tilted across, place height points off the line too. Spread the points evenly around the area to be dispensed.
- If a measured point is off the fitted surface (warp · an unmodelled cross slope · a bad reading) by more than the allowance of that cell's blocks (half the dispense gap, at least 0.02 mm), the run stops before the cell is dispensed.
- Paths too far from the height points — the height comes from the surface fitted to the measured points, extended to the path, so the measurement noise grows with the distance from the points. If at any point of a path that error is more than 2 times the error of one reading, the pattern check fails (
too far from the height points— also shown in the editor and in simulation). Examples: between well-spread points and just outside them is fine, and so is the fourth corner of a rectangle cell measured at three corners (about 1.7 times). Dispensing a path far away from points bunched at one side is an error. For points placed nearly on one line, the sideways spread of the points is the measure (exactly on one line — two points included — the sideways direction is not checked). Add height points close to the path, around it. With a single height point (no slope) this is not checked. - The run stops if a measured surface differs from the expected surface (surface Z setting or the script
SetSurfaceZ) by more than the height limit (1 mm by default), or the plane extended along a path does so (bad reading or missing part — so the needle does not crash). - Tilt — Z stays constant within a block, so the run stops if half the surface height change along one block's path (start point · line end points · arcs · the Backtrack end move of lines) plus the error of the fitted surface (the largest distance of a measured point from it — for a line fit, grown with the path's sideways distance from the line) is more than half the dispense gap (DispenseGap, at least 0.02 mm) (a long line on a tilted part would scrape at one end). Split the path, add height points or level the part. All blocks of a cell are checked before the cell is dispensed, so it never stops in the middle of a cell.
- When the run stops because of the measured values (expected surface · fit error · tilt · sensor read failure), Z is raised to the safe height before it ends. After a failed move or an abort the axes are left where they stopped.
- If the head has no height sensor or no height reference, a pattern with height points fails the check and does not run (in simulation mode a missing reference is only a warning). Simulation mode never reads the sensor, even with a reference — it makes the measuring moves only (no height correction — a simulated sensor value says nothing about the part). Paths too far from the height points are a pattern check, so they show in simulation too, but the expected surface, fit error and tilt checks run on the real machine only. The estimated time and [Play] include the measuring moves. If a communication object that gives no sensor value (a driver without
GetValue) is chosen as the height sensor, the build warns and measuring fails. A sensor scale of 0 is not accepted. - Patterns with height points cannot be opened by QMS versions before 4.0.26 (unknown element type).
10.6 Weight calibration
When the viscosity changes with temperature or time, the same valve time gives a different amount. Test shots on a scale give the flow ratio = measured weight ÷ target weight, and from the next run dot time ÷ ratio and line speed × ratio keep the amount the same (lower flow → longer and slower).
- Setup — add the scale (RS-232) as a communication object. The driver
SC_Balancerecognizes the Mettler Toledo MT-SICS and A&D command sets from the replies (8 bits · no parity · 1 stop bit · CR LF line end, baud rate as on the scale). Set the scale, shot time, shots, target weight, ratio limit and scale timeout in [Head settings...], and the scale X · Y ([Read XY]) and scale Z ([Read Z]) on the calibration screen. - The target weight is what the test shots (time × count) give at the flow the sets were tuned with. With a target of 0, [Calibrate weight] refuses without measuring. At first enter a rough target, press [Calibrate weight] right after tuning the sets, enter the 'Last … mg' (measured weight) of the status line as the target weight and press [Ratio to 1] (the measured weight is kept even when the run fails because the difference from the rough value exceeds the ratio limit; nothing is measured in simulation mode).
- Motion — safe Z → above the scale → scale Z → zero → base weight → test shots (count times, 0.3 s apart) → stable weight → safe Z. Measured weight = final stable weight − base weight after the zero (so a small residue left by the zero is not added to the result). [Abort] ·
Abort()stops at once even while waiting for the scale (without waiting out the scale wait). - If the ratio is more than the ratio limit (30 % by default) away from 1, or outside 0.1 ~ 10, the ratio is not changed and the calibration fails (material or needle problem — clog or air).
- The ratio is kept per head in the run state (
HeadState.json). Reset it with [Ratio to 1] orSetFlowRatio(1). It does not change delays and waits (PreMoveDelay·NodeTime·ShutoffDelay) or travel speeds. If a dot time or line speed with the ratio applied is cut by the parameter range (dot 0 ~ 60000 ms · line 0.1 ~ 2000 mm/s), the correction is only partly applied and a warning is written to the run start log. - In simulation mode only the moves and test shots are made and the ratio is not changed (so a measured ratio is not overwritten with 1). In dry-run mode it is refused.
- Scripts can use the scale driver too —
COM["scale"].GetValue(true)= stable weight (g),GetValue(false)= current weight, -1 on failure,SendCommand("ZERO")·SendCommand("TARE"). - Zero is confirmed by the weight, not only by the reply — an A&D ACK may mean 'received', so it waits up to 3 s for the 'completed' ACK, then reads the stable weight until it is close to 0 (2 mg or less) before the test shots start. An A&D scale with ACK turned off gives no reply; it waits about 5 s and confirms the same way (turning ACK on makes it faster). An ACK without a line end, an empty line, or a late zero or tare reply in place of the weight reply is skipped.
Note Script functions for these features are listed in chapter 12 Scripts and XScript — DISPENSE.