سؤال

After reading several CiA specifications, I am still having difficulty understanding PDO mapping, Process Image, and Process Data Exchange in CANopen.

I know SDO is used for configuration settings in the pre-operational state and has protocol overhead (since it can transfer more than 8 bytes of data).

In operational state, PDOs are well suited for inputs and outputs of process data. PDOs can transfer a maximum 8 bytes of data only.

There is the COB-ID of 11 bits which has a function code and a node number. Since the node number uses 7 bits, we can have a maximum of 127 nodes (for CANopen 2.0A network).

But there are four TPDOs` and four RPDOs which is confusing me. Why would you need multiple TPDOs and RPDOs? Also somewhere I read the device profiles may use entries from 6000h to 6FFFh to describe the device parameters and the device functionality and within this range up to 8 different devices can be described. But there can be 127 nodes in network then what's this 8 device?

هل كانت مفيدة؟

المحلول

PDOs are type of messages used for more efficient and asynchronous messages. PDOs can be sent on a timer, in response to a SYNC message or in response to an event (like a digital input changing). All 8 bytes of the CAN bus message payload is available for your data. This is in contrast to an SDO where only 4 bytes are available (there are multi-message SDOs like block transfer).

PDOs can only transfer 8 bytes at a time because that is the maximum transfer size of a CAN bus message. Contrast this to an SDO where a command byte and 3 byte address must be sent, leaving a maximum of 4 bytes of information.

By default a device has 4 RPDOs and 4 TPDOs allocated. 4 is just the default number of PDOs. More can be arranged, but you are responsible for creating the "channels" for them. That is picking an arbitration ID and making sure no other device on the bus is going to talk using that ID. You want multiple PDOs because:

  1. The messages have different bus priorities. 0x180+$NODEID wins the bus arbitration over 0x280+$NODEID, etc.
  2. PDOs gain their efficiency by nodes agreeing on what data will be sent ahead of time. This means they do not have wait for a request to send nor do they have say what data they are sending like SDOs do.
  3. The choice of data inside a PDO is not very dynamic. Devices often have to be brought out of the operational state to change the PDO mapping. In some devices the PDO mapping is completely static and cannot be changed at all.

TPDOs are messages transmitted from a device while RPDOs are messages that are received and write to a devices object dictionary.

The object dictionary defines the interface of a CANopen device. The dictionary is addressed using a 16-bit index and an 8-bit sub-index. The dictionary is split into ranges. 0x6000 through 0x6FFF is the range of indexes allocated to Device Profile variables. Device profiles provide standardized interfaces for more specialized classes of devices.

PDO mapping is how the information that is contained in a PDO is agreed upon. PDO mappings are entries in a devices object dictionary like any other. The 3 byte index, sub-index and the size of the parameter in bits are encoded in an UNSIGNED32.

نصائح أخرى

I like to think of PDOs (Process data objects) sort of like functions that can be programmed into a CANopen node.

Recently, I wanted to make a command that moved a motor, and reported back the current and the encoder position. I defined a PDO mapping with three SDO objects in it - the move (a receive PDO) and two transmit PDO (the current report and the encoder report).

Once they are defined and saved into the node, I can send over one PDO command with position and get back current and position.

Note the PDO is only executed when you send a SYNC command on the bus. Then ALL the nodes who have unexecuted PDOs process them and respond all at the same time.

We use it to make 7 motors move all at the same time (when the SYNC is set).

"But there are four TPDOs` and four RPDOs which is confusing me. Why would you need multiple TPDOs and RPDOs?"

You can map only 8 bytes to a one PDO (eg. 2 4-byte variables or 4 2-byte variables or 8 1-byte varialbles or its combinations). So if you would like to receive more information about the process then you need to use more than one PDO mapped. And definitely you want to map PDOs because then you will receive update from the device when value is changed. Without it you would have to poll the device with SDO what is not a best solution.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top