System designGuide

Camera part coordinates over EtherCAT into a motion controller

Moving camera part coordinates into an EtherCAT motion controller: axis frames, units, pixel sizing, handshake bytes and cycle timing, with a worked example.

LumaSpec Vision13 min read Share on LinkedIn

On this page 9 sections
  1. 01Can a camera feed part coordinates straight into an EtherCAT motion controller?
  2. 02Which camera gives you X, Y, Z and angle in one shot?
  3. 03How do you convert camera coordinates into axis coordinates?
  4. 04What field of view and pixel size does the parts area need?
  5. 05How fast can the pick cycle run over EtherCAT?
  6. 06How do you build the handshake so a stale result never moves the axes?
  7. 07What should you check before ordering camera and controller?
  8. 08When is EtherCAT the wrong link for camera results?
  9. 09Questions

A four-axis gantry — X, Y, Z and a rotation axis — loading a CNC from a parts storage area needs three coordinates and an angle per part, in the motion controller's frame, before the gripper commits. Carrying those values over EtherCAT is routine: the camera side publishes part coordinates as process data, the master's motion task turns them into axis commands, and the exchange rides the same bus as the servo drives.

What bends tooling is never the bus; it is a flipped sign in Y, a stale result, or a pixel size that cannot hold the placement tolerance. This guide commits to numbers for all three: camera choice, the datum that maps camera coordinates into axis coordinates, field-of-view and pixel sizing for a 600 × 400 mm area, the process-data layout, and the timing budget from trigger to motion.

Can a camera feed part coordinates straight into an EtherCAT motion controller?

Yes — and the bus is the easy part. A part result crosses the link inside one 1 ms motion task cycle as plain process data; the camera's 100 to 200 ms of exposure and processing sets the real pace, and a four-axis pick lands every 2 to 3 seconds.

Two wiring routes exist, and you pick by what the cell already runs:

  1. A native fieldbus sensor. Some 3D and vision sensors ship as EtherCAT slaves. The vendor's device description — the ESI file, an XML — declares which result variables appear in the input process data, and the master reads a part coordinate exactly the way it reads a drive's feedback word.
  2. A GigE camera plus a bridge. The camera lands on a vision controller that runs the locate job, and a compact gateway slave on the master's bus carries the results across. One box then owns the camera link, the lighting and the units, which is the first route to wire here.

EtherCAT has no standard object for a part coordinate. Every vendor maps its own result variables into input process data, so the ESI file is the agreement that fixes field order, widths and scaling before anyone writes logic.

The MV-SVC2506-16G60-128G brings 4 camera GigE ports, 1 configuration GigE port and 1 communication GigE port, so the camera side needs no extra switch.

Vision controllersHikrobot MV-SVC2506-16G60-128G 4 camera GigE ports, 1 configuration GigE port, 1 communication GigE port, 6100pro encryption supportedMV-SVC2506-16G60-128G
LAN ports
5+ LAN ports
USB 3 ports
2 USB 3 ports
Light outputs
4 built-in channels
Memory
16 GB
Price on requestView and quoteBuild a system with it

If you would rather hold a fieldbus interface card beside the camera software, the MV-VC3301H-128G66 offers a Core i3, 8 GB of memory and PCIe expansion in the same rack.

Vision controllersHikrobot MV-VC3301H-128G66 I3-8100, 8GB+128G SSD, No PoE, PCIe expansion supported, Incl. VM6200Pro licenseMV-VC3301H-128G66
LAN ports
5+ LAN ports
USB 3 ports
3-4 USB 3 ports
Light outputs
4 built-in channels
Memory
8 GB
$2,419.00View partBuild a system with it

The pick cycle itself is the one described in how the 2D vision guided pick cycle works; only the transport changes. Compare boxes for both routes in vision controllers.

Which camera gives you X, Y, Z and angle in one shot?

A single-shot structured-light 3D camera: one trigger returns a full height map, and part center, top height and angle come out of the same frame in 100 to 500 ms. Use a 2D camera only when every part rests at one known height.

The decision follows the parts, not the catalog:

  • Random placement, mixed heights — the CNC storage area in this project. Take a projected structured-light 3D camera. The MV-DPS200P-02 is a projected structured-light 3D camera; match its lateral resolution and height repeatability to your area and tallest part. For a second opinion, a laser-galvanometer stereo unit such as the MV-DLS300P-04 belongs on the same comparison sheet.
