Open neojaw opened 1 year ago
The CAN id should be 0x700 + node_id where node_id
That means, we are right now sending the heartbeat only to one motor controller right?
the PDO message must be disabled at the beginning and enabled at the end:
to avoid interruptions?
The CAN id should be 0x700 + node_id where node_id
That means, we are right now sending the heartbeat only to one motor controller right?
No, right now we are not sending a valid heartbeat at all. A heartbeat message is always a broadcast message that is received and processed by all the nodes ("Hey everybody, I am node X and I am fine!"). The CAN ID has to be 0x700 + node_id
so that the receivers know which node it came from. Right now we use CAN ID 0x700
which would mean a node ID of 0 which does not exist in CANopen.
the PDO message must be disabled at the beginning and enabled at the end:
to avoid interruptions?
No, because the protocol says so. It only worked all this time because the motor controllers we were using didn't care much about protocol compliance.
The current code will not work with strictly CANopen compliant devices, e.g. Elmo Gold controllers.
0x700
. The CAN id should be0x700 + node_id
wherenode_id
is the node ID of the SPS (which should exist as a parameter). The size should be one byte, describing the node state (usually "operational", i.e.5
).configure_watchdog()
, the devices are told to listen for heartbeats from node 0 when instead they should listen to the node ID of the SPS.configure_PDO_mapping()
, the PDO message must be disabled at the beginning and enabled at the end: