CANopen教程
- 格式:ppt
- 大小:688.50 KB
- 文档页数:35
Content1CANopen 2 1.1EDS Files 2 1.2Support 2 1.3Features 2 1.3.1Basic information 2 1.3.2Basics based on CiA DS-301, V4.2.0 2 1.3.3Basics based on CiA DSP-406, V3.2 3 1.3.4Basics SDO communication 3 1.3.5Basics PDO communication based on CiA 301, V4.2.0 3 1.4Object Library 4 1.4.1Communication Profile Area based on DS 301 V4.2.0 4 1.4.2Device Profile Area 6 1.4.3Manufacturer specific Area 8 1.5Explanations to Object Library 9 1.5.1Object 0x6300 Encoder Cams 9 1.5.2Cam state registers 9 1.5.3Object 0x6400 Work Area 9 1.5.3.1Work Area Supervision 9 1.5.3.2Work Area State 9 1.6LSS / Layer Setting Service 9 1.6.1Configuration of Node-ID 10 1.6.2Configuration of Bit Rate 10 1.6.3Store Configuration Data 11 1.7SDO Services 11 1.7.1SDO Download 11 1.7.2SDO Upload 12 1.7.3SDO Abort 12 1.8Process Data PDO 12 1.8.1PDO Default Setting 12 1.8.2PDO Parameter Setting 12 1.9Error Handling 14 1.9.1Emergency Messages 14 1.10Error Objects 15 1.10.1Manufacturer-specific Status 15 1.11Non-Volatile Storage and Data Restoration 16 1.12Abbreviations 17 1.13Document Changes 171 CANopenThis document reflects the Novotechnik sensor protocol implementation of the standard CANopen protocol.A basic knowledge of the CAN Bus is required for a proper understanding of this document.Most of the definitions made are according to the following CiA Standard specifications.For making use of all the features that these specifications offer, a knowledge about them is absolutely necessary. The sensor supports the CANopen Communication profile DS-301, V4.2.0, Encoder profile DSP-406, V3.2 and Layer Setting Services (LSS) DSP-305, V1.1.2.1.1 EDS FilesFor integration in a common CANopen projecting tool, electronic data sheet (*.eds) files are provided.These files can be downloaded from the Novotechnik Web Site, see Downloads/Operating manualswhere also this document can be found.Electric data sheet see file Product series_CANopen.1.2 SupportIfyouhaveanyquestions,******************************************************.Electronic data sheets or user manuals for previous software versions are available on request.1.3 Features1.3.1 Basic informationVendor ID: 386 = 0x0182 (Novotechnik)Product code: TP1: 04035 = 0x0FC3, TH1: 04042 = 0x0FCA, TM1: 04228 = 0x1084, TF1: 04052 = 0x0FD4 Rev.-No.: f.e 196613 = 0x30005Serial No.: see product label, “YYMMxxxx”1.3.2 Basics based on CiA DS-301, V4.2.01.3.3 Basics based on CiA DSP-406, V3.21.3.4 Basics SDO communication1.3.5 Basics PDO communication based on CiA 301, V4.2.01.4 Object Library1.4.1 Communication Profile Area based on DS 301 V4.2.01) for 1 position marker2) for 2 position markers1.4.2 Device Profile Area* for 1 position marker: default value 0x01** for 1 position marker and product series TM1 / TF1: not available 1.4.3 Manufacturer specific Area1.5 Explanations to Object Library1.5.1 Object 0x6300 Encoder CamsEncoder cams are used to indicate if a position falls below or exceeds a defined value.1.5.2 Cam state registersCam active: the current position value is between the higher and lower cam-limitCam inactive: the current position value is not between the higher and lower cam-limit.The values for low limit (0x631x) and high limit (0x632x) regard the values for preset (0x6010) and measuring steps (0x6005). The value of hysteresis (0x633x) is added in direction of motion.Note: the cam high limit value can have a lower value than the cam low limitA change in cam state causes an EMCY message.The cam state objects (0x6300) are able to be mapped to the TPDOs.1.5.3 Object 0x6400 Work AreaIt is possible for encoders to define a so-called user defined working area.The main purpose for a work area is to get a high-priority information (via EMCY message) when the transducer’s p o-sition leaves its predefined working area.The actual work area information with work area low limit and work area high limit may be stored in object 0x6401 and 0x6402. This way, the area state object (0x6400) may also be used as software limit switches.1.5.3.1 Work Area SupervisionEach work area channel is fixedly linked to a position channel:1.5.3.2 Work Area StateThe values for low limit (0x6401) and high limit (0x6402) regard the values for preset (0x6010) and scaling (0x6501, 0x6502).A change in work area state causes an EMCY message.The work area state objects (0x6400) are able to be mapped to the TPDOs.1.6 LSS / Layer Setting ServiceTo configure the encoder via the LSS(according CiA DS 305) the encoder is handled as a slave, thePLC must have a LSS master functionality.A LSS-message is composed as follows:This applies to the COB-ID:• LSS-Master ⇒ LSS-Slave: 2021 (0x7E5)• LSS-Slave ⇒ LSS-Master: 2020 (0x7E4)LSS can only be used when the encoder is in the stopped status or pre-operational status.The NMT command for setting the encoder in stopped status is:To program via LSS the sensor has to be switched to LSS configuration state.There are two possible ways to do so:• Switch Mode Selective:only the addressed CANopen device is switched to the LSS configuration stateLSS requires data content in the following objects:Example:Vendor-ID (see index 1018/1) 0x0182 LSS-Command 0x40 Product code (see index 1018/2) 0x0BE0 LSS-Command 0x41 Rev.No. (see index 1018/3) 0x10003 LSS-Command 0x42 Serial-No. (see index 1018/4) 0x12345678 LSS-Command 0x43 After receiving the identification objects, the encoder answers with LSS-Command 0x44.• Switch Mode Global: all CANopen devices supporting LSS are switched to the LSS configuration stateWhen the CAN devices are in configuration state the Node-ID and/or the bit rate can be changed. 1.6.1 Configuration of Node-IDThe Node-ID can be programmed with the LSS-Command 0x11N ID: new Node-ID in the range of 1 (127)Err Code: 0: protocol successfully completed / 1: Node-ID out of rangeChange of Node-ID will cause:•Automatic alteration of COB-ID’s for SDO1, EMCY and Heartbeat and TPDOs.•Non-volatile Node-ID storage through …Store Configuration“ in the LSS mode configur ation.1.6.2 Configuration of Bit RateThe Bit Rate can be programmed with LSS-Command 0x13Table Index: 0x07: 20 kBaud0x06: 50 kBaud0x04: 125 kBaud0x03: 250 kBaud0x02: 500 kBaud0x01: 800 kBaud0x00: 1000 kBaudErr Code: 0: protocol successfully completed 1: Bit timing not supportedChange of Bit rate will cause:•The bit rate gets active•Non-volatile CAN bit rate storage through …Store Configuration“ in the LSS mode configuration1.6.3 Store Configuration DataThe LSS configuration data (Node-ID and Bit Rate) are stored to the non-volatile memory of the sen-sor using LSS-Command 0x17Err Code: 0: protocol successfully completed 2: storage media access error1.7 SDO ServicesService Data Objects SDO (according to CiA DS 301) manage the parameter data exchange, e.g. thenon-cyclical execution of the preset function.Parameters of device object library (object index/subindex see chapter 1.4 Object Library) can beread, written or stored by means of SDO.1.7.1 SDO DownloadThe SDO download service is used to configure the parameters.Command 0x2_: 0x22 write command, parameter to encoder0x23 write command, 4 Byte parameter to encoder0x27 write command, 3 Byte parameter to encoder0x2B write command, 2 Byte parameter to encoder0x2F write command, 1 Byte parameter to encoderCommand 0x60: confirmation: parameter receivedNODE-IDUsing writing to object 0x2000, non-volatile storage has to be done by w riting the“save”- signature (0x65766173) on object 0x1010/1 (TP1/TH1) or 0x1010/4 (TF1). These changes will become effective after a communication restart or a power up.Changing the Node-ID will affect all COB-IDs according to the “predefined co nnection s et”.Example: COB-ID TPDO1 = 0x180 + (Node-ID)BIT-RATEUsing writing to object 0x2001; non-volatile storage has to be done by writing the“save”- signature (0x65766173) on ob-ject 0x1010/1 (TP1/TH1) or 0x1010/4 (TF1). These changes will become effective after a communication restart or a power up.1.7.2 SDO UploadThe SDO upload service is used to read the parameters.Command 0x40: read command, parameters from encoderCommand 0x4_: 0x42 read command, parameter to encoder0x43 read command, 4 Byte parameter to encoder0x47 read command, 3 Byte parameter to encoder0x4B read command, 2 Byte parameter to encoder0x4F read command, 1 Byte parameter to encoder1.7.3 SDO AbortIf the SDO download or SDO upload service fails for any reason, the sensor responds with a SDO abort protocol. Abort Code: 0x06090011 subindex does not exist0x06090030 value exceeded0x06020000 object does not exist0x06010001 object is write only0x06010002 object is read only0x06060000 access error0x08000020 data transport error0x08000000 general error0x08000022 wrong state1.8 Process Data PDOProcess Data Objects (according CiA DS 301)manage the process data exchange, f.e the cyclical transmission of the position value. The process data exchange with the CANopen PDOs is a very slim process without protocol overhead.1.8.1 PDO Default Setting2 Transmit PDOs (TPDO) with each max. 8 bytes are provided:0x1800 TPDO1: default: Event-driven with event timer switched off (changeable to synchronous)0x1801 TPDO2: default: synchronous1.8.2 PDO Parameter SettingThe contents of the encoder-specific TPDOs can be configured by variable mapping according to cus-tomer´s requirements. This mapping has to be performed for the encoder as well as for the receiver.The PDO is limited to a maximum size of 8 bytes and 5 mappings per each PDO.Step 1: For changing of mapping, the sensor must be in properational mode and the MSB of PDOCOB-ID has to be set to 1 to deactivate it.Step 2: Clearing entries in mapping table of PDO1 (PDO2) => subindex 0x0 of object 1A00 (1A01)has to be set to 0x00.Step 3: Mapping of objects into PDOExample:A PDO shall be mapped in a way that the "current position", the "current speed" and the "current chiptemperature" are transmitted in one PDO .Mapping #1 “current position”:Mapping #2 “current speed”:Mapping #3: “current chip temperature”.Step 4: Setting entries in mapping table => subindex 0x0 of object 1A00 has to be set to the numbers of mapping en-tries (e.g. 0x03)Step 5: For re-activating the PDO, the MSB of PDO COB-ID has to be set to 0.Note:TPDO1 value for Event Timer must always be higher than the value for Inhibit Time (except for value 0).Failed sending of TPDOs can occur if:•more TPDOs shall be sent than the CANbus may accept due to insufficient CAN bit rate compared to TPDO/Event Timer •excessive bus load or unfavourable setting of COB-ID in the CANopen network prevents TPDOsending•Object 0x1800/5- event timer- is set to 0.1.9 Error HandlingDepending on the type of error occured, the sensor will react accordingly:* according to DS-301, see chapter 1.7 SDO Services** details see chapter 1.9.1 Emergency Messages1.9.1 Emergency MessagesCOB-ID EMCY in object 0x1014.Error-Register in object 0x1001.0x50xx Device Hardware 0x60xx Device Software 0x80xx Monitoring 0x90xx External Error1.10 Error Objects1.10.1 Manufacturer-specific StatusThe object 0x1002 shows the sensor status bit code and is used for internal process control purposes. For servicing this information can be requested via SDO (see chapter 1.7 SDO Services).Bit Definition (if bit value = 1)2 CAN Bus-Off Timer started0-1 NMT Condition of Sensor%11 stopped%10 operational%01 pro-operational%00 initialisation1.11 Non-Volatile Storage and Data RestorationDefault values for all data objects are stored in the non-volatile program memory.Data encryption to the non-volatile memory is only admitted in the pre-operational status.• Storage via LSS:Data must be stored through the LSS Service Configuration/Store while in LSS Configuration Mode (see chapter 1.6 LSS / Layer Setting Service)• Storage via SDO:Object 0x1010:Data is stored in the non-volatile memory during encryption of object 0x1010 with …save“ signature (0x65766173).Object 0x1011:Encryption of object 0x1011 with the sig nature …load“ (0x64616F6C) will upload data from the non-volatile memory. Default settings are being restored (see chapter 1.7 SDO Services).CAUTION: In case of custom programmed parameters like node-ID, averaging, bit rate etc. these will be reset to default in case of the corresponding reset command below (default values see chapter 1.4 Object Library).Object 0x1010 Object 0x1011 Subindex /1AllSubindex /2CommunicationSubindex /3ApplicationSubindex /4ManufacturerCOB-ID SyncGuard Time X XLife Time Factor X XHeartbeat Timer X XTPDO COB-ID D XTPDO Trans Typ X XTPDA Inhibit Time X XTPDO Event Timer X XTPDO Mapping X XNMT Startup X XNode-ID X (TP1/TH1) X (TF1) BitRate X (TP1/TH1) X (TF1) Number of position markers (only TP1 / TH1) XCustom (only TP1 / TH1) X Operating Parameters X XLinear Encoder Measuring Step Settings X XPreset Value X XCAM Enable X XCAM Polarity X XCAM Low Limit X XCAM High Limit X XCAM Hysterese XWork Area Low Limit XWork Area High Limit XX: data saved or restoredD: data set to default value• Delete via SDO Object 0x1010:Additionally to the functionality defined in CiA standard DS-301, CANopen library offers the possibility to delete data inthe non-volatile memory. Del ete process is initiated by sending the signature “kill” (0x6C6C696B) to object 0x1010.• Manufacturing Mode Object 0x1010▪Only TM1 series:If the sensor is out of function and the signature “boot” 0x746F6F62 in object 0x1000 (device type) is active, the sensor is in manufacturing mode. This mode can be left by power off-on or via the operationalcommand.1.12 AbbreviationsCAN Controller Area Networkch channelCOB-ID Communication Object Identifierconst constant parameter, only readableDLC Data Length CodeDS Draft StandardEMCY Emergency ServiceNMT Network-ManagementPDO Process Data ObjectPos Position (value)ro read only, parameter can changerw read/writeRx Novotechnik sensor is consumer of the CAN data frameRTR Remote Transmission RequestSDO Service Data ObjectSYNC Synchronisation messageTPDO Transmit Process Data ObjectTx Novotechnik sensor is producer of the CAN data frame1.13 Document ChangesRevision Changes Date WhoV00 First edition 16.07.14 VM/mm V07 1.2.5 / 1.3.1 object 1801x2: event driven transmission deleted for TPDO2. 1.3.1 objects:TPDO1 and TPDO2: name modified. 1.3.object 1800/2 and 1801/2 comment: synchronous1...240 instead 1...239, TPDO off: 0 added01.04.20 VM/mmV08 1.3.1 object 1010/4 user parameter data instead of manufacturer defined parameters.1.3.1 1010/5 added (Manufacturer data parameter). 1.10. signature kill 6C6C696B insteadof 6B696C6C, comment regarding manufacturing mode added21.01.21 VM/mmV09 1.2 Support added, all further chapter numbers changed1.8.3 Textual modifications 07.09.2117.11.22VM/mm。
L6C系列CANopen技术指导手册目录1 端口连接及设置 (3)1.1CAN总线连接器 (3)1.2L6C系列通讯参数设置 (3)2 CANOPEN通讯 (4)2.1CAN OPEN协议概述 (4)2.2L6C系列CAN OPEN通讯服务 (4)2.3CAN OPEN预定义连接集 (5)2.4对象字典(OD) (6)2.4.1 对象字典概述 (6)2.4.2 对象字典结构 (7)2.4.3 对象类型 (7)2.4.4 访问属性 (7)2.4.5 通讯对象字典 (7)2.5网络管理(NMT) (15)2.5.1 NMT模块控制 (15)2.5.2 NMT节点保护 (16)2.5.3 NMT Boot-up (17)2.5.4 NMT通讯状态机 (17)2.6过程数据对象(PDO) (18)2.7服务数据对象(SDO) (20)2.8应急指示对象(E MERGENCY O BJECT) (21)3 CANOPEN设备控制 (21)3.1设备控制框图 (21)3.1.1 操作模式 (22)3.1.2 状态机 (22)3.2对象字典 (23)3.2.1 对象类型 (23)3.2.2 设备控制对象字典 (23)4 L6C系列 CANOPEN操作模式 (30)4.1协议位置模式 (30)4.1.1 脉冲当量 (30)4.1.2 运动设置 (30)4.1.3 查询设置 (30)4.2协议速度模式 (30)4.2.1 运动设置 (30)4.2.2 查询设置 (31)4.3原点模式 (31)4.3.1 运动设置 (31)4.3.2 查询设置 (31)附录 A (32)附录 B (33)附录C (34)参考文献 (35)1 端口连接及设置本章主要介绍雷赛L6C系列伺服驱动器CAN总线连接器的定义及通讯设置。
1.1 CAN总线连接器雷赛L6C系列驱动器CAN总线端口采用的是标准RJ45规范,其端口定义如下:每个引脚定义如下表:提示:在L6C系列驱动器内部硬件电路已经有120欧姆的终端电阻接入,用户不必再附加终端电阻。
关于1 SICANopen通讯模块的使用方法一、STEP7硬件组态的建立:1、按实际硬件情况建立组态并将1 SI CANopen模块插入;3(0)inisi-8 nm CPU「1A2 ________ ms 1-8 P9/W "VIl n /irIFpjr-iDPert i,三12 P2 K Fort 2X1 P3\Are 31234PM-E DC24V5| 1 SI CANopen 32 Byt<6789101112ni- 4| co) imsi-8 PS/DP CPU怖稽[j 酸...订货号固一nn Jfiid i地址Q地址诊得地址注穿12即msi-s P9/DP CFV6IS7 151-GABO1-0A90Y3 22212047^Xi n *I*/冢如Il P2 l 1 foe 22(X5/力乃J P。
八3aw*的分1234y PH-E DC24y BEST 138-4CAOI-OAAO204A2043*5 1 1 SI CAKopon 32 Byte020570-B VI.0100. . 13!100. 13167在STEP 7硬件组态中,双击1 SI CANopen模块,在弹出的窗口中选择Addresses页面。
此处设置32个输入和输出字节的起始地址。
本例中起始地址设为十进制100。
2、1 SI CANopen模块的设置;在性-1 SI CANopen 32 Byte - (R0/S5)常规Addresses | Identification确定选择“参数”页面,设置“Baudrate”以及input/output data size,如上图所示。
PS:理论上Process data mode因为本次传输数据在32 Byte内,可选择Standard模式,但不知道为什么会报错,所以选择Fragmented模式。
双击STEP 7硬件组态中的CPU,选择“周期/时钟存储器”,修改过程映像输入/输出区的大小。
广州致远电子股份有限公司入门教程 CANopen 轻松入门类别内容 关键词CANopen DS301 摘 要 用于初次接触CANopen 的用户,主要以CANopen DS301为主要教授方向修订历史目录1. 前言 (1)2. CANopen在ISO层级中的位置 (2)3. CANopen协议诞生和发展 (3)4. CANopen的预定义报文ID分类 (5)4.1网络管理(NMT)与特殊协议(Special protocols)报文ID分类 (5)4.2过程数据对象(PDO)和服务数据对象(SDO)的报文ID分类 (7)5. 对象字典OD(Object dictionary) (9)5.1对象字典概述 (10)5.2通讯对象子协议区(Communication profile area) (10)5.3通用通讯对象(General communication objects) (10)5.4制造商特定子协议(Manufacturer-specific Profile) (11)5.5标准化设备子协议(Standardized profile area) (12)5.6对象字典和EDS文件实例 (12)6. 网络管理NMT(Network management) 与CANopen主站 (16)6.1NMT节点状态 (16)6.2NMT节点上线报文 (17)6.3NMT节点状态与心跳报文 (18)6.4NMT节点守护 (18)6.5NMT节点状态切换命令 (19)6.6CANopen主站设备 (20)7. 过程数据对象PDO(Process data object) (22)7.1PDO的CAN-ID定义 (22)7.2PDO的传输形式 (23)7.3PDO的通信参数 (24)7.4PDO的映射参数 (24)8. 服务数据对象SDO(Service data object) (26)8.1通讯原则(communication principle) (26)8.2快速SDO协议(Expedited SDO protocol) (27)8.3普通SDO协议(Normal SDO protocol) (27)9. 特殊协议(Special protocols) (30)9.1同步协议(Sync protocol) (30)9.2时间戳协议(Time-stamp protocol) (31)9.3紧急报文协议(Emergency protocol) (33)10. 免责声明 (35)1. 前言本教程适用于CIA CANopen协议DS301又名CIA301标准。
F1与KINCO伺服CANopen使用说明准备工作:●准备好PC与PLC通讯的标准以太网线。
●焊好PLC与伺服间的CANopen通讯电缆,通讯电缆务必使用屏蔽双绞线,2-7脚双绞在一起。
首末一定要加120Ω的终端电阻,F1端自带终端电阻可以不焊。
以下做法供参考:●用KincoServo上位机软件配置好伺服参数:(1)去掉伺服驱动器数字输入口功能,否则通讯无法控制伺服控制字、工作模式等对象。
(2)设置好伺服ID号。
整个CANopen网络里面不允许有重复的ID,点击“驱动器/控制面板/F005”查看/修改驱动器ID。
部分系列驱动器ID采用外部拨码开关设置,请注意查看手册说明。
(3)设置好伺服CANopen通讯波特率。
点击“驱动器/ECAN/其他”菜单,设置伺服驱动器CANopen通讯波特率,如下图所示。
完成准备工作我们就可以开始PLC编程工作了。
CANopen通讯要点:通讯电缆是否正确,终端电阻是否正确,站号是否正确,波特率是否正确,PDO配置是否正确,PDO传输类型是否正确。
1.打开软件新建工程,选择F1,点击OK。
2.根据自己的喜好选择PLC主程序的编程语言,然后点击OK。
3.开始进行CANopen通讯配置前,我们先需要添加伺服从站的EDS文件到Codesys里面来。
点击主菜单栏里的“Extras/add configuration file”选项。
找Kinco伺服的EDS文件,选中文件点击OK。
4.添加CANopen从站,设置通讯参数。
(1)F1有两路CANopen主站,选中其中一个口右键添加伺服从站。
(2)从站添加成功后,设置主站通讯参数。
下图中PLC主站波特率500K,波特率最高可设成1M,主从站波特率要一样;主站Node_ID可以设成0,不能和伺服从站ID重复。
(3)设置伺服从站的通讯参数。
下图中伺服从站的Node_ID设为1,从站Node_ID设置范围1-127,伺服驱动器ID要和这里设置的值一样为1;多个从站时ID要设置的都不一样。
华茂技术部CANopen实现1.简介从OSI网络模型的角度来看,现场总线网络一般只实现了物理层、数据链路层和应用层,CAN现场总线仅仅定义了物理层和数据链路层,实际设计中,这两层完全有硬件来实现。
但是CAN没有规定应用层协议,无法定义CAN报文中11/29位标示符和8字节数据的使用。
因此需要一个开放的、标准化的高层协议,使得协议支持各种CAN厂商设备。
CANopen是基于CAN的一个应用广泛的应用层协议,它提供了网络管理服务和报文传送协议,在保证网络节点互用性的同时允许节点的功能随意扩展。
下面这张图可以简要的描述CAN标准和CANopen协议之间的关系:CAN和CANopen在OSI网络模型中的位置2.CANopen通讯CANopen的核心概念是设备对象字典(OD:Object Dictionary),在其它现场总线(Profibus,Interbus-S)系统中也使用这种设备描述形式。
下面先介绍对象字典(OD:Object Dictionary),然后再介绍CANopen通讯机制。
2.1对象字典OD对象字典包含了描述一个设备和它的网络行为的所有参数。
对象字典是一个有序的对象组,每个对象采用一个16位的索引值来寻址,为了允许访问数据结构中的单个元素,还定义了一个8位的子索引,下图为对象字典的索引表:CANopen协议定义的通用对象字典结构表在表中可以看出,索引值从0x0000至0xFFFF,其中0x0000-0x0FFF区域和0x2000-0x5FFF区域是定义好的区域,不能用来开发,可以用来建立设备对象字典的区域为通讯子协议区域和标准的设备子协议区域,例如用于描述运动控制的设备子协议DS402中定义了索引项0x6072为max_torque, 索引项0x6073为max_current, 索引项0x60F8为max_slippage,等等。
CANopen网络中每个节点都有一个对象字典,用来描述当前节点的设备信息、网络行为和参数,在主从网络结构中,主站通过从站的对象字典来查询修改从站的参数或者对从站的网络行为进行指示。
canopen 字典使用方法(原创实用版5篇)《canopen 字典使用方法》篇1CanOpen 字典是一种用于描述CanOpen 设备及其属性的数据结构。
以下是一个CanOpen 字典的使用示例:```pythonimport can# 创建一个CanOpen 字典canopen_dict = {"device_id": "0x1234","mode": "OPMODE1","master_clock": 10000,"driver_reset": 1,"enable": 1,"select": "slot 0","secondary_reset": 0,"power_supply": "6V","output_status": 0,"load_status": 0,"command": "TEST_PATTERN","command_value": 0x5A,"master_clear": 0,"position": 0,"limit": [0, 0, 0],"home": [0, 0, 0],"target": [0, 0, 0],"run_state": 0,"tacho_count": 0,"temperature": -45,"velocity": 0,"actual_velocity": 0,"distance": 0,"actual_distance": 0,}# 发送CanOpen 数据帧data = can.Message(canopen_dict)data.arbitration_id = 0x55data.dlc = len(canopen_dict) - 1data.data = canopen_dict.values()send_can(data)```在上面的示例中,我们首先创建了一个名为`canopen_dict` 的CanOpen 字典,其中包含了设备的属性信息。
目录第一章概述------------------------------------------------3第二章PC10卡--------------------------------------------4第三章E3000-CANopen接口---------------------------73.1 CANopen信息框---------------------------------73.2 对象字典描述---------------------------------------73.3 制造商特定参数详细说明------------------------103.4 状态机操作------------------------------------------153.5 默认PDO配置--------------------------------------183.6CANopen通讯使用的相关配置参数---------20 第四章电子数据文档—EDS文件----------------------23 第五章故障描述和处理-----------------------------------24第一章概述CANopen 是基于串行总线控制器局域网(CAN)的网络系统。
CANopen 通讯行规(CiA DS-301)支持直接访问装置参数及时间关键型进程数据通讯。
CANopen 装置行规(CiA DS-402)定义了基本装置功能性的标准,而这些基本装置提供了附加供应商特定装置的多种特点。
CANopen通过以组织好的,如果必要可用确定好的方式允许节点间等对等数据交换来产生CAN的最大效能。
通过对网络启动与错误管理提供标准机理,CANopen 特定网络管理功能将方案设计、实施和诊断进行了简单化。
CANopen既支持双循环通讯也支持事件驱动型通讯,从而使将总线负载降到最低,但仍保持极短的反应时间。
ProNet伺服驱动器ESTUNCANopen使用手册修订记录日期修订版本描述作者初稿完成移振华增加第8章移振华1、第3,3,1章“PDC参数”修正PDO默认表格中的COB-ID和default值;易健2、增加第9章通讯例程”――目录一一1、概述............................................................................................................................................................................... . (5)1.1CAN主要相关文档 (5)1.2本手册使用的术语和缩语 (5)1.3CAN OPEN 概述 (6)2、接线和连接 (7)3、CANOPEN 通讯 (8)3.1CAN标识符分配表 (9)3.2服务数据对象SDO (10)3.3过程数据对象PDO (12)3.3.1PDO 参数 (14)3.4SYNC 报文 (20)3.5 E MERGENCY 报文 (21)3.6HEARTBEAT 报文 (23)3.7网络管理(NMT) (24)4、单位换算单元(FACTORGROUP) (26)4.1单位换算相关参数 (27)4.1.1positi onfactor (27)4.1.2velocityfactor (29)4.1.3accelerati onfactor (30)5、位置控制功能 (31)5.1位置控制相关参数 (33)6设备控制 (35)6.1控制状态机 (35)6.2设备控制相关参数 (36)6.2.1controlword (37)6.2.29statusword (38)6.2.3shutdown_option_code (3)9624disable_operation_option_code (40)6.2.5quick_stop_option_code (4)6.2.6halt_option_code (41)6.2.7fault_reaction_option_code (41)7、控制模式 (42)7.1控制模式相关参数 (42)7.1.1modes_of_operati on (42)7.1.2modes_of_operation_display (43)7.2回零模式(HOMINGMODE ) (44)7.2.1回零模式的控制字 (44)7.2.2回零模式的状态字 (44)723回零模式相关参数 (45)724回零方法 (47)7.3速度控制模式(PROFILE VELOCITYMODE ) (49)7.3.1速度模式的控制字 (49)7.3.2速度模式的状态字 (49)7.3.3速度控制模式相关参数 (49)7.4位置控制模式(PROFILE POSITIONMODE) (53)7.4.1位置模式的控制字 (53)7.4.2位置模式的状态字 (53)7.4.3位置控制相关参数 (54)7.4.4功能描述 (56)8、CAN通讯相关参数 (58)9、CANOPEN通讯例程 (59)9.1SDO 操作; (59)9.2PDO 配置 (59)9.3位置控制例子(P ROFILE P OSITON MODE ) (60)9.4位置插补控制(I NTERPLATE P OSITION MODE) (61)9.5速度控制(P ROFILE V ELOCITY MODE) (62)9.6回零 (6)2对象字典表 (64)1、概述1.1CAN 主要相关文档CiA DS 301 V 4.01: CiA CANopen Communication Profilefor In dustrial Systems - based on CALCiA DSP 402 V 2.0: CiA CANope n Device Profile1.2本手册使用的术语和缩语CANCiACOBEDSLMTNMTOD参数PDORORWSDO控制器局域网在自动化国际用户和制造商协会中的CAN。
第二章7:您当前的位置,速度和转矩模式下操作本章介绍了操作的放大器配置文件的位置,轮廓速度,轮廓转矩模式。
内容包括:7.1:您当前的位置模式操作 (164)7.2:速度曲线模式操作 (172)7.3:个人转矩模式操作 (173)7.4:个人模式对象 (174)7.1:您当前的位置模式操作点至点的运动曲线在轮廓位置模式中,一个放大器接收从该轨迹发生器的设定点来定义一个目标位置,并在指定的速度和加速度的轴移动到该位置。
这被称为一个点至点移动。
放大器进行配置文件的位置移动配置文件中的位置模式(操作模式[索引0x6060,第59页] = 1)。
过冲在点至点的移动,被称为过冲的加速度变化率。
在某些应用中,高速率的过冲可能会导致过度的机械磨损或材料损坏。
梯形和S形曲线的运动曲线为了支持不同级别的混蛋性,轮廓位置模式支持两种运动模式:梯形的个人主页上,有无限的混蛋,冲击有限的S-曲线(正弦)资料。
在梯形配置,过冲是无限的档案(开始的移动,当达到目标速度时,开始减速时,并在端部的举动)在角部。
S-曲线分析限制猛拉或“平滑”的议案。
需要注意的是S型曲线移动不支持独立的减速率。
相反,被施加的加速度率的加速和减速的举动。
此外,梯形和配置文件的位置特殊速度模式下的配置文件都支持改变当前移动的参数,而S型曲线不。
在处理一系列的点至点的移动,对这种差异进行了讨论。
165。
运动曲线类型的对象(索引0x6086,第178页)控制使用的是哪种类型的配置文件。
选择梯形或S曲线的指导,请阅读以下章节,然后梯形与S曲线的一些设计注意事项,P。
171。
(科普利控制,CANopen总线放大器还支持配置文件位置的特殊速度模式。
此配置文件类型类似于梯形的轮廓,但没有指定目标位置。
运动服从加速,减速和速度的限制,但继续移动,仿佛目标位置是无限的。
)相对与绝对运动在相对的移动目标位置被添加到的瞬时指令位置,其结果是在移动目的地。
以绝对移动,目标位置的偏移量从起始位置处理一系列的点至点移动一系列的点至点的移动处理的方法有两种:•作为一系列离散的配置文件(支持梯形和S型曲线移动)•作为一个连续的轮廓(梯形剖面支持移动)按照这两种方法的一般描述。
关于CANopen通讯模块的使用方法CANopen是一种用于工业自动化领域的开放性通信协议。
CANopen通讯模块是用于实现CANopen协议的硬件设备,可用于实现设备之间的数据通信和控制。
使用CANopen通讯模块的步骤如下:1. 硬件连接:首先,将CANopen通讯模块正确连接到设备的CAN总线上。
通常,CANopen模块有连接CAN总线的端口和连接设备的端口。
2. 配置通讯参数:在使用CANopen通讯模块之前,需要进行通讯参数的配置。
通常,CANopen模块提供了配置工具,可以通过PC连接进行配置。
需要配置的参数包括通讯速率、节点ID、节点类型等。
3. 实现对象字典:对象字典是CANopen通讯中的核心概念,用于描述设备的功能和状态。
在CANopen通讯模块中,需要根据设备的需求,定义和实现对象字典。
对象字典包括了对象索引和子索引,每个对象索引对应一个对象,每个子索引对应一个具体的属性或数据。
4. 实现应用程序:使用CANopen通讯模块进行通信和控制的核心是实现应用程序。
可以根据需要,使用编程语言(如C、C++、Python等)编写应用程序,通过CANopen模块提供的API进行数据读写、配置参数和控制操作。
应用程序可以根据对象字典中定义的数据结构进行数据的读取和设置,并且可以通过发送CANopen消息实现设备之间的通信。
5. 测试和调试:在完成应用程序的编写后,需要进行测试和调试。
可以使用CANopen分析仪等工具监控通讯数据的传输和接收情况,确保数据的正确性和稳定性。
如果遇到问题,可以使用调试工具对通讯模块进行配置和故障排除。
使用CANopen通讯模块时需要注意以下几点:1.确保硬件的连接正确,包括连接CAN总线和设备的电源等。
2.在配置通讯参数时,需要确保设备的节点ID唯一,并设置正确的通讯速率。
3.在定义对象字典时,需要根据设备的需求和规范进行合理的设计和实现。
4. 在编写应用程序时,需要熟悉CANopen协议和通讯模块提供的API,以确保正确的数据读写和控制操作。
CANOPEN简单操作方法1.打开anybus configuration manager软件,进入如下界面。
2.点击online在线-----选择Select Connection-----Config-------USB-to-CAN V2 conpact选择Bit Bate为1Mbit/s-----点击OK。
3.点击Connect在线,会出现如下图变化,如果和导入的EDS文件相对应将会呈现绿色外框,如果有错则会显示红色边框。
4.如果在线没有弹出Untitled configuration,点击如下图的放大镜Scan Network 搜索网络节点。
5.找到所需要的hcg文件,将hcg文件打开,点击下载(这一步也就是设置PDO Mapping)6.如果下载完成会显示finished就说明下载hcg成功,如果失败则会显示error occurs7.如果搜寻到的网络呈现绿色边框,但在下载hcg文件一直显示error occurs 或者可以上载hcg文件,但是始终无法下载hcg文件,则需要点击Options-----EDS Setting√----- configuration Download选择Manager并对下面两个选项√-----Online√-----确定。
8.点击tool----选择CAN Line Listertion可以监控CAN OPEN所报的警。
9.成功后选中节点,将右侧出现的Device Type属性设置为Manager,即作CANopen主站,其他配置与从站设置如下图。
10.点击下图小图标,进入界面,点击左上角的+号,添加EDS文件。
如果网络呈现蓝色边框,建议导入EDS文件,重组,如果呈现红色,注意看波特率是否设置正确,以及主从之间、STEP7的CANOPEN硬件组态、伺服参数设置是否正确。
请参考CANOPEN的测试文档。
CANopen通讯软件使用手册版权申明感谢您购买北京和利时电机技术有限公司的SE系列全数字步进驱动器(以下简称驱动器)产品。
SE系列全数字步进驱动器是以美国TI公司最新的数字处理芯片(DSP)作为核心控制芯片,采用了先进的全数字式电机控制算法,完全以软件方式实现了电流环控制,具备良好的鲁棒性和自适应能力,可配合多种规格的步进电机,实现速度、力矩和位置高精度、高响应的控制,适应于需要快速响应的精密转速控制与定位控制的应用系统,如:医疗机械、印刷机械、包装机械、造纸机械、塑料机械、纺织机械、工业机器人、自动化生产线等。
本用户手册是针对SE系列全数字步进驱动器的通信手册。
在本手册中,详细地说明了驱动器的串行通信CANopen总线通信协议和使用说明,以此来帮助用户建立上位控制器与驱动器的通信连接。
在使用SE系列驱动器的通信功能之前,请仔细阅读本用户手册,以保证正确使用。
第一章 通信功能简介 (1)第二章 CANopen协议 (2)2.1. 设置 (2)2.1.1. 设置站址 (2)2.1.2. 设置通信波特率 (2)2.2. CANopen通信规范 (3)2.3. 通信对象标识符地址分配 (3)2.4. 通信对象 (4)2.4.1. Network Management Objects(NMT) (5)2.4.2. Synchronization Object(SYNC) (5)2.4.3. Emergency Object(EMCY) (5)2.4.4. Process Data Object(PDO) (7)2.4.5. Service Data Object(SDO) (12)2.4.6. Nodeguard (15)2.4.7. Heartbeat (16)2.4.8. Bootup (17)2.5. 网络初始化和系统Bootup (18)2.5.1. 初始化流程 (18)2.5.2. NMT状态机 (19)2.5.3. 设备状态和通讯对象的联系 (21)2.5.4. 设备状态转换 (21)2.5.5. Bootup (22)第三章 CANopen 设备规范 (23)3.1 PDO映射 (23)3.1.1 RPDO映射 (23)3.1.2 TPDO映射 (23)3.2 设备控制 (24)3.2.1 状态机 (24)3.2.1.1 状态转换 (26)3.2.2 对象描述 (26)3.2.2.1 对象6040h:控制字 (27)3.2.2.2 对象6041h:状态字 (28)3.2.2.3 对象6060h:操作模式 (30)3.2.2.4 对象6061h:操作模式显示 (30)3.2.3 协议位置模式(Profile Position Mode) (30)3.2.3.1 对象607Ah:目标位置 (31)3.2.3.2 对象6081h:协议速度 (31)3.2.3.3 对象6083h:协议加速度 (31)3.2.3.4 对象6084h:协议减速度 (32)3.2.3.5 功能描述 (32)3.2.4 速度通讯模式 (34)3.2.4.1 对象60FF:给定速度 (34)3.2.4.2 对象6083h:协议加速度 (34)3.2.4.3 对象6084h:协议减速度 (35)3.2.5 周期位置模式 (35)3.2.5.1 对象607Ah:目标位置 (35)3.2.5.2 对象60C2h:周期描述 (36)3.2.6 回原点模式 (36)3.3 使用举例 (38)3.3.1 设备控制操作举例 (38)3.3.2 PDO使用举例 (39)3.3.3 SDO读写对象词典对象、驱动器内部参数对象及保存、恢复默认参数举例 .. 40 3.3.4 协议位置模式使用举例 (41)3.3.5 速度通讯模式使用举例 (43)3.3.6 回原点模式使用举例 (44)3.4 对象词典描述 (46)3.4.1 强制性对象 (46)3.4.2 任意对象 (46)3.4.3 设备协议对象 (50)3.4.4 设备商定义对象 (51)通信功能简介第一章 通信功能简介森创SE系列步进驱动器提供了与上位控制器的标准串行通信CAN总线通信硬件接口,可以实现编辑驱动器功能参数、监视运行状态和在线控制电机运转等功能,端口接线方式请参照相应产品说明书中的连线说明章节。