3D sensorsHikrobot MV-DPS200P-02 Projected structured-light 3D cameraMV-DPS200P-02
Type
Stereo / structured light
$8,829.00 · quotedView and quote
  • Fixed tray, one pocket depth. A 2D camera with its own lighting is enough, and Z comes from the tray datum you jog to once. The MV-SC6050C-08M-XBN is a 5 MP smart camera with an 8 mm focal length, a global shutter and its own multi-color light source. An on-device locate closes in 20 to 60 ms, several times faster than a multi-shot 3D exposure; the rest of the smart cameras range covers other resolutions and mounts.
Smart cameras & vision sensorsHikrobot MV-SC6050C-08M-XBN SC6000 Series Smart Camera, 5 MP, Color, 8 mm focal length, M12-mount, Multi-color light sourceMV-SC6050C-08M-XBN
Interface
GigE
Resolution
5 MP
Sensor format
1/1.45"
Shutter
Global
$3,449.00 · quotedView and quote
  • Depth and ToF. The MV-DT01WMU is a depth/ToF camera, the class for presence checks and volume. ToF height repeatability sits in the millimeter-to-centimeter band, too coarse to steer a gripper onto precision work.
  • Laser profilers. 75 of the 170 products in the 3D sensors finder are profilers, and every one builds height a line at a time, which needs relative motion between sensor and part. A static storage area gives a profiler nothing to sweep; it belongs over a conveyor.

Laser-based 3D cameras print a laser class on the label — respect it and keep the scan interlocked while guarding is open during commissioning. For the deeper call on flat stock, read 3D bin picking for flat parts.

How do you convert camera coordinates into axis coordinates?

With one three-point datum: jog the gripper to two known axis points and one offset point, record the camera's reading at each, and you have offset, sign and scale per axis. Every part after that is one subtraction and one division per axis.

The camera speaks sensor frame: origin at the optical center, X along the sensor's long side, Y increasing down the image, Z the height it measures. The gantry speaks axis frame: X and Y along the horizontal travels, Z down from home, R about Z. The datum teaches the controller the bridge:

axis_X = (Xc - X0) / Sx axis_Y = (Yc - Y0) / Sy pick_Z = tray_Z + Zc R_cmd = -θc # image angles clockwise, axis angles counter-clockwise

Run it with a fiducial pin or a finished part:

Axis point (mm) Camera X (mm) Camera Y (mm)
(0.0, 0.0) 12.0 -8.5
(100.0, 0.0) 112.2 -8.3
(0.0, 100.0) 11.8 91.9

Offsets come from the first row: X0 = 12.0 mm, Y0 = -8.5 mm. Scale comes from the other two: Sx = (112.2 - 12.0) / 100.0 = 1.002 and Sy = (91.9 + 8.5) / 100.0 = 1.004. Had the third point read below -8.5 on camera Y, the Y sign would be flipped and Sy negative — that is the whole sign question, settled by one row of the table. The 0.2 mm of Y drift over 100 mm of X is a mounting skew of atan(0.2 / 100), about 0.1 degrees; ignore it. Above 1 mm per 100 mm, add a rotation term to the transform or shim the camera level.

Now the part. The camera reports Xc = 82.4 mm, Yc = -136.7 mm, top height Zc = 31.5 mm and angle θc = 37.2°, with the tray floor taught at axis Z = -250.0 mm:

  • axis_X = (82.4 - 12.0) / 1.002 = 70.4 / 1.002 = 70.3 mm
  • axis_Y = (-136.7 + 8.5) / 1.004 = -128.2 / 1.004 = -127.7 mm
  • pick_Z = -250.0 + 31.5 = -218.5 mm, approach at -218.5 + 20 = -198.5 mm
  • R_cmd = -37.2°

Z is the axis you teach without the camera: jog the gripper onto the tray floor, store the reading, let the camera add part height. Rotation flips sign once because image angles run clockwise while a counter-clockwise-positive axis reads them mirrored; teach it with one marked part, and hold a parallel gripper inside ±1 degree of alignment.

Run the transform on the vision side and send axis-ready coordinates; the motion controller then only clamps travel limits. One box owns the units, and the number on the bus is the number the axes move. The rotation-survival habits in vision locate for robot part picking carry over to a gantry unchanged.

