Difference between revisions of "CANopen Protocol"

From SoftMC-Wiki
Jump to: navigation, search
m
m
 
(19 intermediate revisions by the same user not shown)
Line 1: Line 1:
= CANopen Protocol =
+
softMC provides a number of categories of services that allow operation of CANopen device.
  
softMC provides a number of categories of services that allow operation of CANopen device.<br>
+
==Upload and Download Service Objects==
*''' Upload and Download service objects <br>'''
 
 
Application can read(upload) from or write (download) to device CANopen service data objects using either segmented or expedite SDO upload/download mechanism.<br>
 
Application can read(upload) from or write (download) to device CANopen service data objects using either segmented or expedite SDO upload/download mechanism.<br>
 
Those functions are implemented in CANOPEN.LIB
 
Those functions are implemented in CANOPEN.LIB
Line 13: Line 12:
 
* [[CANopen:CAN SDO WRITE REAL|CAN_SDO_WRITE_REAL]] - expedite download of single precision floating point number
 
* [[CANopen:CAN SDO WRITE REAL|CAN_SDO_WRITE_REAL]] - expedite download of single precision floating point number
  
*''' Controlling device state machine'''
+
==Controlling Device State Machine==
 
bus[0].phase = 0 ' put CAN device to PREOP mode<br>
 
bus[0].phase = 0 ' put CAN device to PREOP mode<br>
 
bus[0].phase = 4 ' put CAN device to OP mode
 
bus[0].phase = 4 ' put CAN device to OP mode
  
*''' Configuration of motion objects <br>'''
+
==Configuration of Motion Objects==
SoftMC requires DS402 compliant digital drive that supports following modes of operation and objects<br>
+
softMC requires DS402 compliant digital drive that supports following modes of operation and objects<br>
 
* Mandatory Cyclic Synchronous Position mode (so-called opmode 8)<br>
 
* Mandatory Cyclic Synchronous Position mode (so-called opmode 8)<br>
 
* Optional Cyclic Synchronous Torque mode mode <br>
 
* Optional Cyclic Synchronous Torque mode mode <br>
Line 26: Line 25:
 
* Status  Word - object 0x6041.0<br>
 
* Status  Word - object 0x6041.0<br>
 
* 32-bit Target position - object 0x607a.0<br>  
 
* 32-bit Target position - object 0x607a.0<br>  
* 32-bit Position feedback - object 0x6064.0<br>  
+
* 32-bit Position feedback - object 0x6064.0<br>
* Optional Digital Inputs and Outputs<br>
+
PDO mapping and association between above mentioned objects and internal data structures of softMC is shown in the example [[Program_Examples:CANopen:DS402_CAN_Drive_Setup]]<br>
+
==Optional Digital Inputs and Outputs==
corresponding firmware function are listed in Category:CANopen:Firmware-Functions [[Category:CANopen:Firmware-Functions]]
+
PDO mapping and association between these objects and internal data structures of softMC is shown in the example [[Program_Examples:CANOpen:DS402_CAN_Drive_Setup|DS402 CAN Drive_Setup]].<br>
 +
Corresponding firmware function are listed in [[:Category:CANopen:Firmware_Functions|CANopen Firmware Functions]].
  
'''Synchronization'''<br>
+
==Synchronization ==
 
For every bus cycle softMC broadcasts SYNC message to the devices and then sends to every slave a TX PDO that contains control word, target position and optional digital otputs. The motion controller expects all devices to send its TX PDO with the status word and the position feedback before the next SYNC.<br>
 
For every bus cycle softMC broadcasts SYNC message to the devices and then sends to every slave a TX PDO that contains control word, target position and optional digital otputs. The motion controller expects all devices to send its TX PDO with the status word and the position feedback before the next SYNC.<br>
 
A bus cycle is triggered by a hardware timer therefore SYNC messages are sent to the slaves with low jitter that should not exceed 70 usecs.<br>
 
A bus cycle is triggered by a hardware timer therefore SYNC messages are sent to the slaves with low jitter that should not exceed 70 usecs.<br>
 
Devices shall lock their PLLs to the softMC SYNC cycle and tolerate SYNC jitter of up to 100 usecs.
 
Devices shall lock their PLLs to the softMC SYNC cycle and tolerate SYNC jitter of up to 100 usecs.
  
'''Bus Cycle Example'''
+
==Bus Cycle Example ==
 
<pre><Start cycle>
 
<pre><Start cycle>
 
MasterTPDO1
 
MasterTPDO1

Latest revision as of 15:21, 26 August 2014

softMC provides a number of categories of services that allow operation of CANopen device.

Upload and Download Service Objects

Application can read(upload) from or write (download) to device CANopen service data objects using either segmented or expedite SDO upload/download mechanism.
Those functions are implemented in CANOPEN.LIB

Controlling Device State Machine

bus[0].phase = 0 ' put CAN device to PREOP mode
bus[0].phase = 4 ' put CAN device to OP mode

Configuration of Motion Objects

softMC requires DS402 compliant digital drive that supports following modes of operation and objects

  • Mandatory Cyclic Synchronous Position mode (so-called opmode 8)
  • Optional Cyclic Synchronous Torque mode mode

PDO mappable objects
Device shall provide following objects, object numbers may be different from standard.

  • Control Word - object 0x6040.0
  • Status Word - object 0x6041.0
  • 32-bit Target position - object 0x607a.0
  • 32-bit Position feedback - object 0x6064.0

Optional Digital Inputs and Outputs

PDO mapping and association between these objects and internal data structures of softMC is shown in the example DS402 CAN Drive_Setup.
Corresponding firmware function are listed in CANopen Firmware Functions.

Synchronization

For every bus cycle softMC broadcasts SYNC message to the devices and then sends to every slave a TX PDO that contains control word, target position and optional digital otputs. The motion controller expects all devices to send its TX PDO with the status word and the position feedback before the next SYNC.
A bus cycle is triggered by a hardware timer therefore SYNC messages are sent to the slaves with low jitter that should not exceed 70 usecs.
Devices shall lock their PLLs to the softMC SYNC cycle and tolerate SYNC jitter of up to 100 usecs.

Bus Cycle Example

<Start cycle>
MasterTPDO1
MasterTPDO2
Dummy message
SYNC
..
..
Device1 TDPDO1
Device1 TDPDO2
..
DeviceN TDPDO1
DeviceN TDPDO2
<Start cycle>