Bus communication protocol

NiMotion integrated motor Modbus communication application case
Release Date : 2019-03-08 14:42:49

1 Introduction to MODBUS communication example

NiMotion integrated closed-loop stepper motor combines the technical advantages of stepper motor and servo motor, compared to standard stepper motor operation.
 
Quiet, less vibration, and integrated 14-bit high-resolution encoder for closed-loop control of position feedback,
 
It does not lose its position and maintains a stable position after positioning. There is no oscillation. The current output is automatically adjusted according to the load to reduce the temperature rise. In full
 
It can replace the traditional stepping motor when the requirements of energy saving and high load bearing are sufficient. Simultaneous closure
 
The loop stepper motor integrates I/O functions to facilitate user function expansion and simplify system complexity.


The traditional application of stepper motor is shown in Figure 1:





Figure 1. Traditional stepper motor application


Disadvantages of traditional stepper motor applications:


 Low integration, large space, troublesome wiring, troublesome installation, high cost;  Open loop control accuracy is usually low, no automatic correcting ability;  High failure rate and high maintenance cost;


 Internal I/O is not integrated. Users need to increase hardware expansion and increase user cost.  Look for zero point every time the power is turned on. It does not support power-down maintenance.  Self-diagnosis cannot be performed.

In response to the above problems in stepper motor applications, NiMotion has introduced an integrated stepper motor with MODBUS bus function, covering 42 series 57 series and 86 series, can be used with MODBUS


The bus-extended PLC controls the integrated motor of NiMotion. The special PLC with motion control function is no longer required, which reduces the user's use cost and greatly simplifies the difficulty of engineering design and engineering implementation.


Main features of NiMotion integrated stepper motor:

 CAN & CANOPEN & Modbus bus connection, distributed control;  Integrated I / O, easy to local control signal      feedback control;

 Integrated stepper motor driver;  Rich alarm function;  Unique and efficient origin setting method;  Closed        loop control;

 Unique and efficient origin setting method;  Online upgrade program.


NiMotion integrated closed-loop stepper motor solution:





Figure 2. NiMotion integrated closed-loop stepper motor application




This paper focuses on the introduction of MODBUS communication through the RS485 communication expansion interface of PLC and the integrated motor of NiMotion, thus further controlling the operation of the motor. In this example, the integrated stepping motor of NiMotion STM42 series, STM57 series and STM86 series is applied.

The PLC uses the power generation (LS) PLC model as XGB as the Modbus master station. The NiMotion integrated motor acts as a Modbus slave and supports the standard MODBUS-RTU protocol. The communication mode of the Modbus protocol is a single master/multi-slave mode. Only the master station can issue a query (inquiry), and the slave station performs the processing required by the query and replies with the response information.

2 hardware connection

2.1 Hardware Catalog

1.LS XGB PLC Modbus-RTU communication interface

2. Integrated closed-loop stepper motor: STM5776A-485-OFS-A

3. 1 connection terminal

4. Several power lines

5. Integrated closed-loop stepper motor Modbus communication line


2.2 Integrated closed-loop stepper motor and LS PLC hardware connection






Integrated closed-loop stepper motor Modbus communication port and PLC Modbus communication port




LS PLC Modbus master can support up to 32 integrated closed-loop stepper motor slave stations



3 Integrated closed-loop stepper motor Modbus communication parameter setting

Integrated closed-loop stepper motor communication parameter setting Slave address: 00, baud rate: 9600bps, data bit: 8, stop bit: 1, check digit: none; slave address setting range: 0-127;


Note: If you need to change the integrated closed-loop stepper motor address, baud rate, network data format and other parameters, please refer to the "Integrated Closed-Loop Stepper Motor MODBUS Bus User Manual".




4 LS XG 5000 programming software to establish PLC engineering


4.1 Establishing a new project


Double-click the XG5000 programming software icon, and then select a new project in the project new directory. The XG5000 software programming window automatically pops up the new project file setting window.



After the setting is completed, click the OK button to enter the main program editing window.




4.2 Cnet parameter settings

