Remote control of servo motor and servo drive system, there are many problems!

Aiming at the complexity, unity and instability of servo motor remote control wiring, this paper proposes a new method of servo motor control using open communication protocol DS301 and driver sub-protocol DSP402.

Foreword

CANopen is a high-level communication protocol based on the control of the local area network (CAN). The communication sub-protocol and device sub-protocol are often used in embedded systems . It is also a kind of field bus commonly used in industrial control. CANopen implements the agreement above the network layer (including the network layer) in the OSI model. The CANopen standard includes an addressing scheme, several small communication sub-protocols, and an application layer defined by device sub-protocols. CANopen supports network management, device monitoring and inter-node communication, including a simple transport layer that handles the segmentation of data and its combinations. In general, the data link layer and the physical layer will be implemented using CAN. In addition to CANopen, there are other communication protocols (such as EtherCAT) that implement the CANopen device sub-protocol.

CANopen is drafted and reviewed by the non-profit organization CiA. The basic CANopen device and communication sub-protocol is defined in CiA301. Sub-agreements for individual devices are extended based on CiA301. Such as CiA401 for I/O modules and CiA402 for motion control .

Aiming at the problems of complicated remote control wiring, single control and low reliability of servo motor, a new method of servo motor control using CANopen communication protocol and driver sub-protocol is proposed. Analyze the object dictionary and message format of CANopen protocol, and introduce the conversion of each step of CANopen servo control state machine and the message setting of PP, PV and HM3 clock servo control mode under CANopen protocol. The experimental platform was built by using CAN card and servo drive equipment, servo drive equipment and PC. The three modes of PP, PV and HM of servo motor based on CANopen protocol were successfully realized by the message setting on the host computer interface. The result of the real face shows that the message setting control motor is easy to operate and the communication data is fast and reliable. The user can monitor the servo motor well through the upper computer.

System architecture

The entire control system consists of a PC, a CANopen host computer, a USBCAN adapter, and a servo drive device. The CANopen communication part is realized by the DS301 protocol. The servo control part is realized by the DSP402 protocol as the slave node of the servo drive device. It has the CANopen communication function and is responsible for the current, speed, position and other control objects of the motor. It is connected to the bus through the communication interface and will be the information. The host computer interface is transmitted to the computer; the host computer interface controls the servo drive device through the USBCAN adapter according to the feedback information of the slave station. Figure 1 shows the overall architecture of the servo control system for the open communication protocol.

Figure 1 Overall architecture diagram of open communication protocol servo control system

Open communication protocol servo control principle

1 CANopen communication device model

CANopen's device model is divided into the following three parts: communication unit, object dictionary, and application process. Users can use this model to describe devices with completely different functions.

The core concept of CANopen is the object dictionary, which contains all the parameters describing the device and its network behavior. Both the application unit and the communication unit can ask for this parameter list. The parameters in the object dictionary are identified and located by a 16-bit index and a bit index.

The communication part is composed of CAN transceiver, CAN controller and CANopen protocol stack. The communication object is defined in the protocol stack: NMT (network management message), PDO (process data) SDO (service data object) predefined message or All content and functions of special energy objects (including synchronous messages, emergency messages, time stamp objects, etc.) are described by these communication objects, and communication between all devices is also completed by these communication objects. The NMT is used for the state management of the slave station and the communication state of the slave station itself. The SDO is used by the master station to configure and monitor the object dictionary of the slave station. PDO is used to transmit high speed, small data. Special feature objects are used to synchronize the communication objects (usually PDO) in the network. The application part is the definition and description of the basic functions of the device. It is the link between the connected device and the host computer of the main station. Its core function is to parameterize, state control and monitor the device by accessing the object dictionary of the device, and transmit the device at high speed. Process data information.

2 servo control mode

The description of the characteristics of the CANopen driver and motion control device sub-protocol DSP402 is very accurate. It not only defines the operating mode of the drive, but also defines the state machine for controlling the drive. The drive state machine is controlled by control word 6040 in the object dictionary and reads the state of the drive via status word 6041. The control state machine is shown in Figure 2.

Figure 2 Control state machine diagram

The state machine can be divided into the following three parts: PowerDisabled, PowerEbabled, and Fault. All states enter “Fault” after an alarm occurs. After power-on, the drive completes initialization and then enters the SWUTCH_ON_DISABLED state. In this state, CAN communication can be performed and the drive can be configured. This main power is still off and the motor is not excited. After the StateTransition 2, 3, 4, enter the OPERATIONENABle. At this time, the main power is turned on, and the drive controls the motor according to the configured working mode. StateTransition 9 completes the shutdown of the mains. Once the drive has an alarm, the status of the drive enters FAULT.

The PP mode (profile position mode) is a typical positioning mode that controls the motor to the target position in both single-step and continuous settings. The PV mode (profile speed mode) is the speed control mode, and the HM (homing mode) provides a variety of methods to reach the starting position.

