Today, Zheng Motion Assistant will share with you the hardware interface and functions of the ZMC432CL-V2 EtherCAT motion controller, a 6-axis stepper grating ruler with a fully closed loop.
I. ZMC432CL-V2 Product Introduction
The ZMC432CL-V2 high-performance multi-axis motion controller is an independent motion controller compatible with EtherCAT bus and pulse-based systems. It features high-speed real-time feedback, supports full closed-loop pulse control, and achieves high-precision, high-response motion control. High-precision positioning effectively eliminates mechanical transmission errors, meeting the requirements of high-precision machining applications.
1. ZMC432CL-V2 Hardware Functions
(1) Rich motion control functions: supports linear, circular, spatial circular, and helical interpolation. (2) Rich hardware interfaces: supports pulse axis (with encoder feedback) and EtherCAT bus axis, with 24 inputs and 12 outputs of general-purpose IO, some of which are high-speed IO, and 2 analog outputs (DA). (3) EtherCAT refresh cycle up to 250us, meeting the requirements of high-speed communication. (4) Supports 4-channel hardware comparison output, hardware timer, and precise output during motion, suitable for multi-channel vision flying photography and other occasions. (5) Supports power-off detection, power-off storage, and multiple program encryption methods, which can effectively prevent system failures, protect project engineering file data, and improve system reliability. (6) Project development is carried out through the pure domestic IDE development environment RTSys, which can perform real-time simulation, online tracking, diagnosis and debugging, is easy to use, and supports secondary development through joint programming of multiple high-level host computer languages.
For more details about ZMC432CL-V2, click → Stepper Control Grating Ruler Full Closed-Loop Solution: 32-Axis EtherCAT Bus Motion Controller ZMC432CL-V2.
II. Hardware Interface
III. Hardware Wiring
1. Digital input port IN wiring
General wiring diagram for input ports
Input port single-ended encoder wiring diagram
2. Wiring of digital output ports
General wiring diagram for output ports
Output port single-ended pulse shaft wiring diagram
IV. Pulse Full Closed-Loop Application
1. Develop using existing APIs
2. Stepper Motor External Grating Ruler Full Closed-Loop Solution: ① ZMC4 series high-efficiency network port read/write, PCIe/PCI series cards can share memory interface (batch read/write of shared memory 3-5us) ② Built-in backlash compensation, bidirectional pitch compensation, 2D plane compensation, etc. ③ Can simultaneously support mixed use of pulse axis and EtherCAT axis motion ④ Open PT/PVT interface allows customers to customize acceleration and deceleration algorithms for secondary programming.
3. Pulse full closed-loop wiring
The fully closed-loop motion controller generates corresponding control signals and sends them to the stepper driver to drive the motor. It also receives feedback signals from the grating ruler and compares them with preset target values. The stepper driver receives the control signals from the controller and converts them into angular displacement to drive the motor. The stepper driver can precisely control the motor's step angle and speed, thus achieving high-precision motion control. The grating ruler is used to monitor the position and motion state of the object in real time. In the pulse fully closed-loop system, the grating ruler is typically mounted on the moving parts of the motor to measure its actual position. The pulse fully closed-loop motion control system features fully closed-loop position feedback from an external grating ruler, correcting platform mechanical transmission errors in real time. Through real-time feedback, it ensures high-precision closed-loop operation and machining accuracy of the stepper system.
The ZMC432CL-V2 controller supports pulse transmission (DPOS) and encoder feedback (MPOS) across pulse axes Axis0 to Axis5. Real-time closed-loop pulse transmission and encoder feedback can also be achieved through parameter settings.
V. Stepper Driver Interface Wiring
1. Wiring ZMC432CL-V2 with a stepper driver (differential connection)
2. Wiring ZMC432CL-V2 with a stepper driver (single-ended common anode connection)
VI. Interface wiring of the grating ruler
1. Wiring ZMC432CL-V2 with incremental optical encoder ruler (differential connection)
2. Wiring ZMC432CL-V2 with Absolute Grating Ruler
VII. Pulse Full-Loop Test Code
The test procedure is as follows:
·
'/************************************************************'Task ID: None'Function: System Initialization'Input: None'Output: None'Return Value: None'Remarks: None'****************************************************************/GLOBAL SUB SysInit() 'Test Firmware Information'?"Test Firmware Information: ver 24.8.28 : "version_build, "SERVO_PERIOD: "SERVO_PERIOD 'Axis Allocation GLOBAL CONST TestAxisId=5 'Thread Allocation GLOBAL CONST IntCycleTask=1 GLOBAL CONST OtherTask=2 'Other Variables GLOBAL gvCLStstus,gv_HandMode GLOBAL gv_P,gv_I,gv_D GLOBAL gv_VF,gv_AF,gv_OV 'Axis Initialization Parameters GLOBAL gv_Speed,gv_Accel,gv_Decel GLOBAL gv_Sramp,gv_Inch GLOBAL gv_Units GLOBAL gv_mpos,gv_input GLOBAL VpMode '*********************Axis parameter initialization********************* gv_Units=100 gv_mpos =4000 gv_input=-20043 gvCLStstus=0 gv_Speed=10 gv_Accel=100 gv_Decel=100 gv_Sramp=0 gv_Inch=1 gv_HandMode=0 VpMode=0 '**********************System initialization********************** RAPIDSTOP(2) 'Stop all axes WAIT IDLE DELAY(100) DATUM(0) 'Clear axis alarms WAIT IDLE '*******************Axis parameter initialization********************* BASE(TestAxisId) 'Disable closed-loop function SERVO=OFF ENCODER_SERVO=OFF 'After disabling the closed-loop function, remotely switch ATYPE from 0 to 4 ATYPE = 0 DELAY(100) ATYPE = 4 'Clear axis coordinates DPOS=0 MPOS=0 'Update axis parameters UpDataAxisPara() 'Update PID parameters UpDatePid(0) ENDSUB'/****************************************************************'Task number: None'Function: HMI scan function'Input: None'Output: None'Return value: None'Remarks: None'*************************************************************/GLOBAL SUB SysScan() 'Update closed-loop status IF SERVO(TestAxisId) = ON AND ENCODER_SERVO(TestAxisId)=ON THEN gvCLStstus=1 ELSE gvCLStstus=0 ENDIFENDSUB'/************************************************************'Task Number: None'Function: Axis Parameter Settings'Input: None'Output: None'Return Value: None'Remarks: None'****************************************************************/GLOBAL SUB UpDataAxisPara() BASE(TestAxisId) UNITS = gv_Units ENCODER_RATIO (gv_mpos,gv_input) VP_MODE = VpMode SPEED = gv_Speed 'Update axis speed ACCEL = gv_Accel 'Update axis acceleration DECEL = gv_DEcel 'Update axis deceleration SRAMP = gv_Sramp 'Set S-curve time MERGE = ON 'Enable continuous interpolation function FS_LIMIT = 10000 'Positive soft limit RS_LIMIT = -10000 'Negative soft limit FE_LIMIT = 500 'Set maximum follow-up error FE_RANGE = 500 'Follow-up error ENDSUB during alarm'Update closed-loop status'/************************************************************'Task number: None'Function: Pid parameter update'Input: None'Output: None'Return value: None'Remarks: VR(0-10) '*************************************************************/GLOBAL SUB UpDatePid(Dir) IF Dir=0 THEN IF VR(0)=1314 THEN gv_P = VR(1) 'P: Proportional gain gv_I = VR(2) 'I: Integral gain gv_D = VR(3) 'D: Differential gain gv_VF =VR(4) ' Velocity feedback feedforward gain gv_AF =VR(5) ' Acceleration feedback feedforward gain gv_OV =VR(6) ELSE gv_P = 100 'P: Proportional gain gv_I = 50 'I: Integral gain gv_D = 50 'D: Differential gain gv_VF = 1000 ' Velocity feedback feedforward gain gv_AF = 2000 ' Acceleration feedback feedforward gain gv_OV = 0 ' Data updated to VR TABLE(1,gv_P,gv_I,gv_D,gv_VF,gv_AF,gv_OV) Local lv_i VR(0)=1314 FOR lv_i=1 to 6 VR(lv_i) = TABLE(lv_i) NEXT ENDIF ELSE VR(0)=0 VR(1) = gv_P 'P: Proportional gain VR(2) = gv_I 'I: Integral gain VR(3) = gv_D 'D: Differential gain VR(4) = gv_VF 'Feedforward gain VR(5) = gv_AF 'Feedforward gain VR(6) = gv_OV VR(0) = 1314 TRACE "PID parameters saved successfully" ENDIFENDSUB'/************************************************************'Task number: None'Function: Full closed-loop function switch'Input: None'Output: None'Return value: None'Remarks: None'*************************************************************/GLOBAL SUB ClosedLoop(Mode) IF Mode=0 THEN IF gvCLStstus= 0 THEN 'Configure pulse axis TestAxisId for full closed-loop function'Configure PID parameters BASE(TestAxisId) P_Gain = gv_P 'P: Proportional gain I_GAIN = gv_I 'I: Integral gain D_GAIN = gv_D 'D: Differential gain VFF_GAIN = gv_VF 'Feedforward gain for velocity feedback AFF_GAIN = gv_AF 'Feedforward gain for acceleration feedback OV_GAIN = gv_OV 'Velocity gain' Enable closed-loop function AXIS_ENABLE=1 ENCODER_SERVO = ON '0-Not enabled (default). 1-Enable closed-loop function'Important, before enabling servo, after enabling encoder_servo'You must complete a switch from atype to 4, otherwise it will report axis:0 config not support Servo. 'Unable to enable closed-loop control, reason unknown ATYPE = 0 DELAY(20) ATYPE = 4 'Pulse output + quadrature coding feedback SERVO = ON '0-Not enabled (default). 1-Enable closed-loop function DELAY(20) IF SERVO = ON THEN "Closed-loop parameter configuration complete, closed-loop control is open. Use the move command to move and monitor motion parameters on the oscilloscope." ELSE "Closed-loop parameter configuration complete, closed-loop control failed to open. Please check axis configuration." ENDIF ELSE BASE(TestAxisId) SERVO = OFF ENCODER_SERVO = OFF 'After turning off ENCODER_SERVO, you need to complete an ATYPE switch from 0 to 4 to ensure the closed-loop function is completely turned off. ATYPE = 0 DELAY(100) ATYPE = 4 "Closed-loop control switch is off. Use open-loop movement." ENDIF ELSEIF gvCLStstus=1 THEN 'Configure pulse axis TestAxisId as a fully closed-loop function. BASE(TestAxisId) P_Gain = gv_P 'P: Proportional gain I_GAIN = gv_I 'I: Integral gain D_GAIN = gv_D 'D: Differential gain VFF_GAIN = gv_VF 'Feedforward gain for velocity feedback AFF_GAIN = gv_AF 'Feedforward gain for acceleration feedback OV_GAIN = gv_OV 'Velocity gain?PID parameters updated" ENDIFENDSUB
Test results:
This concludes our introduction to the hardware interface of the ZMC432CL-V2 EtherCAT motion controller with full closed-loop stepping grating ruler using positive motion 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's technical 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 jointly improve China's intelligent manufacturing level. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.