Share this

Vision capture and precise output of an eight-channel PSO motion controller

2026-04-06 05:46:09 · · #1

This article mainly introduces the application of the EtherCAT controller with positive motion technology in multi-channel visual aerial photography and multi-point precise output. It adopts the high-performance ZMC408CE controller, and the high-speed FPGA inside the controller realizes the hardware position comparison output and precise output functions, realizing motion control + multi-channel visual aerial photography and precise output functions.

01. Hardware Introduction

The ZMC408CE is a multi-axis, high-performance EtherCAT bus motion controller launched by Zheng Motion. It has communication interfaces such as EtherCAT, EtherNET, RS232, CAN and USB flash drive. The ZMC series motion controllers can be used in various occasions that require offline or online operation.

The ZMC408CE supports 8-axis motion control, expandable to a maximum of 32 axes, and supports linear interpolation, arbitrary circular interpolation, spatial circular interpolation, helical interpolation, electronic cam, electronic gear, synchronous following and other functions.

The ZMC408CE supports 8-axis motion control and can use pulse axes (with encoder feedback) or EtherCAT bus axes. The general-purpose I/O includes 24 input ports and 16 output ports, some of which are high-speed I/O, with EtherCAT having a refresh cycle of up to 100us.

The ZMC408CE supports 8 channels of hardware comparator output, hardware timer, and precise output during motion. It also supports 8 channels of PWM output, with corresponding output ports OUT0-7. It supports simultaneous triggering of hardware comparator output for 8 channels, which is suitable for multi-channel visual shooting applications.

The ZMC408CE supports three programming methods: PLC, Basic, and HMI configuration. PC-based API programming supports interfaces such as C#, C++, LabVIEW, Matlab, Qt, Linux, VB.Net, and Python.

The ZMC408CE features a built-in high-precision PSO (Position Synchronization Output) function, which allows for equal-spaced laser output even when adjusting for deceleration during the machining of fillets and curves, particularly in high-speed machining applications.

For instructions on how to use the PSO function of the ZMC408CE to achieve visual aerial photography, please refer to the following description and reference examples.

02. Visual Flying Photography

To address the issue of insufficient production efficiency in traditional vision-based fixed-position shooting, vision-based aerial shooting is increasingly being used in some applications to achieve visual image capture. This involves a mechanism that moves along a predetermined trajectory; when it reaches the capture point, the motion axis continues moving without stopping, instantly completing the aerial capture function. Throughout the entire process, the moving mechanism remains continuous, thus saving operating time, improving efficiency, and ensuring operational accuracy.

(1) While ensuring accuracy, it is possible to reduce speed without slowing down. The vt diagram is as follows.

(2) If the accuracy is insufficient, the speed can be reduced slightly and the operation can be carried out in segments, but the speed will not be reduced to 0. The vt diagram is as follows.

03. PSO triggers flying camera

To ensure the accuracy of visual aerial photography, it is necessary to trigger the shooting in high-speed motion. The controller's PSO function can trigger the output at high speed and continuously, and the output port can respond within one pulse after the aerial photography signal is triggered.

The PSO function is implemented by the HW_PSWITCH2 hardware compare-output instruction.

PSO (position synchronized output) essentially compares the real-time encoder feedback position (pulse position that can be output when there is no encoder) with the position set in the comparison mode to control the OP to output a high-speed synchronous signal. A schematic diagram of PSO is shown below.

PSO typically synchronizes the output signal with the laser (or dispensing valve, etc.) and triggers the output switch at constant spatial (or constant time) intervals throughout all stages of the motion trajectory, including acceleration, deceleration, and constant speed phases, thereby ensuring that the pulse energy is applied evenly to the workpiece.

The characteristic of PSO function is that it can output signals at high speed and stably. Because the output accuracy is high enough, it can trigger the output signal at a fixed distance throughout the entire motion trajectory without considering the overall speed.

This means that the machine moves at a high speed in the straight section and decelerates in the rounded section while maintaining a constant output distance. The rounded section usually occupies a relatively small part of the entire processing, so that while ensuring the processing effect, the production capacity can be maximized.

The PSO function of the ZMC408CE motion controller can be applied to rotary visual sorting machines, providing advantages such as high-speed control of visual sorting, high-precision dispensing, and high-precision laser processing.

(1) The turntable can be controlled in real time, and the feedback position of the encoder can be recorded;

(2) A high-speed input port is connected to a sensor to sense and record the position of the incoming part;

(3) The PSO hardware position comparison output can be connected to 2-8 cameras for visual shooting, detection and measurement;

(4) The PSO hardware position comparison output can be connected to the air blowing port to filter and classify the visual detection results accordingly.

