Intro to CANopen Networks E. Zivi Nov 6, 2014 References: 1.A CAN Physical Layer Discussion Microchip Application Note AN00228a 2.Controller Area Network (CAN) Implementation Guide Analog Devices Application Note AN Controller Area Network, CANPRES Version 2.0, Siemens Microelectronics, Inc., October CAN physical layer ref: 6.Controller Area Network Physical Layer Requirements, TI SLLA270–January CAN Tutorial, 8.CANopen Introduction, ref: 1.Embedded Networking with CAN and CANopen, by Pfeiffer, Ayre and Keydel 2.CANopen Implementation: Applications to Industrial Networks, by Farsi and Barbosa 3.CAN in Automation,
Recall CAN & ISO/OSI Reference Model 2
CAN in Automation (CiA) CANopen & ISO / OSI Reference Models 3 High level CAN Protocols implement Application layer and skip the four intervening layers ISO CAN Data Link Layer ISO CAN Physical Layer Application CiA 301 CANopen Application Layer & Communication Profile CiA 302 CANopen Framework for CANopen Managers & Programmable Devices CiA 4xx Device Profiles CiA 401 Generic I/O Profile CiA 402 Motion Control Profile IEC Programmable Devices Profile Not Implemented by CAN or CANopen
CAN &CANopen Protocol Layers Application Layer Device profile for generic I /O modules (CiA 401, V3.0) Device profile drives and motion control (CiA 402, V2.0)... Interface and device profile for IEC programmable devices (CiA 405, V2.0)... CANopen application layer and communication profile (CiA 301, V4.1, EN ) CANopen framework for CANopen managers and programmable CANopen devices (CiA 302, V3.4) CAN data link layer (ISO 11898:2003) CAN physical layer (ISO 11898:2003) CAN Bus We’ll investigate CANopen high level protocols after we have a basic understanding of CAN 4
CAN Higher Level Protocol Examples 1.CANopen : In the late 1990’s CANopen device profile specifications where established. CANopen includes a.A node addressing scheme b.Communication protocols supporting network management, device monitoring and communication between nodes c.Application layer device profiles 2.SAE J1939 : In 1998, the Society of Automotive Engineers (SAE) published the J1939 application layer protocols on top of CAN for vehicle applications. J1939 based standards include: truck and trailer communication (ISO 11992), agriculture and forestry vehicles (ISO 11783) and marine navigation systems (NMEA 2000). 3.ARINC 825 : Newer commercial aircraft such as the Airbus A380 and the Boeing DeviceNet : Allen-Bradley (now Rockwell Automation) created DeviceNet as an application layer protocol on top of CAN in the 1990’s. DeviceNet CONFORMANCE TESTED® products have been certified by the Open DeviceNet Vendors Association (ODVA) to conform to the specification. 5
CANopen Attributes 1.Unique node IDs 1.7 bits of 11-bit CAN Message ID is node address 2.4 bits of 11-bit CAN Message ID is CANopen message type 2.Network Management (NMT) including NMT state machine, Boot-up, Heartbeat 3.Service Data Objects (SDOs) for network management 4.Process Data Objects (PDOs) for real-time process data 5.Each node contains an Object Dictionary with pre-defined entries for: 1.Node configuration 2.Process data 3.Mapping of process data to PDO messages 6.Electronic Data Sheets to automation network systems integration
CANopen Network Management State Machine Network States Available Services Pre- operational Operational Stopped PDO SDO Sync Time- stamp Emcy NMT Error control
MicroMod CANopen I/O
MicroMod CANopen Preprogrammed I/O MicroMod CANopen Generic I/O Message Implementation Comm Obj Message # of Data Elements Message Data TypeI/O Definitions TPDO 11unsigned byteDigital In 0..7 RPDO 11unsigned byteDigital Out 0..6 TPDO 2410 bits in unsigned intsAnalog In 0..3 RPDO 248 bit duty cycle in unsigned intsPWM Out 0..3 TPDO 3410 bits in unsigned intAnalog In 4..7 Implements subset of DS401 CANopen Generic I/O Specifications. Electronic Data Sheet Configures system.
MicroMod CANopen DS-401 Generic Digital I/O TPDO 1 & RPDO 1 Message Mapping Digital Output (7bits) RPDO1 (1 byte) CID: 0100 nnnnnnn2 Data: xbbbbbbb2 Transmit Process Data Object TPDO1 on change of any of 8 digital inputs Update 7 bits of digital output upon Reception of Receive Process Data Object RPDO 1 Digital Input (8 bits) TPDO1 (1 byte) CID: 0011 nnnnnnn2 Data: bbbbbbbb2
MicroMod CANopen DS-401 Generic Analog Input TPDO 2 Message Mapping Transmit Process Data Object TPDO 2 on change of any of Analog Inputs 0 thru 3 Resolution = 5V range / (2 10 – 1) TPDO2 Analog Input 3 CID: 0101 nnnnnnn 2 Data: BBBBBBBB 16 (2 bytes) Data transmitted in little endian (Least Significant Byte First) form TPDO3 Provides a second bank of 4 Analog inputs Analog Input 3 10-bit Analog input is backed into 16 bit data words
MicroMod CANopen DS-401 Generic Analog (PWM) Output RPDO 2 Message Mapping Receive Process Data Object RPDO 2 changes Duty Cycle of PWM outputs 0 thru 3 Resolution = 1 / (2 8 – 1) RPDO2 PWM Output3 CID: 0101 nnnnnnn 2 Data: BBBBBBBB 16 (2 bytes) Data transmitted in little endian (Least Significant Byte First) form PWM Output3 8-bit PWM duty cycle is packed into every other byte
CANopen DS-401 Generic I/O 11-bit Message ID Format Comm Objects4-bit Msg ID7-bit Node IDDS-401 Generic I/O Definitions Msg bits b 10 … b 7 b 10 b9b9 b8b8 b7b7 b6b6 b5b5 b4b4 b3b3 b2b2 b1b1 b0b0 NMT Service0x SYNC Msg0x Emergency0x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Time Stamp0x TPDO 10x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Digital In 0..7 RPDO 10x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Digital Out 0..6 TPDO 20x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Analog In 1..4 RPDO 20x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Analog Out 1..4 TPDO 30x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Analog In 5..8 RPDO 30x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Analog Out 5..8 TPDO 40x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Analog In RPDO 40x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Analog Out TSDO0x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 RSDO0x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Heartbeat0x n6n6 n5n5 n4n4 n3n3 n2n2 n1n1 n0n0 Constructing DS-401 Generic IO Message IDs 4-bit Msg ID + 7-bit Node ID
CANopen Motor Lab Configuration CANopen Magic Node CANopen MicroMod Node L298 Driver Board MotorEncoder Frequency to Voltage Converter Bench Power Supply PWM Power Shaft Rotation Modulated Power Position Pulse Train Analog Voltage Proportional to Motor Speed CAN Messages Graphical User Interface
Maxon Motor Tachometer Calibration Angular Velocity (rad. / sec. ) = (rad. / sec. / V) × Tachometer Output (V) Tachometer Output is connected to MicroMod input Ain4
Maxon Motor Transfer Function Using CAN Lab #3 Procedure
CAN Lab #3 CANopen Magic Window Configuration MicroMod Heartbeat, Operational & PWM Duty Cycle (with Function key) messages added Filtered Trace windows added New Process Data visual display