System software and hardware design

1 system hardware design

This paper designs USB97 and servo drive devices and PCs to build a hardware platform. The servo drive control chip uses a DSP chip.

The system hardware is built as follows. Firstly, the relevant parameters are configured in TI's development environment, and the DS301 engineering project is established to complete the debugging operation of the CANopen protocol communication program. After the project is successfully debugged, download it to the drive, set the message in the host computer interface, and test the communication objects such as SDO, PDO, and NMT. If the test result is correct, the system hardware is built.

2 system software design

The software design of the whole servo control is established in CCS, which mainly includes the closed-loop control program of the permanent magnet synchronous motor and the realization of the CANopen protocol. Figure 3 shows the software design flow chart.

Figure 3 software design flow chart

The initialization part of the program mainly completes the initialization of the DSP system and the initialization of the CANopen communication.

The main work done by the initialization is as follows:

Initialize the relevant variables to enable the global interrupt, enter the servo motor encoder Hall sensor feedback UVW three-way signal to determine the initial electrical angular position of the motor .

The main work of initializing the communication is as follows:

Set the slave node address and CAN communication baud rate, initialize each pass object, complete the predefined mapping of each way, and finally enter the communication processing program.

3 servo control message settings

The CANopen message structure consists of an 11-bit COB-ID and a data field of up to 8 bytes. In the host computer interface, the NMT message setting is used to control the slave station to enter the pre-operation state or the running state, and then the SDO message is used to set various parameters (speed, position, etc.) of the servo control and the state of the state machine to make the motor control differently. The mode is run. Finally, by mapping the current parameters of the motor to the PDO, the value of the PDO message is read to obtain the current value of the motor, and compared with the set value to obtain the correctness of the control result. Control messages are all implemented by SDO.

The following is a list of PP mode control, PV mode control, and HM mode control messages:

1.PP mode control message list

2.PV mode control message list

3.HM mode message list

The above three control mode message operations are first set the servo control mode, and then input the relevant target control value (such as position, speed, zero return mode, etc.) according to the current mode, and finally use the 6040h to control the motor start and follow the state machine step. stop.

Simulation

The upper computer interface of the system consists of the upper computer interface of USBCAN and the monitoring interface of the motor. The upper computer interface of USBCAN is used as the CANopen message data monitoring interface, and the monitoring interface of the motor is developed by VB2008. In the host computer interface, the communication baud rate selects 1Mbps servo motor Node-ID is set to 1, the heartbeat period is 1s, the TPDO transmission period is 100ms, and the parameters of the motor current loop, position loop and speed loop are set at the same time. The text is sequentially input into the SDO control of the host computer interface, the motor starts and runs to the set value in the message, the display value of the motor manual remote controller is consistent with the set value, and the message display value in the host computer interface is also consistent with the set value. Successfully realized the control of servo control.

1PP mode

The position control curve in the motor monitoring interface is shown in Figure 4 below:

Figure 4 motor position control curve

Set the message value in the host computer interface and the motor starts. The motor accelerates first, and after reaching the set target speed value, it starts to run at a constant speed until it reaches the set target position value. The process data of the host computer is consistent with the change of the motor monitoring curve. If it is necessary to change the position value of the motor, a new control message is sequentially input in the upper computer interface, and the motor will continue to run to the new position according to the set value forward or reverse.

2PV mode

The motor first accelerates to the set target speed value, and then moves according to the set value. If you need to change the speed of the operation, you can also enter a new speed value in the host computer interface. The acceleration changes are as described above. During deceleration control, the motor decelerates until the speed is stopped. As shown in Fig. 5, the speed control curve is consistent with the change of the host computer data and the motor monitoring curve.

Figure 5 Motor speed control curve

3HM mode

The motor accelerates to the set speed first, then finds the origin position. After finding the origin, the motor returns to zero and decelerates until the current position value of the motor is viewed in the host computer interface and the manual remote controller servo motor of the motor. The current setting to the motor is described as the motor zero return operation is completed. Figure 6 shows the position control curve.

Figure 6 position control curve

in conclusion

In the actual application and application process, the system designed in this paper runs reliably, the data is accurate and easy to analyze, and the machine first accelerates the operation. After reaching the set target speed value, the uniformity and real-time performance are good, and the protocol stack program is easy to implant. This method can be extended to multi-motor control systems , and the CANopen communication protocol stack is suitable for all devices and is widely used in engineering applications.

HDD Enclosure

2.5 USB3.0 HDD Enclosure

Hdd Enclosure,Hdd Enclosure Usb Hard Disk Case,Hard Drive Disk Cas,External Hard Drive Enclosure

Shenzhen GuanChen Electronics Co., Ltd. , https://www.gcneotech.com