The information contained in this manual is believed to be accurate and reliable. However, it may contain errors that were not noticed at the time of publication. Users are
expected to perform their own product validation and not rely solely on data contained
in this manual.
2 CANBus Networking Manual V2.0 July 8, 2019
Revision History ......................................................................................... 2
DS402 Implementation on Roboteq Motor Controllers ........................................43
4 CANBus Networking Manual V2.0 July 8, 2019
User Manual Structure and Use
Introduction
Refer to the Datasheet for Hardware-Specific Issues
This manual is the companion to your controller’s datasheet. All information that is specific
to a particular controller model is found in the datasheet. These include:
• Number and types of I/O
• Connectors pin-out
• Wiring diagrams
• Maximum voltage and operating voltage
• Thermal and environmental specifications
• Mechanical drawings and characteristics
• Available storage for scripting
• Battery or/and Motor Amps sensing
• Storage size of user variables to Flash or Battery-backed RAM
User Manual Structure and Use
The user manual discusses issues that are common to all controllers inside a given product family. Except for a few exceptions, the information contained in the manual does not
repeat the data that is provided in the datasheets.
The manual is divided in 3 sections organized as follows:
SECTION 1 CAN Networking on Roboteq Controllers
This section describes the RawCAN and MiniCAN operating modes available on CAN-enabled Roboteq controllers.
SECTION 2 RoboCAN Networking
This section describes the RoboCAN protocol: a simple and efficient meshed network
scheme for Roboteq devices
CANBus Networking Manual 5
Introduction
SECTION 3 CANopen Interface
This section describes the configuration of the CANopen communication protocol and the
commands accepted by the controller operating in the CANopen mode.
SECTION 4 DS402 Implementation on Roboteq Motor Controllers
This section will describe the implementation of CiA DS402 standard on Roboteq motor
controllers.
6 CANBus Networking Manual V2.0 July 8, 2019
Supported CAN Modes
SECTION 1
CAN Networking
on Roboteq
Controllers
Some controller models are equipped with a standard CAN interface allowing up to 127
controllers to work together on a single twisted pair network at speeds up to 1Mbit/s.
Supported CAN Modes
Four CAN operating modes are available on Roboteq controllers:
1 - RawCAN
2 - MiniCAN
3 - CANopen
4 - RoboCAN
RawCAN is a low-level operating mode giving total read and write access to CAN frames.
It is recommended for use in low data rate systems that do not obey to any specific standard. CAN frames are typically built and decoded using the MicroBasic scripting language.
MiniCAN is greatly simplified subset of CANopen, allowing, within limits, the integration
of the controller into an existing CANopen network. This mode requires MicroBasic scripting to prepare and use the CAN data.
CANopen is the full Standard from CAN in Automation (CIA), based on the DS402 specification. It is the mode to use if full compliance with the CANopen standard is a primary requisite.
RoboCAN is a Roboteq proprietary meshed networking scheme allowing multiple Roboteq devices to operate together as a single system. This protocol is extremely simple and
lean, yet practically limitless in its abilities. It is the preferred protocol to use by users who
just wish to make multiple controllers work together with the minimal effort.
This section describes the RawCAN and MiniCAN modes.
Detailed descriptions of CANopen and RoboCAN can be found in specific sections of
this manual.
CANBus Networking Manual 7
CAN Networking on Roboteq Controllers
CANH
CANL
120Ω
Microcomputer
Joysticks, Batteries
HMI’s and other CAN Accessories
Magnetic Guide Sensor
Motor Controllers
PLC
CAN
Adapter
120Ω
Connecting to CAN bus
A CAN bus network is made of a stretch of two wires. A device can be put on a CANbus
network by simply connecting it’s CAN-High and CAN-Low lines to those of other devices
on the network.
Figure 1-1: CAN Network topology
Resistors should be 120 ohm and located at each end of the cable. However, on a short
network communication will take place with a single resistor of 100 to 200 ohm located
anywhere on the network. Communication will not work if no resistor is present, or if its
value is too high.
No ground connection is necessary in between nodes. However, the ground potential of
each node must be within a few volts of each other. If all devices on the network are powered from the same power source, this can be expected to be the case.
CANbus will be operational upon enabling the desired CAN protocol and speed using the
PC utility.
Important Warning
A ground difference up to around 10V is acceptable. A difference of 30V or higher
can cause damage to one or more nodes. CANbus isolators must be used if a similar
ground level cannot be guaranteed between nodes.
8 CANBus Networking Manual V2.0 July 8, 2019
Introduction to CAN Hardware signaling
0
2.5V
1.5V
3.5V
0V
00 0000 00000000011111111 11
1
13
1425
Introduction to CAN Hardware signaling
CANbus uses differential signals, which is where CAN derives its robust noise immunity
and fault tolerance. The two signal lines of the bus, CANH and CANL, are biased to around
2.5 V. A logical “1” (also known as the dominant state) on the bus takes CANH around 1
V higher to around 3.5 V, and takes CANL around 1 V lower to 1.5 V, creating a typical 2V
differential signal as shown in Figure 1-2.
Figure 1-2: CANbus signaling
CAN Bus Pinout
FIGURE 1-3. DB9.Connector pin locations
TABLE 1-1. CAN Signals on DB9 connector
Pin NumberSignalDescription
2CAN_LCAN bus low
7CAN_HCAN bus high
Differential signaling reduces noise coupling and allows for high signaling rates over twisted-pair cable. The High-Speed CANbus specifications (ISO 11898 Standard) are given for
a maximum signaling rate of 1 Mbps with a bus length of 40 m with a maximum of 30
nodes. It also recommends a maximum unterminated stub length of 0.3 m.
Depending on the controller model, the CAN signals are located on the 9-pin, 15-pin or
25-pin DSub connector. Refer to datasheet for details.
69
15
The pins on the DB9 connector are mapped as described in the table below.
CANBus Networking Manual 9
CAN Networking on Roboteq Controllers
18
915
1
13
1425
FIGURE 1-4. DB15 Connector pin locations
The pins on the DB15 connector are mapped as described in the table below.
TABLE 1-2. CAN Signals on DB15 connector
Pin NumberSignalDescription
6CAN_LCAN bus low
7CAN_HCAN bus high
FIGURE 1-5. DB25 pin locations
The pins on the DB25 connector are mapped as described in the table below.
TABLE 1-3. CAN Signals od DB25 connector
Pin NumberSignalDescription
8CAN_LCAN bus low
20CAN_HCAN bus high
CAN and USB Limitations
On some controller models CAN and USB cannot operate at the same time. On controllers equipped with a USB connector, if simultaneous connection is not allowed, the controller will enable CAN if USB is not connected.
The controller will automatically enable USB and disable CAN as soon as the USB is connected to the PC. The CAN connection will then remain disabled until the controller is
restarted with the USB unplugged.
See the controller model datasheet to verify whether simultaneous CAN and USB is supported.
Basic Setup and Troubleshooting
CANbus is very easy to setup: Simply connect the CANH and CANL to a pair of wires with
at least one resistor somewhere along the cable. Enable the desired CAN protocol and
speed using the PC utility.
10 CANBus Networking Manual V2.0 July 8, 2019
Basic Setup and Troubleshooting
If communication cannot be established, it can be difficult to determine the source of the
problem. Here are a few ways to diagnose:
Cable polarity, integrity and termination resistor
Verify that the controller’s CANH and CANL are connected to the CANH and CANL wire.
Check cable continuity to every node. Verify the presence of a least one resistor and that
its value is 120ohm (a value of 60 to 200 ohm would be acceptable)
Check CANbus activity using a voltmeter
The presence of CAN data traffic can be checked using a simple voltmeter and measuring
the voltage between GND and CANH, and between GND and CANL. When CAN is disabled, both lines should have approximately the same voltage around 2.5V. When CAN is
enabled with RoboCAN or MiniCAN protocol selected, the controller will send a continuous stream of data frames. This will cause the CANH voltage to rise above, and the CANL
voltage to drop below, the 2.5V midpoint. If the idle and active voltages do not match the
above, try again on the controller alone disconnected from the network but with a 100 to
200 ohm resistor across its CANH and CANL pins.
The CANOpen and RawCAN protocol should not be used for this test as these do not generate data traffic on their own and will not cause measurable voltage changes.
Check CANbus activity using a CAN sniffer
When working on a CAN system, it is highly recommended to make the acquisition of a
USB to CAN adapter such as the PCAN-USB from Peak Systems. Connect the adapter to
the CANH and CANL and run the sniffer software with the correct bit rate selected. The
figure below shows the expected received data when a Roboteq device is on the network
with MiniCAN protocol enabled.
Figure 1-6. USB to CAN adapter and MiniCAN frame capture
Mode Selection and Configuration
Mode selection is done using the CAN menu in the RoborunPlus PC utility.
CANBus Networking Manual 11
CAN Networking on Roboteq Controllers
Common Configurations
CAN Mode:Used to select one of the 4 operating modes. Off disables all CAN receive
and transmit capabilities.
Node ID: CAN Node ID used for transmission from the controller. Value may be be-
tween 1 and 126 included.
Bit Rate:Selectable bit rate. Available speeds are 1000, 800, 500, 250, and 125 kbit/s.
Default is 125kbit and is the recommended speed for RawCAN and MiniCAN modes.
Heartbeat:Period at which a Heartbeat frame is sent by the controller. The frame is
CANopen compatible 0x700 + NodeID, with one data byte of value 0x05
(Status: Operational). The Heartbeat is sent in any of the selected modes. It
can be disabled by entering a value of 0.
MiniCAN Configurations
ListenNodeID:Filters to accept only packets sent by a specific node.
SendRate: Period at which data frames are sent by the controller. Frames are struc-
tured as standard CANopen Transmit Process Data Objects (TPDOs). Transmission can be disabled by entering a value of 0.
RawCAN Configurations
In the RawCAN mode, incoming frames may be filtered or not by changing the ListenNodeID parameter that is shared with the MiniCAN mode. A value of 0 will capture all
incoming frames and it will be up to the user to use the ones wanted. Any other value will
cause the controller to capture only frames from that sender.
Using RawCAN Mode
In the RawCAN Mode, received unprocessed data packets can be read by the user. Likewise, the user can build a packet with any content and send it on the CAN network. A
FIFO buffer will capture up to 16 frames.
CAN packets are essentially composed by a header and a data payload. The header is an
11 bit number that identifies the sender’s address (bits 0 to 6) and a packet type (bits 7 to
10). Data payload can be 0 to 8 bytes long.
Checking Received Frames
Received frames are first loaded in the 16-frame FIFO buffer. Before a frame can be read,
it is necessary to check if any frames are present in the buffer using the ?CF query. The
query can be sent from the serial/USB port, or from a MicroBasic script using the getvalue(_CF) function. The query will return the number of frames that are currently pending,
and copy the oldest frame into the read buffer, from which it can then be accessed. Sending ?CF again, copies the next frame into the read buffer.
The query usage is as follows:
Syntax: ?CF
Reply: CF=number of frames pending
12 CANBus Networking Manual V2.0 July 8, 2019
Using RawCAN Mode
Reading Raw Received Frames
After a frame has been moved to the read buffer, the header, bytecount and data can be
read with the ?CAN query. The query can be sent from the serial/USB port, or from a MicroBasic script using the getvalue(_CAN, n) function. The query usage is as follows:
When the query is sent from serial or USB, without arguments, the controller replies by
outputting all elements of the frame separated by colons.
Notes: Read the header to detect that a new frame has arrived. If header is dif-
Transmitting Raw Frames
RawCAN Frames can easily be assembled and transmitted using the CAN Send Command !CS. This command can be used to enter the header, bytecount, and data, one
element at a time. The frame is sent immediately after the bytecount is entered, and so it
should be entered last.
Syntax: !CS ee nn
Where: ee = frame element
ferent than 0, then a new frame has arrived and you may read the data.
After reading the header, its value will be 0 if read again, unless a new
frame has arrived.
New CAN frames will not be received by the controller until a ?CAN
query is sent to read the header or any other element.
Once the header is read, proceed to read the other elements of the
received frame without delay to avoid data to be overwritten by a new
arriving frame.
1 = header
2 = bytecount
3 to 10 = data0 to data7
nn = value
Examples: !CS 1 5 Enter 5 in header
!CS 3 2 Enter 2 in Data 0
!CS 4 3 Enter 3 in Data 1
!CS 2 2 Enter 2 in bytecount. Send CAN data frame
CANBus Networking Manual 13
CAN Networking on Roboteq Controllers
Using MiniCAN Mode
MiniCAN is greatly simplified subset of CANopen. It only supports Heartbeat, and fixed
map Received Process Data Objects (RPDOs) and Transmit Process Data Objects (TPDOs). It does not support Service Data Objects (SDOs), Network Management (NMT),
SYNC or other objects.
Transmitting Data
In MiniCAN mode, data to be transmitted is placed in one of the controller’s available Integer or Boolean User Variables. Variables can be written by the user from the serial/USB
using !VAR for Integer Variables, or !B for Boolean Variables. They can also be written from
MicroBasic scripts using the setcommand(_VAR, n) and setcommand(_B, n) functions.
The value of these variables is then sent at a periodic rate inside four standard CANopen
TPDO frames (TPDO1 to TPDO4). Each of the four TPDOs is sent in turn at the time period defined in the SendRate configuration parameter.
Integer Variables are loaded into a frame with the Least Significant Byte first. Example
0x12345678 will appear in a frame as 0x78 0x56 0x34 0x12.
Boolean Variables are loaded in a frame as shown in the table above, with the lowest
Boolean Variable occupying the least significant bit of each byte. Example Boolean Var 1
will appear in byte as 0x01.
Receiving Data
In MiniCAN mode, incoming frames headers are compared to the Listen Node ID number.
If matched, and if the other 4 bits of the header identify the frame as a CANopen standard
RPDO1 to RPDO4, then the data is parsed and stored in Integer or Boolean Variables according to the map below. The received data can then be read from the serial/USB using
the ?VAR or ?B queries, or they can be read from a MicroBasic script using the getvalue(_VAR, n) or getvalue(_B, n) functions.
Integer Variables are loaded from frame with the Least Significant Byte first. Example, a
frame with data as 0x78 0x56 0x34 0x12 will load in an Integer Variable as 0x12345678.
BVar
41-48
BVar
49-56
BVar
57-64
Boolean Variables are loaded from a frame as shown in the table above, with the lowest
Boolean Variable occupying the least significant bit of each byte. Example a received byte
of 0x01 will set Boolean Var 33 and clear Vars 34 to 40.
MiniCAN Usage Example
MiniCAN can only be used with the addition of MicroBasic scripts that will give a meaning to the general variables in which the CAN data are stored. The following simple script
uses VAR1 that is transported in RPDO1 as the incoming motor command and puts the
Motor Amp VAR9 so that it is sent in TPDO1.
Note: This script does not check for loss of communication on the CAN bus. It is provided
for information only.
CANBus Networking Manual 15
CAN Networking on Roboteq Controllers
16 CANBus Networking Manual V2.0 July 8, 2019
RoboCAN Networking
CAN
USB or
RS232
Microcomputer
3rd Party CAN Accessory
Magnetic Guide Sensor
CAN
Adapter
SECTION 2
RoboCAN Networking
RoboCAN is a Roboteq proprietary meshed networking scheme allowing multiple Roboteq
products to operate together as a single system. This protocol is extremely simple and
lean, yet practically limitless in its abilities. It is the preferred protocol to use by a user who
just wishes to make multiple controllers work together with minimal effort.
In RoboCAN, every controller can send commands to, and can read operational data from,
any other node on the network. One or more controller can act as a USB to CAN or Serial
to CAN gateway, allowing several controllers to be thus managed from a single PC or microcomputer.
Using a small set of dedicated Microbasic function, scripts can be written to exchange
data between controllers in order to create automation systems without the need for a
PLC or external computer.
In addition, RoboCAN includes support for processing raw can data as defined in the
RawCAN specification (See page 154), in order to incorporate simple CAN compatible 3rd
party devices in the network.
CANBus Networking Manual 17
RoboCAN Networking
Network Operation
RoboCAN requires only that a controller has a unique node number (other than 0)
assigned and that the RoboCAN mode is selected and enabled. All nodes must be
configured to operate at the same bit rate. Each enabled node will emit a special
heartbeat at a set and unchangeable rate of 128ms so that each node can create and
maintain a map of all nodes alive in the network.
RoboCAN via Serial & USB
Important notice: On many controller models, CAN and USB cannot be operated at the
same time. Please see product datasheet to verify if this is the case on the model used.
In case USB is not available, this section only applies to RS232 connections.
RoboCAN commands and queries can be sent from a USB or serial port using a modified syntax of the normal serial protocol: By simply adding the @ character followed by
the node as a 2 digit hex address, a command or query is sent to the desired node. This
scheme works with every Command (! Character), Query (?), Configuration setting (^),
Configuration read (~), and most Maintenance commands (%)
Runtime Commands
Below is a Command example:
!G 1 500
This is the normal command for giving a 50% power level command to motor 1 of the
controller that is attached to the computer.
@04!G 1 500
This will send the same 50% command to motor 1 of the controller at node address 4.
The reply to a local command is normally a + or - sign when a command is acknowledged
or rejected in normal serial mode.
When a command is sent to a remote node, the reply is also a + or – sign. However, in
addition, the reply can be a * sign to indicate that the destination node does not exist or is
not alive. Note that the + sign only indicates that the command syntax is valid and that the
destination node is alive.
Broadcast Command
Node address 00 is used to broadcast a command simultaneously to all the nodes in the
network. For example
@00!G 1 500
Will apply 50% power to all motor 1 at all nodes, including the local node
18 CANBus Networking Manual V2.0 July 8, 2019
Realtime Queries
Queries are handled the same way but the reply to a query includes the responding
node’s address. Below is a Query example:
?V 2
This is the normal query for reading the battery voltage of the local controller. The controller will reply V=123
@04?V 2
This will send the same query to node address 4
The reply of the remote node is @04 V=123
Replies to remote nodes queries are identical to these to a local controller with the exception of an added latency. Since the reply must be retrieved from the remote node depending on the selected bit rate, the reply may come up to 10ms after the query was sent.
RoboCAN via Serial & USB
Remote Queries restrictions
Remote queries can only return a single value whereas local queries can be used to read
an array of values. For example
?AI
Is a local query that will return the values of all analog capture channels in a single string
as
AI=123:234:345:567
@04?AI
Is a remote query and it will return only the first analog capture channel as
@04 AI=123
Remote queries are not being added in the Query history.
Broadcast remote queries are not supported. For example @00?V 1 will not be executed.
Queries that return strings, such as ?FID or ?TRN are not supported. They will return the
value 0
See the Command Reference section in the manual for the complete list and description
of available queries
CANBus Networking Manual 19
RoboCAN Networking
Configurations Read/Writes
Configuration settings, like Amp Limit or Operating Modes can be read and changed on a
remote node via the CAN bus. For example
@04^ALIM 1 250 will set the current limit of channel 1 of node 4 at 25.0A
@04~OVL will read the Overvoltage limit of node 4.
Note that changing a configuration via CAN only makes that change temporary until the
remote controller is powered down. The %EESAV maintenance command must be send
to the remote node to make the configuration change permanent.
A configuration write can be broadcast to all nodes simultaneously by using the node Id
00. For example
@00^OVL 250
Will set the overvoltage limit of all nodes at 25.0 Volts
Configuration reads cannot be broadcast.
See the Commands Reference section for the complete list and description of available
configurations
Remote Configurations Read restrictions
Remote Configuration Reads can only return a single value whereas local Configuration
Reads can be used to read an array of parameters. For example
~AMOD
Will return the operating mode of all analog capture channels in a single string as
AI=01:01:00:01:02
@04~AMOD
Will return only the mode first analog capture channel as
@04 AI=01
Configuration reads cannot be broadcast.
Remote Maintenance Commands
Maintenance Commands are not supported in RoboCAN.
20 CANBus Networking Manual V2.0 July 8, 2019
RoboCAN via MicroBasic Scripting
Self Addressed Commands and Queries
For sake of consistency commands sent to the local node number are executed the same
way as they would be on a remote node. However the no CAN frame is sent to the network. For example if node 04 receive the command
@04!G 1 500
No data will be sent on the network and it will be interpreted and executed the same way as
!G 1 500
RoboCAN via MicroBasic Scripting
A set of functions have been added to the MicroBasic language in order to easily send
commands to, and read data from any other node on the network. Functions are also
available to read and write configurations at a remote node. Maintenance commands are
not supported.
Sending Commands and Configuration
Sending commands or configuration values is done using the functions
SetCANCommand(id, cc, ch, vv)
SetCANConfig(id, cc, ch, vv).
Where:
id is the remote Node Id in decimal
cc is the Command code, eg _G
ch is the channel number. Put 1 for commands that do not normally require a channel
number
vv is the value
Example:
SetCANCommand(04, _G, 1, 500)
Will apply 50% power to motor 1 of node 4
SetCANConfig(0, _OVL, 1, 250)
CANBus Networking Manual 21
RoboCAN Networking
Will set the overvoltage limit of all nodes to 25.0V. Note that even though the Overvoltage
is set for the controller and does not normally require that a Channel, the value 1 must be
put in order for the instruction to compile.
Script execution is not paused when one of these function is used. The frame is sent on
the CAN network within one millisecond of the function call.
Reading Operating values Configurations
When reading an operating value such as Current Counter or Amps, or a configurations
such as Overvoltage Limit from another node, since the data must be fetched from the
network, and in order to avoid forcing a pausing of the script execution, data is accessed
in the following manner:
1. Send a request to fetch the node data
2. Wait for data to be received
3. Read the data
The wait step can be done using one of the 3 following ways
1. Pause script execution for a few milliseconds using a wait() instruction in line.
2. Perform other functions and read the results a number of loop cycles later
3. Monitor a data ready flag
The following functions are available in microbasic for requesting operating values and
configurations from a remote node.
FetchCANValue(id, cc, ch)
FetchCANConfig(id, cc, ch)
Where:
id is the remote Node Id in decimal
cc is the Command code, eg _G
cc is the channel number. Put 1 for commands that do not normally require a channel number
The following functions can be used to wait for the data to be ready for reading:
IsCANValueReady()
IsCANConfigReady()
These functions return a Boolean true/false value. They take no argument and apply to the
last issued FetchCANValue or FetchCANConfig function
The retrieved value can then be read using the following functions:
ReadCANValue()
ReadCANConfig()
These functions return an integer value. They take no argument and apply to the last issued FetchCANValue or FetchCANConfig function
22 CANBus Networking Manual V2.0 July 8, 2019
Below is a sample script that continuously reads and print the counter value of node 4
Request value to be issued at
every t ms, to buffer location n
[Check if new value arrived]
Read from Scan buffer
Remote node
Local Scan Buffer
top:
FetchCANValue(4, _C, 1) ‘ request data from remote node
while(IsCANValueReady = false) ‘ wait until data is received
end while
Counter = ReadCANValue() ‘ read value
print (Counter, “\r”) ‘ print value followed by new line
goto top ‘ repeat forever
Continuous Scan
In many applications, it is necessary to monitor the value of an operating parameter on a
remote node. A typical example would be reading continuously the value of a counter. In
order to improve efficiency and reduce overhead, a technique is implemented to automatically scan a desired parameter from a given node, and make the value available for reading without the need to send a Fetch command.
A function is provided to initiate the automatic sending of a value from the remote node,
at a specific periodic rate, and to be stored to user selected location in a receive buffer.
RoboCAN via MicroBasic Scripting
The remote node will then send the data continuously without further commands.
A function is then provided to detect the arrival of a new value in that buffer location, and
another to read the value from that location.
Since the scan rate is known, the execution of the script can be timed so that it is not
necessary to check the arrival of a new value.
A scan is initiated with the function:
ScanCANValue(id, cc, ch, tt, bb)
Where:
id is the remote Node Id in decimal
CANBus Networking Manual 23
RoboCAN Networking
cc is the Query code, eg _V
ch is the channel number. Put 1 for queries that do not normally require a channel number
tt is the scan rate in ms
bb is the buffer location
The scan rate can be up to 255ms. Setting a scan rate of 0 stops the automatic sending
from this node.
Unless otherwise specified, the buffer can store up to 32 values.
The arrival of a new value is checked with the function
IsScannedCANReady(aa)
Where
aa is the location in the scan buffer.
The function returns a Boolean true/false value
The new value is then read with the function
ReadScannedCANValue(aa)
Where
aa is the location in the scan buffer.
The function returns an integer value. If no new value was received since the previous
read, the old value will be read.
The following example shows the use of the Scan functions
‘ Initiate scan of counter every 10ms from node 4 and store to
buffer location 0
ScanCANValue(4, _C, 1, 10, 0)
‘ initiate scan of voltage every 100ms from node 4 and store to
buffer location 1
ScanCANValue(5, _V, 1, 100, 1)
top:
wait(10) ‘ Executer loop every 10 ms
‘ check if scanned volts arrived
if(IsScannedCANReady(1))
‘ read and print volts
Volts = ReadScannedCANValue(1)
print (Volts,”\r”)
end if
‘ No need to check if counter is ready since scan rate = loop cycle
Counter = ReadScannedCANValue(0)
print (Counter,”\r”)
goto top ‘ Loop continuously
24 CANBus Networking Manual V2.0 July 8, 2019
RoboCAN via MicroBasic Scripting
Checking the presence of a Node
No error is reported in MicroBasic if an exchange is initiated with a node that does not exist. A command or configuration sent to a non-existent node will simply not be executed.
A query sent to a non existing or dead node will return the value 0. A function is therefore
provided for verifying the presence of a live node. A live node is one that sends the distinct RoboCAN heartbeat frame every 128ms. The function syntax is:
IsCANNodeAlive(id)
Where:
id is the remote Node Id in decimal
The function returns a Boolean true/false value.
Self Addressed Commands and Queries
Functions addressed to the local node have no effect. The following function will not
work if executed on node 4
SetCANCommand(04, _G, 1, 500)
The regular function must be used instead
SetCommand(_G, 1, 500)
Broadcast Command
Node address 00 is used to broadcast a command, or a configuration write simultaneously to all the nodes in the network.
The local node, however, will not be reached by the broadcast command.
Remote MicroBasic Script Download
RoboCAN includes a mechanism for loading MicroBasic scripts into any node in the network. Use the “To Remote” button in the Scripting Tab of the Roborun PC utility. A window will pop-up asking for the destination node Id. Details of the command used to enter
the download mode and transferring scripts is outside the scope of this manual.
CANBus Networking Manual 25
RoboCAN Networking
26 CANBus Networking Manual V2.0 July 8, 2019
Use and benefits of CANopen
Other
SECTION 3
CANopen
Interface
This section describes the configuration of the CANopen communication protocol and the
commands accepted by the controller using the CANopen protocol. It will help you to enable CANopen on your Roboteq controller, configure CAN communication parameters, and
ensure efficient operation in CANopen mode.
The section contains CANopen information specific to Roboteq controllers. Detailed information
on the physical CAN layer and CANopen protocol can be found in the DS402 documentation.
Use and benefits of CANopen
CANopen protocol allows multiple controllers to be connected into an extensible unified
network. Its flexible configuration capabilities offer easy access to exposed device parameters and real-time automatic (cyclic or event-driven) data transfer.
The benefits of CANopen include:
• Standardized in EN50325-4
• Widely supported and vendor independent
• Highly extensible
• Offers flexible structure (can be used in a wide variety of application areas)
• Suitable for decentralized architectures
• Wide support of CANopen monitoring tools and solutions
CAN Connection
ControllerController
CANH
120 Ohm
CANL
CAN Device
120 Ohm
Termination
Resistor
FIGURE 3-1. CAN connection
CANBus Networking Manual 27
CANopen Interface
Connection to a CAN bus is as simple as shown on the diagram above. 120 Ohm Termination Resistors must be inserted at both ends of the bus cable. CAN network can be up to
1000m long. See CAN specifications for maximum length at the various bit rates.
CAN Bus Configuration
To configure communication parameters via the RoborunPlus PC utility, your controller
must be connected to a PC via an RS232/RS485/TCP/USB port
Use the CAN menu in the Configuration tab in order to enable the CANopen mode. Additionally, the utility can be used to configure the following parameters:
• Node ID
• Bit rate
• Heartbeat (ms)
• Autostart
• TPDO Enable and Send rate
Node ID
Every CANopen network device must have a unique Node ID, between 1 and 127. The value of 0 is used for broadcast messaging and cannot be assigned to a network node.
Bit Rate
Heartbeat
Autostart
The CAN bus supports bit rates ranging from 10Kbps to 1Mbps. The default rate used in
the current CANopen implementation is set to 125kbps. Valid bit bates supported by the
controller are:
• 1000K
• 800K
• 500K
• 250K
• 125K
A heartbeat message is sent to the bus in millisecond intervals. Heartbeats are useful for detecting the presence or absence of a node on the network. The default value is set to 1000ms.
When autostart is enabled, the controller automatically enters the Operational Mode of
CANopen. The controller autostart is disabled by default. Disabling the parameter will prevent the controller from starting automatically after the reset occurs. When disabled, the
controller can only be enabled when receiving a CANopen management command.
28 CANBus Networking Manual V2.0 July 8, 2019
Commands Accessible via CANopen
Commands Accessible via CANopen
Practically all of the controller’s real-time queries and real-time commands that can be accessed via Serial/USB communication can also be accessed via CANopen. The meaning,
effect, range, and use of these commands is explained in detail in Commands Reference
section of the manual.
All supported commands are mapped in a table, or Object Dictionary that is compliant
with the CANopen specification. See “Object Dictionary” on page 33 for a complete
set of commands.
CANopen Message Types
The controller operating in the CANopen mode can accept the following types of messages:
• Service Data Objects, or SDO messages to read/write parameter values
• Process Data Objects, or PDO mapped messages to automatically transmit param-
eters and/or accept commands at runtime
• Network Management, or NMT as defined in the CANopen specification
Service Data Object (SDO) Read/Write Messages
Runtime queries and runtime commands can be sent to the controller in real-time using
the expedited SDO messages.
SDO messages provide generic access to Object Dictionary and can be used for obtaining
parameter values on an irregular basis due to the excessive network traffic that is generated with each SDO request and response message.
The list of commands accessible with SDO messages can be found in the “Object Dictionary” on page 33.
Transmit Process Data Object (TPDO) Messages
Transmit PDO (TPDO) messages are one of the two types of PDO messages that are
used during operation.
TPDOs are runtime operating parameters that are sent automatically on a periodic basis
from the controller to one or multiple nodes. TPDOs do not alter object data; they only
read internal controller values and transmit them to the CAN bus.
TPDOs are identified on a CANopen network by the bit pattern in the 11-bit header of the
CAN frame.
4 bits7 bits
}
Object TypeNodeID
TPDO1: 0x180 + Node ID
TPDO2: 0x280 + Node ID
TPDO3: 0x380 + Node ID
TPDO4: 0x480 + Node ID
}
CANBus Networking Manual 29
CANopen Interface
TABLE 3-1. Commands mapped on TPDOs
TPDOObject Index-SubSizeDefault Object Mapped
TPDO10x2106-1S32User VAR 1
TPDO20x2106-3S32User VAR 3
TPDO30x2106-5S32User VAR 5
TPDO40x2106-7S32User VAR 7
S32: signed 32-bit word
CANopen allows up to four TPDOs for any node ID. Unless otherwise specified in the
product datasheet, by default, TPDO1 to TPDO4 are used to transmit up to 8 user variables which may be loaded with any operating parameters using MicroBasic scripting.
Each of the 4 TPDO can be mapped with any mappable SDO query. For more details see
chapter PDO Mapping below.
Each of the 4 TPDOs can be configured to be sent at user-defined periodic intervals. This
is done using the CTPS parameter (See “CTPS - CANOpen TPDO Send Rate” in “Roboteq
Controllers User Manual v2.0”).
0x2106-2User VAR 2
0x2106-4User VAR 4
0x2106-6User VAR 6
0x2106-8User VAR 8
Receive Process Data Object (RPDO) Messages
RPDOs are configured to capture runtime data destined to the controller.
RPDOs are CAN frames identified by their 11-bit header.
4 bits7 bits
}
Object TypeNodeID
RPDO1: 0x200 + Node ID
RPDO2: 0x300 + Node ID
RPDO3: 0x400 + Node ID
RPDO4: 0x500 + Node ID
Roboteq CANopen implementation supports RPDOs. Unless otherwise specified in the
product’s datasheet, by default, data received using RPDOs are stored in 8 user variables
from where they can be processed using MicroBasic scripting. Each of the 4 RPDO can
be mapped with any mappable SDO command. For more details see chapter PDO Mapping below.
TABLE 3-2. Commands mapped on RPDOs
RPDOObject Index-SubSizeDefault Object Mapped
RPDO10x2005-9S32User VAR 9
0x2005-10User VAR 10
RPDO20x2005-11S32User VAR 11
0x2005-12User VAR 12
}
30 CANBus Networking Manual V2.0 July 8, 2019
CANopen Message Types
RPDOObject Index-SubSizeDefault Object Mapped
RPDO30x2005-13S32User VAR 13
0x2005-14User VAR 14
RPDO40x2005-15S32User VAR 15
0x2005-16User VAR 16
S32: signed 32-bit word
PDO Mapping
The Process Data Object (PDO) service allows exchanging one or several process variables in one single CAN message. The PDO mapping parameter describes which objects
in the CANopen object dictionary are transmitted by the sender. The PDO receiver uses
also a PDO mapping parameter, which specifies where to store the received process data
in the CANopen object dictionary. The PDO mapping parameter of the transmitter and
the sender may use different pointers (16-bit index and 8-bit sub-index) depending on the
CANopen profile.
In some simple devices, the user does not have the possibility to configure the PDO
mapping parameters. This is called static PDO mapping, but our controllers provide variable PDO mapping. This means the system designer can re-configure the default PDO
mapping or generate new PDOs. Normally, this is done in the NMT pre-operational state,
when the PDOs are disabled. Of course, the user can also reconfigure the PDO mapping
in the NMT operational state, but then it is necessary to avoid inconsistencies in the PDO
mapping on the producer and the consumer side. To avoid this, the PDO must not be produced until the entire reconfiguration is finished.
The CiA 301 application layer specification requires a dedicated re-mapping procedure:
1. “Destroy” the PDO by setting the valid bit to 1b of sub-index 01h of the PDO communication parameter.
2. Disable PDO mapping by setting the sub-index 00h of the PDO mapping parameter to
00h.
3. Modify PDO mapping by changing the values of the corresponding sub-indices of the
PDO mapping parameters.
4. Enable PDO mapping by setting the sub-index 00h to the number mapped process
data.
5. “Create” a PDO by setting the valid bit to 0b of sub-index 01h of the PDO communication parameter.
If the controller detects that the index and subindex of the mapped object does not exist
or the object cannot be mapped during step 3, the controller responds with the SDO abort
transfer service (abort code: 06020000h or 06040041h). If the controller detects that the
RPDO mapping is not valid or not possible during step 4, the controller responds with the
SDO abort transfer service (abort code: 06020000h or 06040042h).
In the following example, we will show how to remap TPDO1 (0x1800) to transfer the following:
• 0x2100
• 0x2100
• 0x210D
• 0x210F
: Motor amps for channel 1 (U16).
01
: Motor amps for channel 2 (U16).
02
: Internal voltage (U16).
01
: MCU temperature (U8).
01
CANBus Networking Manual 31
CANopen Interface
In this example, we suppose that the controller has node-id 01.
1. Destroy TPDO1 by setting the invalid bit of COB-ID (0x180001):
23 00 18 01 81 01 00 C0
2. Disable TPDO1 mapping by setting number of entries mapping parameter to 00
(0x1A0000).
2F 00 1A 00 00 00 00 00
3. Modify TPDO1 mapping by changing (0x1A00
• 0x210001: Motor amps for channel 1 (U16).
23 00 1A 01 10 01 00 21
• 0x2100
23 00 1A 02 10 02 00 21
• 0x210D
23 00 1A 03 10 01 0D 21
• 0x210F
23 00 1A 04 08 01 0F 21
4. Enable TPDO1 mapping by setting number of entries mapping parameter to 04
((0x1A0000).
2F 00 1A 00 04 00 00 00
5. Create TPDO1 by setting the invalid bit of COB-ID to 0 (0x180001).
23 00 18 01 81 01 00 40
PDO Transmission Type
The transmission type of a PDO can be set via the second sub-index.
: Motor amps for channel 2 (U16).
02
: Internal voltage (U16).
01
: MCU temperature (U8).
01
01-0 2
):
(1)
0
The Transmit PDO is synchronous. Which specific SYNC Object
occurrence triggers the transmission is given in the device profile.
1 – 240The Transmit PDO is synchronous. It is transmitted after every nth
SYNC Object within the Synchronous Window Length, where n is the
transmission type. For example, when using transmission type 34, the
PDO is transmitted after every 34th SYNC Object.
241 – 25
252
1(1
(1)
)Reserved.
The data for the PDO is updated on reception of a SYNC Object, but
the PDO is not transmitted. The PDO is only transmitted on reception
of a Remote Transmission Request.
(1)
253
The data for the PDO is updated and the PDO is transmitted on
reception of a Remote Transmission Request.
(2)
254
The conditions that cause the Transmit PDO to be transmitted are
manufacturer specific.
255The Transmit PDO is asynchronous. The transmission is triggered at
defined send rate.
32 CANBus Networking Manual V2.0 July 8, 2019
Object Dictionary
(1)
Not supported in Roboteq controllers.
(2)
In Roboteq controllers, it behaves exactly like value 255.
First it is necessary to distinguish between synchronous and asynchronous PDOs:
Asynchronous PDOs are event-controlled and represent the normal transmission type of
PDOs. For this, the values 255 or 254 are to be entered as PDO type.
Synchronous PDOs are only transmitted after prior reception of a synchronization message (Sync Object). PDO transmission is thus carried out synchronously in the entire network, more or less at the same time. But what is much more important is that all device
inputs must be sampled on the arrival of the sync object, so that a uniform snapshot of
the process results. With the next sync-message, the recorded data are then sent in the
synchronous PDOs. Therefore, there is a delay here corresponding to the cycle time of
the Sync message, as the consumers receive the process variables at the time of the previous Sync message. In output direction the synchronous PDOs received by a node only
become valid on arrival of the next Sync message.
In order that the bus is not blocked up by a large number of synchronous PDOs, which
are all sent with every Sync message, the values 1-240 of the cyclic synchronous PDO
type are used as dividers for the transmission interval. Accordingly, [18xxsub02] = 4
means that the synchronous PDO is only sent with every fourth Sync message.
Object Dictionary
The CANopen dictionary shown in this section is subject to change. The CANopen EDS
file can be downloaded from the roboteq web site.
The Object Dictionary given in the table below contains the runtime queries and runtime
commands that can be accessed with SDO/PDO messages during controller operation.
Communication Profile
IndexSub (hex)Entry NameTypeAccessPDOCommand
0x100000Device TypeU32RONo
0x10 0100Error RegisterU8RONo
0x100800Manufacturer Device NameSTRCONSTNo
0x100900Manufacturer Hardware VersionSTRCONSTNo
0x100A 00Manufacturer Software VersionSTRCONSTNo
0x100C 00Guard TimeU16RWNo
0x100D 00Life Time FactorU8RWNo
0x101601-04Consumer Heartbeat TimeU32RWNo
0x101700Producer Heartbeat TimeU16RWNo
0x101801Identity Object – Vendor IDU32CONSTNo
CANBus Networking Manual 33
CANopen Interface
Runtime Commands
IndexSub (hex)Entry NameTypeAccessPDOCommand
0x200001-mm
0x200101-mm
0x200201-mm
0x200301-ee
0x200401-mm
0x200501-vv
0x200601-mm
0x200701-mm
0x200800Set All Digital Out bitsU8WOYesDS
0x200900Set Individual Digital Out bitsU8WOYesD1
0x200A00Reset Individual Digital Out bitsU8WOYesD0
0x200B01-ee
0x200C00Emergency ShutdownU8WOYesEX
0x200D00Release ShutdownU8WOYesMG
0x200E00Stop in all modesU8WOYesMS
0x200F01-mm
0x201001-mm
0x201101-mm
0x201201-mm
0x201301-mm
0x201401-mm
0x201501-bb
0x201601-rr
0x201700Save Config to FlashU8WOYesEES
0x201800Run MicroBasic ScriptU8WOYesR
0x201F01-si
(1) mm: Maximum number of motors.
(2) ee: Maximum number of encoders.
(3) vv: Maximum number of integer variables.
(4) bb: Maximum number of boolean variables.
(5) rr: Maximum number of RC pulse output.
(6) si: Maximum number of SSI encoders.
(1) mm: Maximum number of motors.
(2) ee: Maximum number of encoders.
(3) vv: Maximum number of integer variables.
(4) bb: Maximum number of boolean variables.
(5) tt: Maximum number of internal temperature sensors.
(6) kk: Maximum number of spectrum radio.
(7) ma: Maximum number of MEMS accelerometers.
(8) mg: Maximum number of magnetic sensors.
(9) ii: Maximum number of AC induction motors.
(10) si: Maximum number of SSI sensors.
(11) di: Maximum number of digital inputs.
(12) pi: Maximum number of pulse inputs.
(13) fs: Maximum number of flow sensors.
02Velocity Acceleration Delta Time CH3U 16RWYe sSDC
0x706000Modes of Operation CH3S8RWYe sROM
0x706100Modes of Operation Display CH3S8RONoAOM
0x706400Position Actual Value CH3S32ROYe sF
0x706C00Velocity Actual Value CH3S32ROYe sF
0x707100Target Torque CH3S16RWYe sTC
0x707700Torque Actual Value CH3S16ROYe sTRQ
0x707A00Target Position CH3S32RWYe sPOS
0x708100Profile Velocity CH3U32RWYe sPSP
0x708300Profile Acceleration CH3U32RWYe sPAC
0x708400Profile Deceleration CH3U32RWYe sPDC
0x708700Torque Slope CH3U32RWYe sTSL
0x70FF00Target Profile Velocity CH3U32RWYe sS
0x750200Supported Drive Modes CH3U32CONST NoSDM
0x77FE00Version Number CH3U32CONST NoVNM
38 CANBus Networking Manual V2.0 July 8, 2019
SDO Construction Details
SDO Construction Details
CANOpen SDO frames can easily be created manually and used to send commands
and queries to a Roboteq device. The directives below are a simplified description of the
CANOpen SDO mechanism. For more details please advise the CANOpen standard.
A CANOpen command/query towards a Roboteq device can be analyzed as shown below:
Payload
Byte0
HeaderDLC
0x600+nd8cssnxxindexsubindexdata
• nd is the destination node id.
• ccs is the Client Command Specifier, if 2 it is command if 4 it is query.
• n is the Number of bytes in the data part, which do not contain data
• xx not necessary for basic operation. For more details advise CANOpen standard.
• index is the object dictionary index of the data to be accessed
• subindex is the subindex of the object dictionary variable
• data contains the data to be uploaded.
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
The Response from the roboteq device is as shown below:
Payload
Byte0
HeaderDLC
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
0x580+nd8cssnxxindexsubindexData
• nd is the source node id.
• ccs is the Client Command Specifier, if 4 it is query response, 6 it is a successful
response to command, 8 is an error in message received.
• n is the Number of bytes in the data part, which do not contain data
• xx not necessary for the simplistic way. For more details advise CANOpen standard.
• index is the object dictionary index of the data to be accessed.
• subindex is the subindex of the object dictionary variable
• data contains the data to be uploaded. Applicable only if css=4.
SDO Example 1: Set Encoder Counter 2 (C) of node 1 value 10
• nd = 1, since the destination’s node id is 1.
• ccs = 2, since it is a command.
• n = 0 since all 4 bytes of the data are used (signed32).
• index = 0x2003 and subindex = 0x02 according to object dictionary.
CANBus Networking Manual 39
CANopen Interface
Payload
Byte0
HeaderDLC
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
0x600+182000x20030x020x0A
601h820 03 20020A 00 00 00
The respective response will be:
Payload
Byte0
HeaderDLC
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
0x580+186000x20030x020x00
581h860 03 200200 00 00 00
SDO Example 2: Activate emergency shutdown (EX) for node 12
• nd = 12, since the destination’s node id is 12.
• ccs = 2, since it is a command.
• n = 3 since only one byte of the data is used (unsigned8).
• index = 0x200C and subindex = 0x00 according to object dictionary.
Payload
Byte0
HeaderDLC
0x600+1282300x200C0x000x01
601Ch82C0C 200001 00 00 00
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
The respective response will be:
Payload
Byte0
HeaderDLC
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
0x580+186000x200C0x000x00
58Ch8600C 200000 00 00 00
SDO Example 3: Read Battery Volts (V) of node 1.
• nd = 1, since the destination’s node id is 1.
• ccs = 4, since it is a query.
• n = 2 since 2 bytes of the data are used (unsigned16).
• index = 0x210D and subindex = 0x02 according to object dictionary.
40 CANBus Networking Manual V2.0 July 8, 2019
SDO Construction Details
Payload
Byte0
HeaderDLC
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
0x600+184200x210D0x020x00
601h8480D 21020A 00 00 00
The respective response will be:
• nd = 1, since the source node id is 1.
• ccs = 4, since it is a query response.
• n = 2 since 2 bytes of the data are used (unsigned16).
• index = 0x210D and subindex = 0x02 according to object dictionary.
• data = 0x190 = 400 = 40 Volts.
Payload
Byte0
HeaderDLC
Byte1-2Byte 3Bytes4-7bits 4-7bits2-3bits0-1
0x580+1842xx0x210D0x020x190
581h848 0D 210290 01 00 00
CANBus Networking Manual 41
CANopen Interface
42 CANBus Networking Manual V2.0 July 8, 2019
Abbreviations
SECTION 4
Abbreviations
CConstant
CiACAN in Automation
FSAFinite State Automation
PDSPower Drive System
PPProfile Position Mode
PVProfile Velocity Mode
RORead Only
RWRead Write
SDOService Data Object
TQTorque Mode
VLVelocity Mode
DS402 Implementation
on Roboteq Motor
Controllers
Introduction
This documentation will describe the implementation of CiA DS402 standard on Roboteq
motor controllers.
What is DS402
DS402 is an open standard, that is designed specifically for motion control. There are a
number of CANOpen SDOs with which one can control the motor by commanding the
motor controller.
CANBus Networking Manual 43
CAN Networking on Roboteq Controllers
The standard describes all the required SDOs, as long as the actions the motor controller
should take upon receiving these SDOs. Additionally the standard describes a Finite State
Machine (FSA) which should run on motor controller.
Implementation
The implementation has been directed under standard version 4.1.0.
Index Range & Channel Selection
All the SDOs described in DS402 standard range from index 0x600 - 0x67FF. However
these are only for controlling one motor channel. For multi channel controllers the controller should be able to accept index ranges for the other channels as well. These index ranges are shifted ranges of the abovementioned one as shown below:
• 0x6000 - 0x67FF, for channel 1.
• 0x6800 - 0x6FFF, for channel 2.
• 0x7000 - 0x77FF, for channel 3.
There are Roboteq motor controllers with up to three channels available.
Modes of Operation
Roboteq Controllers support the following operation Modes:
A. Open Loop
B. Closed Loop Speed, controls Speed using Speed as feedback.
C. Closed Loop Speed Position, controls Speed using Position as feedback.
D. Closed Loop Count Position, controls Position.
E. Closed Loop Position Relative, controls Position within specific boundaries.
F. Closed Loop Position Tracking, controls Position within specific boundaries, with
abrupt transition.
In order to conform the above operation modes to the operation modes described, the
DS402 modes of operation supported by Roboteq are shown in Table 4-1 - Operation Table 1.
Any other mode described in DS402 standard is not supported by Roboteq controllers.
TABLE 4-1. Operation Modes
ValueDefinitionRoboteq Operation Mode
-4¹Velocity ModeClosed Loop Speed Position
1
-3
1
-2
1
-1
0No ModeOpen Loop Mode
1Profile Position ModeClosed Loop Count Position Mode
2Velocity ModeClosed Loop Speed Mode
3Profile Velocity ModeClosed Loop Speed Mode
4Torque Profile ModeClosed Loop torque Mode
¹Roboteq Specific Modes
2
Not all Profile Position features can be supported with this mode.
Profile Velocity ModeClosed Loop Speed Position
Profile Position ModeClosed Loop Position Tracking Mode²
Profile Position ModeClosed Loop Position Relative Mode
2
44 CANBus Networking Manual V2.0 July 8, 2019
Supported SDOs
Table 4-2 shows the SDOs described in DS402 standard and supported by Roboteq Motor
Controllers.
TABLE 4-2. Supported SDO
ObjectDescription
6040
6041
6042
6043
6044
6046
6048
6049
6060
6061
6064
606C
6071
6077
607A
6081
6083
6084
6087
60FF
6502
67FE
Control WordCW
00
Status WordSW
00
Target velocity (vl)S
00
vl velocity demandRMP
00
vl velocity actual valueF
00
vl velocity min max amountSPL
XX
vl velocity accelerationSAC
XX
vl velocity decelerationSDC
XX
Modes of OperationROM
00
Modes of Operation DisplayAOM
00
Position actual valueF
00
Velocity actual valueF
00
Target torqueTC
00
Torque actual valueA
00
Target positionPOS
00
Profile velocityPSP
00
Profile accelerationPAC
00
Profile decelerationPDC
00
Torque slopeTSL
00
Target velocity (pv)S
00
Supported Drive ModesSDM
00
Version NumberVNM
00
Implementation
Roboteq
Command
Profile
PositionVelocity
Profile
Velocity
Torque
Profile
PDS FSA
The standard requires the implementation of a specific finite state machine called FSA.
The FSA is designed not only to react to CANOpen commands (Controlword and Statusword), but also to local commands (in this case the use of CW command and SW
query). For backward compatibility reasons, the FSA is not active by default. It can be activated by using a special configuration command (^FSA 1, see Figure 4-1).
CANBus Networking Manual 45
CAN Networking on Roboteq Controllers
FIGURE 4-1. FSA Configuration
Figure 4-2 describes The states and the transitions of the finite state machine, while Table
4-3 describes the actions and the events of the transitions.
FIGURE 4-2. Power Drive System Finite State Automation
TABLE 4-3. Transition Events and Actions
Transition Event(s)Action(s)
Automatic Transition after power on or reset
0
1Automatic transitionNone
2Shutdown CommandNone
46 CANBus Networking Manual V2.0 July 8, 2019
application (if ^FSA 1), or when ^FSA is set
from 0 to 1.
None
SDO Description
Transition Event(s)Action(s)
3Switch On CommandNone
4Enable Operation Command
5Disable Operation CommandThe drive function shall be disabled
6Shutdown CommandNone
7Quick Stop or Disable Voltage CommandNone
8Shutdown CommandThe drive function shall be disabled
9Disable Voltage CommandThe drive function shall be disabled
10Quick Stop or Disable Voltage CommandNone
11Quick Stop CommandQuick Stop process is initiated
12
13Fault SignalNone
14Automatic TransitionThe drive function shall be disabled
15Fault Reset CommandThe drive function shall be enabled
Automatic transition when the quick stop function is completed
The drive function shall be enabled and all
internal set-points cleared.
The drive function shall be disabled
SDO Description
0x6040 - Control Word
TABLE 4-4. Control Word
Sub-Index00OptionalNTypeU16AccessRWPDOR
Value RangeDiscreteDefaultOperation specific
RoboCommandCW
DescriptionThe received command in order to control the PDS FSA.
Table 4-4 gives a short description of the object, Table 4-5 the mapping of the respective
variable and Table 4-6 the usage of the bits that are independent to operation mode.
TABLE 4-5. Control Word Mapping
151110987643210
RROMSHFROMSEOQSEVSO
MSBLSB
R Reserved, OMS Operation mode specific, H Halt, FR Fault reset,
EO Enable operation QS Quick stop, EV Enable voltage, and SO Switch on
CANBus Networking Manual 47
CAN Networking on Roboteq Controllers
TABLE 4-6. Command Coding
Bits of the Control Word
Command
Shutdown0X1112,6,8
Switch On001113
Switch On + Enable Operation011113+4
Disable Voltage0XX0X7,9,10,12
Quick Stop0X01X7,10,11
Disable Operation001115
Enable Operation011114,16
Fault Reset0->1XXXX15
Bits 9, 6, 5, and 4 of the ControlWord are operation mode specific. The halt function (bit
8) behavior is operation mode specific. If the bit is 1, the commanded motion shall be
interrupted, After releasing the halt function, the commanded motion shall be continued if
possible, see Table 4-7.
TABLE 4-7. Halt bit (bit 8)
TransitionBit 7Bit 3Bit 2Bit 1Bit 0
Bit ValueDefinition
8
Profile Position Mode
TABLE 4-8. control word mapping in profile position mode
15109876 5430
see
Table 4-4
MSBLSB
In Profile Position Mode the operation specific bits are mapped in Table 4-8. With bits 4, 5
and 9, user can define when the command for next Position (0x607A - POS) will be processed. Bit 6 defines whether the command is absolute or relative to the current position.
Table 4-9. Definition of bits 4,5,6 and 9 in profile position Mode
Bit 9Bit 5Bit 4Definition
000->1
X10->1Next positioning shall be started immediately
100->1
Bit ValueDefinition
6
0Positioning shall be executed or continued
Axis shall be stopped. Slow down on quick stop ramp (EDEC) and
1
stay in operation enabled
Change on
set-point
0Target position shall be an absolute value
1
Halt
Target position shall be a relative value. Positioning moves shall be
performed relative to the preceding (internal absolute) target position
see
Table 4-4
Positioning shall be completed (target reached) before the
next one gets started.
Positioning with the current profile velocity up to the current
set-point shall be proceeded and then next positioning shall
be applied
Abs/
rel
Change Set
Immediately
New Set
Point
see Table 4
48 CANBus Networking Manual V2.0 July 8, 2019
Velocity Mode
SDO Description
TABLE 4-10. control word mapping in Velocity Mode
159876 5430
see Table 4Halt
MSBLSB
In Velocity Mode the operation specific bits are mapped on Table 4-10. With bits 4, 5 and
6, user can configure the available ramp related options as shown in Table 4-11.
TABLE 4-11. Definition of bits 4,5 and 6 in Velocity Mode
Bit ValueDefinition
Motor shall be halted. Slow down on quick stop ramp (EDEC) and
0
4
5
6
stay in operation enabled
1Velocity demand value shall accord with ramp output value
0Ramp output value shall be locked to current output value
1Ramp output value shall follow ramp input value
0Ramp input value shall be set to zero
1Ramp input value shall accord with ramp reference
see
Table 4
Reference
Ramp
Unlock
Ramp
Enable
Ramp
see Table 4
0x6041 - Status Word
Table 4-12 gives a short description of the object, Table 4-13 the mapping of the respective
variable and Table 4-14 the usage of the bits that are independent to operation mode.
TABLE 4-12. Status Word
Sub-Index00Optional NTypeU16AccessROPDOT
Value RangeDiscreteDefault-
RoboCommandSW
DescriptionThe status of the PDS FSA.
TABLE 4-13. Status Word Mapping
1514 131211109876543210
NUOMSILATRRM MSWSODQS VE F OE SO RTSO
MSBLSB
NU Not Used, OMS Operation mode specific, ILA Internal limit active
TR Target reached, RM Remote, W Warning, SOD Switch on disabled,
QS Quick stop, VE Voltage enabled, F Fault, OE Operation Enabled,
SO Switch on RTSO Ready to switch on.
If bit 4 (voltage enabled) of the status word is always 1. If bit 5 (quick stop) of the status
word is 0, this shall indicate that the PDS is reacting on a quick stop request (quick stop
mode is always 2). Bit 7 (warning) is always 0. Bit 9 (remote) of the status word is always 1. If bit 10 (target reached) of the status word is 1, this shall indicate that the PDS
has reachedthe set-point. Bit 10 shall also be set to 1, if the operation mode has been
changed. The change of a target value by software shall alterthis bit. If halt occurred
and the PDS has halted then bit 10 shall be set to 1, too. If the same internal value is
CANBus Networking Manual 49
CAN Networking on Roboteq Controllers
commanded then bit 10 shall not alter, if bit 10 is supported(see Table 4-15). If bit 11 (internal limit active) of the statusword is 1, this shall indicate that an current limit has been
reached.
TABLE 4-14. State Coding
Status WordPDS FSA state
xxxx xxxx x0xx 0000
xxxx xxxx x1xx 0000
xxxx xxxx x01x 0001
xxxx xxxx x01x 0011
xxxx xxxx x01x 0111
xxxx xxxx x00x 0111
xxxx xxxx x0xx 1111
xxxx xxxx x0xx 1000
b
b
b
b
b
b
b
b
TABLE 4-15. Definition of bit 10
Bit ValueDefinition
Halt (bit 8 in controlword) = 0: Speed or Position Target not reached
0
10
Halt (bit 8 in controlword) = 1: Axis decelerates
Halt (bit 8 in controlword) = 0: Speed or Position Target reached
1
Halt (bit 8 in controlword) = 1: Velocity of axis is 0
Not ready to switch on
Switch on disabled
Ready to switch on
Switched on
Operation enabled
Quick stop active
Fault reaction active
Fault
Profile Position Mode
TABLE 4-16. Status word mapping in profile position mode
151413121110 90
see Table 12Not Used
MSBLSB
In Profile Position Mode the operation specific bits are mapped in Table 4-16. With bits 10
and 12 user can acknowledge the status of the controller as shown in Table 4-15 and Table
4-17. Bit 13 is always 0.
TABLE 4-17. Definition of bit 12 in Profile Position Mode
Bit ValueDefinition
12
Profile Velocity Mode
TABLE 4-18. Status Word Mapping in Profile Velocity Mode
15141312111090
see Table 12
MSBLSB
Set-Point
Acknowledge
see Table 12
Target
Reached
see Table 12
0Previous set-point already processed, waiting for new set-point
Previous set-point still in process, set-point overwriting shall be
1
accepted
Not
Used
Speedsee Table 12
Target
Reached
see Table 12
50 CANBus Networking Manual V2.0 July 8, 2019
SDO Description
In Profile Velocity Mode the operation specific bits are mapped in Table 4-18. With bits 10
and 12 user can acknowledge the status of the controller as shown in Table 4-15 and Table
4-19. Bit 13 is always 0.
TABLE 4-19. Definition of bit 12 in Profile Velocity Mode
Bit ValueDefinition
12
0Speed is not equal 0
1Speed is equal 0
0x6042 - VL Target Velocity
Table 20 gives a short description of the object.
TABLE 4-20. Target Velocity
Sub-Index00OptionalNTypeS16AccessRWPDOR
Value RangeDefault0
RoboCommandS
DescriptionThis object shall indicate the required velocity of the system in RPM.
Positive values shall indicate forward direction and negative values
shall indicate reverse direction.
0x6043 - VL Velocity Demand
Table 21 gives a short description of the object.
TABLE 4-21. Velocity Demand
Sub-Index00OptionalNType S16AccessROPDOT
Value RangeDefault
RoboCommand RMP
DescriptionThis object shall provide the instantaneous velocity in RPM generated
by the ramp function. It is an internal object of the drive device. Positive values shall indicate forward direction and negative values shall
indicate reverse direction.
0x6044 - VL Velocity Actual Value
Table 4-22 gives a short description of the object.
TABLE 4-22. Velocity Actual Value
Sub-Index00Optional NTypeS16 AccessROPDOT
Value RangeDefault
RoboCommandRMP
DescriptionThis object shall provide the velocity in RPM at the motor spindle
or load. Depending on the implementation (simple drive device,
without sensor, with sensor, etc.), the drive shall provide the appropriate image of the actual velocity derived for example from
velocity demand or a sensor signal.
CANBus Networking Manual 51
CAN Networking on Roboteq Controllers
0x6046 - VL Velocity Min Max Amount
Table 4-23 gives a short description of the object.
TABLE 4-23. Velocity Min Max Amount
Sub-Index01Optional N Type U32AccessRWPDOR
Value RangeDefault0
RoboCommandSPL
DescriptionVL velocity min amount.
Sub-Index02Optional N Type U32AccessRWPDOR
Value RangeDefault1000
RoboCommandSPL
DescriptionVL velocity max amount.
Figure 4-3. Velocity Min Max Amount
This object shall indicate the configured minimum and maximum amount of velocity in
RPM. The vl velocity max amount sub-object shall be mapped internally to the vl velocity
max positive and vl velocity max negative values. The vl velocity min amount sub-object
shall be mapped internally to the vl velocity min positive and vl velocity min negative values. as shown Figure 4-3.
0x6048 - VL Velocity Acceleration
Table 4-24 gives a short description of the object.
TABLE 4-24. Velocity Acceleration
Sub-Index01OptionalNType U32AccessRWPDOR
Value RangeDefaultMAC(20000)
RoboCommandSAC
DescriptionDelta speed in RPM*10.
Sub-Index02Optional NType U16AccessRWPDOR
Value RangeDefault1
RoboCommandSAC
DescriptionDelta time in seconds.
52 CANBus Networking Manual V2.0 July 8, 2019
SDO Description
0x6049 - VL Velocity Deceleration
Table 4-25 gives a short description of the object.
TABLE 4-25. Velocity Deceleration
Sub-Index01OptionalNType U32 Access RWPDOR
Value RangeDefault MDEC(20000)
RoboCommandSDC
DescriptionDelta speed in RPM*10.
Sub-Index02OptionalNType U16Access RWPDOR
Value RangeDefault 1
RoboCommandSDC
DescriptionDelta time in seconds.
0x6060 - Modes of Operation
Table 4-22 gives a short description of the object and Table 1shows the available modes.
TABLE 4-26. Modes of Operation
Sub-Index00OptionalCNDTypeS8AccessRWPDOR
Value RangeDefaultMMOD(0)
RoboCommandROM
DescriptionThe requested operation mode.
0x6061 - Modes of Operation Display
Table 4-27 gives a short description of the object and Table 1 shows the available modes.
TABLE 4-27. Modes of Operation Display
Sub-Index00 Optional CND Type S8 AccessROPDO
Value RangeDefaultMMOD(0)
RoboCommandAOM
DescriptionThe actual operation mode.
0x6064 - Position Actual Value (PP)
Table 4-28 gives a short description of the object.
TABLE 4-28. Position Actual Value
Sub-Index00OptionalCNDType S32AccessROPDOT
Value RangeDefault
RoboCommandF
DescriptionThis object shall provide the actual value of the position measure-
ment device.
The position unit are in sensor counts in Closed Loop Count Position mode. In Closed
Loop Position Relative mode and in Closed Loop Tracking Position mode the position unit
is in range -1000 to 1000 scaled by the minimum and maximum sensor value.
CANBus Networking Manual 53
CAN Networking on Roboteq Controllers
0x606C - Velocity Actual Value (PV)
Table 4-29 gives a short description of the object.
TABLE 4-29. Velocity Actual Value
Sub-Index00Optional CNDType S32 AccessROPDOT
Value RangeDefault
RoboCommandF
DescriptionThis object shall provide the actual velocity value, in RPM, derived
either from the velocity sensor or the position sensor.
0x6071 - Target Torque (TQ)
Table 4-30 gives a short description of the object.
TABLE 4-30. Target Torque
Sub-Index00OptionalCNDType S 16 AccessRWPDOR
Value RangeDefault0
RoboCommand TC
DescriptionThis object shall indicate the configured input value, in Nm*100, for
the torque controller in profile torque mode.
0x6077 - Torque Actual Value (TQ)
Table 4-31 gives a short description of the object.
TABLE 4-31. Torque Actual Value
Sub-Index00OptionalCNDType S16AccessROPDOT
Value RangeDefault
RoboCommandTRQ
DescriptionThis object shall provide the actual value of the torque, in Nm*100. It
shall correspond to the instantaneous torque in the motor.
0x607A - Target Position (PP)
Table 4-32 gives a short description of the object.
TABLE 4-32. Target Position
Sub-Index00 Optional CNDTypeS32 AccessRWPDOR
Value RangeDefault0
RoboCommandPOS
DescriptionThe commanded position that the drive should move to in position
profile mode using the current settings of motion control parameters
such as velocity, acceleration, deceleration, motion profile type etc.
The value of this object shall be interpreted as absolute or relative depending on the abs/rel flag in the ControlWord.
The position unit are in sensor counts in Closed Loop Count Position mode. In Closed
Loop Position Relative mode and in Closed Loop Tracking Position mode the position unit
is in range -1000 to 1000 scaled by the minimum and maximum sensor value.
54 CANBus Networking Manual V2.0 July 8, 2019
SDO Description
0x6081 - Profile Velocity (PP)
Table 4-33 gives a short description of the object.
TABLE 4-33. Profile Velocity
Sub-Index00Optional CNDType U32 Access RWPDOR
Value RangeDefault MVEL(1000)
RoboCommand PSP
DescriptionThis object shall indicate the configured velocity, in RPM, normally
attained at the end of the acceleration ramp during a profiled motion
and shall be valid for both directions of motion.
0x6083 - Profile Acceleration (PP)
Table 4-34 gives a short description of the object.
TABLE 4-34. Profile Acceleration
Sub-Index00OptionalCNDTypeU32 AccessRWPDOR
Value RangeDefaultMAC(20000)
RoboCommand PAC
DescriptionThis object shall indicate the configured acceleration, in (RPM*10)/
second.
0x6084 - Profile Deceleration (PP)
Table 4-35 gives a short description of the object.
TABLE 4-35. Profile Deceleration
Sub-Index00Optional YType U32 AccessRWPDOR
Value RangeDefaultMDEC(20000)
RoboCommandPAC
DescriptionThis object shall indicate the configured deceleration, in (RPM*10)/
second.
0x6087 - Torque Slope (TQ)
Table 4-36 gives a short description of the object.
TABLE 4-36. Profile Deceleration
Sub-Index00OptionalCNDType U32Access RW PDOR
Value RangeDefault MAC(20000)*
RoboCommandTSL
DescriptionThis object shall indicate the configured rate of change of torque,
in (miliNm*10)/second.
*As long as the Torque Constant (TNM) is 1000 miliNm/A.
CANBus Networking Manual 55
CAN Networking on Roboteq Controllers
0x60FF - Target Velocity (PV)
Table 4-37 gives a short description of the object.
TABLE 4-37. Target Velocity
Sub-Index00OptionalCNDType U32 AccessRW PDOR
Value RangeDefault0
RoboCommandS
DescriptionThis object shall indicate the configured target velocity, in RPM, and
shall be used as input for the trajectory generator.
0x6502 - Supported Drive Modes
Table 4-38 gives a short description of the object.
TABLE 4-38. Supported Drive Modes
Sub-Index00OptionalREQTypeU32AccessCPDON
Value RangeDefault0x0000000F
RoboCommandSDM
DescriptionThe supported drive modes.
Roboteq Controllers support:
•Profile Position Mode (PP).
•Velocity Mode (VL).
•Profile Velocity Mode (PV).
•Torque Mode (TQ).
0x67FE - Version Number
Table 4-39 gives a short description of the object.
TABLE 4-39. Version Number
Sub-Index00Optional REQType U32AccessCPDON
Value RangeDefault0x00040100
RoboCommand VNM
DescriptionThis object shall provide the version number of the CiA 402 profile,
References
.CiA® 402 Draft Standard Proposal, v4.1.0, https://www.can-cia.org/can-knowledge/
1
canopen/cia402/
which is implemented in the device.
56 CANBus Networking Manual V2.0 July 8, 2019
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.