The parts are transported to the high-transparency glass turntable via a vibratory feeder. The incoming parts are then sensed by sensors, and their actual position is recorded by the high-speed latch input of the ZMC408CE. When the turntable rotates to the vision inspection station, the controller triggers the camera to take a picture through the high-speed output port. The image is then processed and calculated. Finally, the parts are automatically inspected and screened according to the preset standard inspection conditions, and defective products are rejected.

For inquiries regarding turntable visual screening applications, please contact the relevant personnel at Zheng Motion Technology.

04. PSO Function Implementation Instructions

The command to trigger continuous visual capture is HW_PSWITCH2. HW_PSWITCH2 is mainly used to set the trigger mode and the position of the comparison output. Some modes can be used with the HW_TIMER hardware timer to precisely control the output timing.

1. HW_PSWITCH2 -- Bus hardware location comparison output

HW_PSWITCH2(1,opnum,opstate,tablestart,tableend[,direction])

This instruction has many modes, suitable for different occasions, and supports one-dimensional, two-dimensional and three-dimensional comparisons. This article mainly focuses on the TABLE comparison point modes 1 and 3. For other modes, please refer to the Basic Programming Manual.

Each axis has its own hardware comparison output buffer.

Read syntax: Buff = HW_PSWITCH2([axisnum])

(1) Mode=1: Single-axis comparison

mode: 1 - Enable comparator; opnum: Corresponding output port

opstate: The output state of the first comparison point

tablestart: The TABLE number containing the absolute coordinates of the first comparison point.

tableend: The TABLE number containing the absolute coordinates of the last comparison point.

direction: The first point determines the direction; 0 indicates negative coordinates, 1 indicates positive coordinates, and -1 indicates no direction is used.

This mode is relatively simple. It requires the use of a TABLE register to store the coordinates of the positions to be compared and output into the TABLE register. Then, the PSO controls the OP port to invert once every time it reaches a comparison point, until all coordinate points have been compared. The diagram below shows the OP output of six comparison points, where P represents the comparison point.

(2) Mode=2: Clear comparison points

HW_PSWITCH2(2)

mode: 2 - Stop and delete incomplete comparison points.

This mode needs to be invoked before use to clear any data that may not have been completely compared. This command can also be sent during use to stop the comparison.

(3) Mode=3: Vector comparison mode

mode: 3 - Start comparator

opnum: The corresponding output port

opstate: The output state of the first comparison point

tablestart: The table number containing the first comparison point VECTOR_MOVED.

tableend: The table number containing the coordinates of the last comparison point, VECTOR_MOVED.

Note: The comparison points are written in the TABLE, and the OP is reversed once each time a comparison vector position is reached.

When using vector distance comparison, compare with VECTOR_MOVED. It is recommended to set the initial value of VECTOR_MOVED before continuous motion.

2. HW_PS2AXISNUM -- Sets the PS2 axis number

HW_PS2AXISNUM(axisnum1)=axisnum2

axisnum1: Buffer axis number

axisnum2: The actual axis number being operated on.

The HW instruction has a separate buffer. This instruction is used to reuse the HW_PSWITCH2 buffer of unused axes, pointing to the current axis of motion, and can perform multiple comparisons on the current axis simultaneously.

3. VECTOR_MOVED -- Current movement distance

VECTOR_MOVED=VAR

Parameter: VAR returns the distance the axis has moved currently, in units.

Multi-axis interpolation is a vector distance, so it is best to manually zero it before use. Before using mode 3, please check whether the initial value of this command is set correctly.

05. Single-axis multi-channel PSO visual aerial photography

Single-axis multi-channel PSO vision aerial photography triggers multiple different cameras to take aerial photos when the device moves to a designated position during single-axis motion. The trigger position can be set by the user or captured by sensor latching.

The drone needs to support hardware position comparison output, precise output function, and a controller with multiple independent HW channels. The ZMC408CE has 8 independent HW channels, which can simultaneously output signals to the camera to trigger drone acquisition.

Program example: Output OUT(0) and OUT(1) simultaneously.

RAPIDSTOP(2)WAIT IDLE(0)BASE(0)ATYPE=1 'Pulse axis type, compare required position DPOS'ATYPE=4 'Pulse axis type with encoder, compare encoder position MPOSUNITS=5000ACCEL=1000DECEL=1000SPEED=100SRAMP=50DPOS=0MPOS=0OP(0,OFF)OP(1,OFF)AXIS_ZSET(0)=19 'Encoder precise output HW_PS2AXISNUM(1)=0 'Move axis 1 buffer to axis 0, -1 cancel HW_PS2AXISNUM(0)=0 'Move axis 0 buffer to axis 0, -1 cancel HW_PSWITCH2(2) AXIS(0) 'Clear axis 0 comparison point HW_PSWITCH2(2) AXIS(1) 'Clear axis 1 comparison point TABLE(0,50,52,75,77,100,102,125,127,150,152,175,177) 'Set the comparison point table list TABLE(20,50,52,60,62,70,72,80,82,100,101,130,131,140,141) 'Set the comparison point table list HW_PSWITCH2(1,0,1,0,11,1) AXIS(0) 'Hardware position comparison output, for OUT(0) HW_PSWITCH2(1,1,1,20,33,1) AXIS(1) 'Hardware position comparison output, for OUT(1) TRIGGER 'Trigger the oscilloscope MOVEABS(200) END

The oscilloscope waveforms are shown in the figure: the waveforms of the four sampled channels are, in order, the target position of axis 0, the velocity of axis 0, output port 0, and output port 1.

Output 0 and output 1 can be compared and output simultaneously without interfering with each other, and both are output with reference to the position of axis 0.

06. Multi-axis multi-channel PSO visual aerial photography: Multi-axis multi-channel PSO visual aerial photography is mainly used in situations where multiple cameras are moving in multi-axis interpolation and multiple points of PSO visual aerial photography are required.

In projects, it is often necessary to compare and output on interpolated straight lines or interpolated circular arc trajectories. In this case, if the interpolation trajectory is broken down into the corresponding axis coordinate data, the amount of computation will be very large, which is not suitable for practical applications.

When triggering a flying shot for multi-axis position comparison, we often use the interpolated motion vector composite distance to determine the entire interpolated motion coordinate position, and then set the comparison point position on this coordinate for comparison.

Program example: OUT(0) and OUT(1) are the PSO outputs of the multi-axis interpolation of axis 0 and axis 1, respectively.

·

RAPIDSTOP(2)WAIT IDLE(0)WAIT IDLE(1)BASE(0,1)ATYPE=1,1UNITS=1000,1000ACCEL=1000,1000DECEL=1000,1000SPEED=100,100SRAMP=50,50MERGE=1 'Enable continuous interpolation DPOS=0,0MPOS=0,0OP(0,OFF)OP(1,OFF)VECTOR_MOVED=0AXIS_ZSET(0)=19 'Encoder precise output HW_PS2AXISNUM(1)=-1 'Cancel setting HW_PS2AXISNUM(1)=0 'Set PS2 axis number, point axis 1 buffer to axis 0 HW_PSWITCH2(2) AXIS(0) 'Clear axis 0 comparison point HW_PSWITCH2(2) AXIS(1) 'Clear axis 1 comparison point TABLE(0,50,52,75,77,100,102,125,127,150,152,175,177) 'Set the comparison point table list TABLE(20,50,55,80,88,100,102,130,135,160,162,175,180) 'Set the comparison point table list HW_PSWITCH2(3,0,1,0,11) AXIS(0) 'Hardware position comparison output, for OUT(0) HW_PSWITCH2(3,1,1,20,31) AXIS(1) 'Hardware position comparison output, for OUT(1) TRIGGER 'Trigger oscilloscope BASE(0,1) 'Two-axis interpolation MOVEABS(40,40) Linear interpolation MOVECIRCABS(40,-40,40,0,1) Circular interpolation MOVEABS(0,0) Linear interpolation END

The oscilloscope waveforms are shown in the figure: the waveforms of the four channels are sampled, representing the target position of axis 0, the target position of axis 1, output port 0, and output port 1 in sequence. Output 0 and output 1 are compared simultaneously at different positions. The output port is reversed once at each comparison point, for a total of 12 comparisons. Each output pulse width is controlled within 2 pulses.

YT mode: Data changes over time.

XY mode: Two-axis synthetic interpolation trajectory.

XYZ mode: Three-channel data composite trajectory, OP(0) varies with the composite vector distance along the XY axis. XYZ mode: Three-channel data composite trajectory, OP(1) varies with the composite vector distance along the XY axis.

That concludes our presentation on the visual capture and precise output of the eight-channel PSO motion controller from ZhengMotion Technology.

For more exciting content, please follow the "Zheng Motion Assistant" WeChat official account. For related development environment and example code, please contact Zheng Motion Technology sales engineer: 400-089-8936. This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to improve China's intelligent manufacturing level together. Copyright of this article belongs to Zheng Motion Technology. Please indicate the source if you reprint it.

Read next

CATDOLL 136CM Jing

Height: 136cm Weight: 23.3kg Shoulder Width: 31cm Bust/Waist/Hip: 60/54/68cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm An...

Articles 2026-02-22