Right-click "NEW PLC [B0S0 built-in Cnet]" in the tree structure of the main program editing window to automatically pop up the Cnet basic setting window. In this window, you can set communication parameters such as Cnet communication mode and baud rate. In this example, the communication baud rate is 9600, data bit 8, stop bit 1, parity bit NONE. In this example, the PLC and the integrated closed-loop stepper motor are communicated by Modbus protocol, and the PLC is the modbus master station. The closed-loop stepper motor is a slave, so the operating mode channel 1: XGTSever, channel 2: P2P is used.





When the setting is completed, click the OK button to return to the program editing window.
 



5 LS PLC programming

5.1 MODBUS communication register correspondence



The correspondence between LS-XGB PLC and integrated closed-loop stepper motor MODBUS communication register is as follows:






Read the slave address as 0 and the address is 21 single register data. The corresponding message is as follows:


Request message





Response message



Request message

Response message



One register data value headed by the master station D00050 is stored in a word register headed by 0x40051 with a slave address of 0. The corresponding message is as follows:

Request message





Response message

 
If you have any questions, please refer to the "Modbus Protocol Industrial Automation Network Specification" and Li Maisheng "Integrated Closed-Loop Stepper Motor Modbus Bus User Manual"



5.2 P2P channel setting

To create a P2P communication block, right-click "NEW PLC [B0S0 built-in Cnet]" in the main program edit window tree structure and select "Add Item", then select "P2P Communication".








5.3 P2P communication Modbus function block call




 



P2P communication Modbus function block call



P2P communication Modbus function block configuration notes:

◇ Set the driver to select Modbus RTU Client in the Modbus function block in the P2P channel; P P2P function needs to be selected in the Modbus function block in the P2P channel: read and write;
 
◇ If the message mode of the Modbus function block in the P2P channel is to write a single holding register, it should be selected: 1 individual. If writing multiple holding registers should be selected: 2 continuous;  

◇ If the message mode of the Modbus function block in the P2P channel is to write a single holding register, it should be selected: 1 individual. If writing multiple holding registers should be selected: 2 continuous;

◇ The relative station number in the Modbus function block in the P2P channel is the Modbus slave address. 


5.4 Writing PLC Programs and Variable Definitions

In this example, the LS PLC is used as the Modbus master station to send three messages to the slave-station integrated closed-loop stepper motor to realize the fixed-length motion of the integrated stepping motor in the position mode. The Modbus communication message is as follows:


◇  00 10 00 51 00 01 02 00 06                    The integrated closed-loop stepper motor state is switched from no fault to ready to start;
◇  00 10 00 51 00 04 08 00 4F 00 01 00 00 00 64 Send target location and direction;                         
◇  00 10 00 51 00 01 02 00 5F        Integrated closed-loop stepper motor 

Start to write the plc program through the XG5000 programming software, and double-click "variable/comment" in the main program editing tree structure to enter the variable definition table:





 



 


Comments and variables


Double-click "NewProgram" in the main program tree structure window after the variable definition is completed.






 


 



 



 


6 program operation and monitoring

After the hardware connection is completed and confirmed, the download program can be commissioned.






Main program monitoring






Device register monitoring






Modbus master message monitoring




7 Summary

According to the above example, the NiMotion integrated stepping motor has high integration degree, which can greatly reduce wiring and easy installation compared with the conventional motion scheme, and can fully save the installation space, prevent burnout and other damage protection measures, and is particularly suitable for replacing multiple Motor equipment use, integrated IO and synchronization functions, CAN & CANOPEN & Modbus bus connection, distributed control.


It is convenient for users to monitor the production process, collect data and analyze data to form a highly flexible, personalized and networked production chain. To meet the development needs of Industry 4.0 Industrial Internet, Internet of Things, and cloud computing, it provides a solution to replace the traditional stepping motor for the user's intelligent manufacturing while saving user costs.



8 other

Refer to the company's "Integrated Closed-Loop Stepper Motor MODBUS Bus User Manual" for the specific operation instructions of the motor.
All or part of this manual is prohibited from being reproduced or copied without authorization.
  Product performance, specifications and appearance may be improved due to improvements and will be subject to change without prior notice.
We strive to make the contents of the manual as correct as possible. If you find any problems or errors or omissions, please contact Beijing Limai Control Technology Co., Ltd.