What field of view and pixel size does the parts area need?

Cover the area plus 10 percent mounting margin and hold at least three pixels across your placement tolerance: for a 600 × 400 mm area and a 0.5 mm tolerance that means a 660 mm field on a 12 MP-class sensor, 0.16 mm per pixel.

The arithmetic for a 2D camera over the area:

  • Field of view: 600 mm × 1.10 = 660 mm wide, and 400 mm × 1.10 = 440 mm deep.
  • Pixels: a 2,448-pixel-wide sensor, the 5 MP class, gives 660 / 2,448 = 0.27 mm per pixel — two pixels span 0.54 mm and miss the tolerance. A 4,096-pixel-wide sensor, the 12 MP class, gives 660 / 4,096 = 0.161 mm per pixel — three pixels span 0.48 mm and the tolerance closes.
  • Working distance: on a 1/2-inch sensor 6.4 mm wide, magnification is m = 6.4 / 660 = 0.0097. With an 8 mm lens, WD = f × (1 + m) / m = 8 × 1.0097 / 0.0097 ≈ 833 mm, and the vertical field is 4.8 / 0.0097 ≈ 495 mm, which clears 440 mm.
Camera resolution for the smallest feature
Units
Pixels needed
–
Sensor size
– MP
Smallest sensor that fits
–
Pixel on the part
– mm
Pixels across the feature, that sensor
–

Pixels needed = field / feature × pixels per feature on each axis (field incl. margin). The lens must resolve the pixels too: Nyquist = 1000 / (2 × pixel µm) lp/mm.

Find cameras with enough pixels Open the full calculator

How sensor width, working distance and field of view set the focal length Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.CameraField of view (FOV)Working distance (WD)≈ fsensor width slensm = s / FOVf = WD × m / (1 + m)
How sensor width, working distance and field of view set the focal length. Rays from the edges of the sensor pass through the lens and spread to the edges of the field of view. The ratio of sensor width to field of view is the magnification m.

A 3D camera is sized by its stated lateral resolution and height repeatability instead of pixels. Keep a 4:1 margin between repeatability and the tolerance — 0.1 mm-class repeatability for this cell — and a height range that covers your tallest part plus the tray. CNC halls also strobe with machine lighting between shifts; the countermeasures are in controlling ambient light in pick and place vision.

How fast can the pick cycle run over EtherCAT?

Budget 132 ms from trigger to usable coordinates and about 2.5 s per pick: 50 ms of exposure, 80 ms of processing and two 1 ms task cycles for transport, then axis motion dominates. The bus contributes two milliseconds and is never the bottleneck.

Step Time
Trigger bit read by the vision side 1 ms
Exposure, multi-shot pattern 50 ms
Locate and height processing 80 ms
Result latched, read by the motion task 1-2 ms
Vision total ≈ 132 ms
X travel 500 mm at 250 mm/s plus ramps 2.3 s
Pick cycle with grip and release ≈ 2.5 s

Axis math: 500 mm ÷ 250 mm/s = 2.0 s at speed, plus 0.3 s of acceleration and deceleration.

t_result = t_exposure + t_processing + 2 × t_task = 50 ms + 80 ms + 2 × 1 ms = 132 ms

The bus costs almost nothing here, for a reason: EtherCAT processes one frame on the fly through every slave, so a 20-byte result adds microseconds; distributed clocks hold the nodes in sync well below 1 µs; and motion tasks run at 1 ms as the standard, 250 µs to 4 ms across controllers. Your result is at most two task cycles old when the planner reads it. A faster bus buys nothing until exposure and processing shrink.

How do you build the handshake so a stale result never moves the axes?

Put a status word and a sequence number beside the coordinates and gate every move on the sequence changing: one result per trigger, status read first, coordinates used only when status says valid and the counter has advanced. That rule alone stops stale-motion crashes.

Field Type Scaling Bytes
Status UINT16 0 idle, 1 busy, 2 valid, 3 error 2
Sequence UINT32 +1 per result 4
X, Y, Z INT32 each micrometers 12
Angle INT16 0.01° steps 2
Total 20

Integers, not floats: the vision side writes exactly what the calibration produced, and no two devices argue over byte order or decimal separators. The 32-bit micrometer word spans more than two kilometers of travel, so range never binds; the 16-bit angle word reaches ±327.67°, comfortable for an angle normalized to ±180°.

The protocol in one pass:

  1. The master sets a trigger bit and a part-select index in its output data.
  2. The vision side runs the shot, writes status 1, then coordinates, then status 2 and the incremented sequence in the next cycle.
  3. The motion task moves only when the sequence differs from the last pick's and status reads 2.
  4. On error, the vision side writes status 3 and freezes the coordinates, so old numbers can never pass as fresh.

Several parts in the area, one pick per cycle? Make the coordinates a record array: per part X, Y and Z in 12 bytes, angle in 2 and a quality word in 2 — 16 bytes each. Sixteen parts cost 256 bytes plus the 6-byte header, still one frame; the ordering tactics are in picking a full tray from one snapshot. The fault and recovery sides are covered by why a stale vision result must trigger a fresh measurement and re-handshaking after a controller fault.

What should you check before ordering camera and controller?

Three documents decide the order: the camera's coordinate-frame and unit definition, the slave device description with its process-data fields, and the motion controller's task time with spare capacity. The geometry and pixel math above you can size yourself.

  • Camera frame and units in writing — axis directions, origin, millimeters or meters, clockwise or counter-clockwise angles. Without that sheet the datum is guesswork.
  • The ESI file or gateway mapping table, naming every field, width and scaling. It is the agreement between vision side and motion side.
  • Result latency measured on your part finish, not a white target: exposure count times exposure time, plus stated processing time.
  • Motion-task headroom: the transform and handshake logic must fit beside the motion planner; 30 percent spare is a sane floor.
  • Height range against your tallest part plus the tray, with reserve.
  • Ambient light survey of the hall — machine lighting changes between shifts and between cells.

For the wider device-side pass, the 3D camera integration checks list still applies to a gantry, and mapping vision status and alarms shows how the status word reaches the cell controls. When the numbers are settled, start a system build at the camera step, or compare candidates in the camera finder.

When nothing else on the machine speaks it. One camera into a robot controller is simpler over TCP; a PLC-paced cell passes results through a register handshake; and EtherNet/IP cells map the same 20 bytes their own way. Keep vision on EtherCAT when the drives are on it.

Per case:

Decision, per case: structured-light 3D when heights vary, 2D with fixed Z when the tray is fixed, never a profiler over a static area. Transform on the vision side, micrometer integers with a sequence number on the bus, one fresh result per pick, motion inhibited on anything older. Take the area size, tolerance and part heights to the applications desk for a first camera-and-controller pass.

Questions

Does the camera have to be an EtherCAT slave itself?

No. A native fieldbus sensor publishes results straight into the input process data, which is the simplest wiring. A GigE camera works just as well: a vision controller runs the locate job and a gateway slave on the master's bus carries the result across. Either way, get the device description — the ESI file — because it fixes field order, widths and scaling before any logic is written.

What units should the coordinates use on the bus?

Signed integers: X, Y and Z as 32-bit micrometer counts, angle as a 16-bit count of 0.01°. The micrometer word spans more than two kilometers of travel, so range never binds, and the angle word reaches ±327.67°, enough for an angle normalized to ±180°. Integers move between devices without byte-order or decimal-separator arguments, and every motion controller scales integer counts natively.

Why does the reported height drift as parts move across the area?

Sensor tilt. One degree of tilt mixes about 17 mm of horizontal position into the height reading per meter of standoff, since tan 1° is about 0.0175. Level the camera to the tray, re-teach the tray datum, and keep parts inside the central 80 percent of the field where lens distortion is smallest. If the drift survives that, the camera's height reference needs a fresh calibration.

Can the motion controller trigger the camera directly?

Yes. Put a trigger bit in the output process data, edge-detect it on the vision side, and write an acknowledge bit back; transport costs one to two task cycles. Fire it only with the axes at rest — a tray that was just indexed still rings, and roughly 50 ms of settle time before exposure removes the smear.

Does the rotation axis take the camera angle directly?

Almost. The camera measures angle in the image plane, and a rotation axis standing perpendicular to the tray takes it with one sign flip: R_cmd = -θc for a counter-clockwise-positive axis. Teach the sign once with a marked part at a known angle. A parallel gripper on rectangular stock wants alignment inside ±1°, so confirm the reported angle against that before the first release.