1、Process Data ObjectPDO(Process Data Object)
As mentioned earlier PDO belongs to process data used to transmit real-time data, that is, one-way transmission without the need for a response from the receiving nodeCAN message to confirm, from a communication terminology perspective, it belongs to the “producer-consumer” model PDO, as shown in the figure, it is like a food sales counter, the producer displays the “food”, but only the “needed” consumers will come to buy, without directionality
Producer-Consumer Model
The data length is limited to1~8 bytes. At most only1 frame is needed to transmit a piece of information or a variable.
1.PDO‘s CAN-ID Setting.
PDO communication is relatively flexible, in general, as long as it meets the PDO range, all CANID can be used as the node’s own TPDO or RPDO, also known as COB-ID, not limited by function code and Node-ID, as shown in the figure.
PDO‘s CANID Rules
In the PDO definition, it is artificially stipulated that TPDO and RPDO are defined, stipulating the Node-ID position in PDO and numbering the PDO, as shown in the table.
PDO‘s CANID Definition
PDO is divided into TPDO (sending PDO) and ( receiving RPDO), sending and receiving are referenced to the CANopen node itself (if CAN master or other slaves are opposite).TPDO and RPDO each have 4 data objects, each data object is 1 CAN message encapsulation, these are all containers for data transmission, as shown in the figure, the fruit basket is prepared for the user, it depends on what fruits the user puts in it.
Of course, if a certain node needs to transmit a particularly large amount of resources, there may be data objects like TPDO5, and their CAN-ID definition needs to break the predefined rules, for example, we can define Node-ID as 1 for the node where TPDO5 is 182h, here the PDO COB-ID’s low 7 bits no longer represent the Node-ID. In fact, all PDO‘s COB-ID has no necessary rule-based connection with Node-ID.
2.PDO‘s Transmission Form
PDO has two transmission methods: synchronous transmission and asynchronous transmission. As shown in the figure, 1, 2 are asynchronous transmission, 3, 4 are synchronous transmission.
PDO‘s Transmission Form
Asynchronous Transmission (Triggered by Specific Events)
There are two triggering methods, the first is triggered by object-specific events specified in the device sub-protocol (for example, timed transmission, data change transmission, etc.). The second is to trigger the sending of PDO by sending a remote frame with the same COB-ID as PDO. Currently, asynchronous transmission in applications mostly uses the first method.
Synchronous Transmission (Achieved Through Receiving Synchronization Objects)
Synchronous transmission allows all nodes to upload data or execute application instructions at the same time through synchronous messages, effectively avoiding application logic confusion and bus load imbalance caused by asynchronous transmission. Generally, the node sending the synchronous message is NMT master.
Synchronous transmission can be divided into periodic transmission (cyclic) and non-periodic transmission (non-cyclic). Periodic transmission is achieved by receiving
sync objects (SYNC), and can set 1~240 sync objects to trigger. Non-periodic transmission is triggered by remote frames or by object-specific events specified in the device sub-protocol.
3 PDO‘s Communication Parameters
PDO communication parameters define the COB-ID, transmission type, timing cycle, etc. RPDO communication parameters are located in the object dictionary index from 1400h to 15FFh, TPDO communication parameters are located in the object dictionary index from 1800h to 19FFh. Each index represents a PDO communication parameter set, with sub-indices pointing to various specific parameters. As shown in the table.
PDO‘s Communication Parameters
Number of Entries Parameter Entry Count: This index indicates how many parameters there are;
COB-ID: This is the PDO issued or received corresponding CAN frame ID;
Sending Type: This is the PDO sending or receiving transmission form, usually using cyclic synchronization and asynchronous manufacturer-specific events more;
Inhibit Time Production Inhibition Constraint Time (1/10ms): ConstraintPDO sending minimum interval to avoid causing a sharp increase in bus load, such as digital input too fast, leading to state change sending TPDO frequently, increasing bus load, so a constraint time is needed for “filtering”, this time unit is 0.1ms;
Event Timer Event Timer Trigger Time(Unitms): Timed sending PDO, its timing time, if this time is 0, then this PDO is sent on event change.
SYNC Start Value Synchronization Start Value: For synchronous transmission PDO, it will only be sent after receiving a certain number of sync packets, this sync start value is the number of sync packets. For example, set to 2, it will only be sent after receiving 2 sync packets.
4 PDO‘s Mapping Parameters
PDO mapping parameters are a difficulty for beginners learning CANopen, it includes a list of objects in the object dictionary that are mapped to the corresponding PDO, including data length (unit, bits), which both producers and consumers must know to correctly interpret PDO content. It is to link communication parameters, application data, and specific CAN message data together.
RPDO communication parameters 1400hto15FFh, mapping parameters 1600hto17FFh, data is stored in 2000h after the manufacturer’s custom area;TPDO communication parameters 1800hto19FFh, mapping parameters 1A00hto1BFFh, data is stored in 2000h after the manufacturer’s custom area.
To make the mapping more intuitive, the table simulates TPDO1, displaying parameters, application data, and CAN message data together, using different colors for different mappings.
PDO‘s Mapping Relationship in the Object Dictionary
2、Service Data ObjectSDO(Service Data Object)
SDO is mainly used for CANopen master station to configure parameters of slave nodes. Service confirmation is the biggest feature of SDO, generating a response for each message to ensure the accuracy of data transmission. As shown in the figure, this is like a courier, requiring the receiving party to sign for it before sending a confirmation to the sender to complete a delivery
SDO and Courier Receipt
In a CANopen system, usually CANopen slave nodes act as SDO servers, CANopen master nodes act as clients (referred to as CS communication). SDO clients can access the object dictionary on the SDO server through index and sub-index. Thus, CANopen master nodes can access any object dictionary item parameters of slave nodes, and SDO can also transmit data of any length (when data length exceeds 4 bytes, it is split into multiple messages for transmission).
1.Communication Principle (communication principle)
SDO‘s communication principle is very simple, the sender (client) sends CAN-ID as 600h+Node-ID message, where Node-ID is the receiving party (server) node address, with a data length of 8 bytes;
The receiver (server) successfully receives it and responds with CAN-ID as 580h+Node-ID message. Here, the Node-ID is still the receiving party (server) node address, with a data length of 8 bytes
SDO Communication Principle
2.Fast SDO Protocol (Expedited SDO protocol)
The most commonly used SDO protocol is Fast SDO, which means that 1 round trip is enough. The prerequisite is that the read and write values cannot exceed 32 bits. As shown in the figure, it is a schematic diagram of the Fast SDO protocol. The command directly includes the index, sub-index, and data to be read and written. It can be said to hit directly.
The difficulty of Fast SDO lies in remembering the CS command symbols, which readers need to bookmark this schematic diagram
Fast SDO Schematic Diagram
Through Fast SDO, you can directly read and modify values in the object dictionary of CANopen nodes, so it is often used not only for parameter configuration but also for critical data transmission. For example, when CANopen controls the rotation angle of a robot’s motor, it uses SDO for transmission to ensure reliability
3 Normal SDO Protocol (Normal SDO protocol)
When the value to be transmitted exceeds 32 bits, Fast SDO transmission cannot be used. Normal SDO must be used for segmented transmission. It is rarely used in applications, generally used for CANopen node firmware upgrades or for gateway conversion MVB bus data applications that can reach a maximum of 256 bits.
The difficulty of Normal SDO protocol lies in the packet segmentation logic and changes in CS command symbols. It is still difficult to remember, and readers need to bookmark the following schematic diagram.
Of course, the CAN frame ID of Normal SDO is the same as that of Fast SDO, still the sender (client) sends the message CAN-ID as 600h+Node-ID, and the receiver (server) successfully receives it, responding with CAN-ID as 580h+Node-ID message
3.1. Download Protocol download protocol as shown
3.2Upload Protocol upload protocol as shown
This article is reproduced from Guangzhou Zhiyuan (original authors Zhou Ligong, Huang Minsi)