This repository provides examples for working with CiA 402-compliant devices from Xeryon over CANopen. The repository includes installation instructions, communication setup, and Python programming examples for motion control.
- 1. Table of Contents
- 2. Wiring
- 3. Software Installation
- 4. Quick Start
- 5. Documentation
- 6. Project Structure
- 7. FAQ & Support
- 8. Disclaimer
⚠️ Safety Warning: Always disconnect power before wiring. Incorrect wiring while powered can damage the device.
Before proceeding, please refer to the wiring diagram for the correct setup. The wiring involves connecting the breakout board, STO, and power supply to the motor and CAN adapter.
We use the Fysetc UCAN USB-to-CAN adapter. However, you are free to use any compatible USB-to-CAN device.
- Power Off - Ensure the breakout PCB is not powered, and the power plug is disconnected.
- Connect FFC to XLA - Attach the FFC cable to the XLA. (Wiring example)
- Connect FFC to Breakout Board - Attach the other end of the FFC cable to the breakout board.
- Connect STO - Connect the STO (Safe Torque Off) pin to the 3.3 V pin on the breakout board.
- Connect CAN Bus - Connect the CAN_H, CAN_L, and GND terminals of the USB-to-CAN adapter to the corresponding pins on the breakout PCB.
- Connect USB - Plug the USB-C cable between the USB-to-CAN adapter and your PC.
- Connect Power Cables - Attach the power cables to the screw terminals.
- Verify Connections - Double-check that all connections are secure and correctly placed.
- Power On - Connect the power plug and switch on the power supply.
Note: No LEDs will be on when the device is powered
- Windows or Linux.
- Python 3.12 or higher must be installed before continuing.
- Visual Studio Code recommended as the code editor.
- Visual Studio Code Python Extension optional, but helpful when working with Python files.
You can install the required dependencies by running the following command.
pip install -r requirements.txtMake sure you are in the examples directory before running the following commands:
cd examplesEnsure your hardware (e.g., USB-to-CAN adapter) is connected and supported by your system:
- For Linux
socketcan: ensure kernel CAN drivers are loaded
To configure the CAN interface and channel for your platform, open settings.py and update the following values:
# Encoder resolution
ENC_RES = EncoderRes.ENC_RES_1MU
# Default Node ID is 32
NODE_ID = 32
# Interface (str): Interface type (e.g., "slcan", "socketcan").
CAN_INTERFACE = "slcan"
# Channel (str): CAN channel (e.g., "COM3", "/dev/ttyACM0", "can0").
CAN_CHANNEL = "COM3"
# Default bitrate is 125Kbps
CAN_BITRATE = CANBitrate.BITRATE_125k
# Filename of the EDS file
EDS_PATH = "../eds/xeryon_xla_5_eds.eds"Ensure you have updated settings.py with your CAN interface details first.
To quickly verify the communication of your setup, run:
python tests/verify_communication.pyTo configure the device and save the parameters, run:
python configuration.pyThis will configure all the configuration settings to the (default) values. An error will occur when there is a communication issue.
You can also run other examples:
python <filename>.pyThese are detailed guides on how to configure, home, and perform motion with the motor:
| Guide Type | Description |
|---|---|
| CANopen documentation | CANopen introduction manual |
| Configuration | How to set parameters and save them |
| Homing | How to execute a homing operation |
| Profile Position mode | How to use profile position mode |
| Daisy Chaining | How to use daisy chaining |
| Wiring example | Wiring example |
| EDS | EDS file information |
| FAQ | Frequently asked questions |
.
├── docs/
│ ├── configuration.md # Guide for configuration
│ ├── daisy_chaining.md # Guide for daisy chaining
│ ├── eds.md # Information about EDS
│ ├── homing.md # Guide for homing
│ ├── mode_profile_position.md # Guide for mode profile position
│ └── wiring.md # Wiring example
│
├── eds/
│ ├── xeryon_xla_5_eds.eds # EDS file
│ └── xeryon_xla_5_eds_docu.txt # Documentation of EDS fields
│
├── examples/ # Code Examples
│ ├── common/
│ │ ├── parameters.py # Hardcoded parameters, values and enums
│ │ └── utils.py # Shared functions
│ │
│ ├── daisy_chaining_configuration/
│ │ ├── change_node_id_all.py # Example to automatically reassign all Node IDs
│ │ └── change_node_id_single.py # Example to change Node ID of specific node
│ │
│ ├── tests/
│ │ └── verify_communication.py # Script to verify the communication of a node
│ │
│ ├── configuration.py # Example script for configuration
│ ├── homing.py # Example script for homing
│ └── mode_profile_position.py # Example script for mode profile position
│
├── FAQ.md # Frequently asked questions
├── README.md # General Guide for running the examples
└── requirements.txt # Dependency file for python setup
Please refer to the FAQ for a complete list of common questions and answers.
If you need further assistance with this software or any Xeryon product, please contact our support team: support@xeryon.com
The software and accompanying documentation are provided "as is" and without warranty of any kind, express or implied, including but not limited to the warranties of merchantability, fitness for a particular purpose, and noninfringement. In no event shall Xeryon be liable for any claim, damages, or other liability, whether in an action of contract, tort, or otherwise, arising from, out of, or in connection with the software or its use.
