Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

issue with Nanotec C5-E-1-09 motion controller #323

Open
ravikiransama opened this issue Sep 27, 2024 · 0 comments
Open

issue with Nanotec C5-E-1-09 motion controller #323

ravikiransama opened this issue Sep 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ravikiransama
Copy link

Describe the bug
I m trying to use Nanotec Controller C5-E-1-09. The controller had id 1, ros2 canopen master id 2. I had used the example of triamic stepper motor control. As soon as I launch the launch file "real_hw_launch.launch.py", it waits at sync_sdo_read_typed: id=1 index=0x606c subindex=0 timed out.

To Reproduce
Need real hardware.

Expected behavior
it should be launched properly.

Logs
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 702 [1] 00
can0 000 [2] 82 00
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 701 [1] 00
can0 601 [8] 40 00 10 00 00 00 00 00
can0 581 [8] 43 00 10 00 92 01 06 00
can0 601 [8] 40 18 10 01 00 00 00 00
can0 581 [8] 43 18 10 01 6C 02 00 00
can0 601 [8] 40 18 10 02 00 00 00 00
can0 080 [0]
can0 581 [8] 43 18 10 02 10 00 00 00
can0 601 [8] 40 18 10 03 00 00 00 00
can0 581 [8] 43 18 10 03 00 00 A5 08
can0 601 [8] 2B 17 10 00 E8 03 00 00
can0 581 [8] 60 17 10 00 00 00 00 00
can0 601 [8] 23 81 60 00 64 00 00 00
can0 581 [8] 60 81 60 00 00 00 00 00
can0 601 [8] 23 83 60 00 F4 01 00 00
can0 581 [8] 60 83 60 00 00 00 00 00
can0 601 [8] 23 84 60 00 F4 01 00 00
can0 581 [8] 60 84 60 00 00 00 00 00
can0 601 [8] 23 85 60 00 88 13 00 00
can0 581 [8] 60 85 60 00 00 00 00 00
can0 601 [8] 2F 98 60 00 17 00 00 00
can0 581 [8] 60 98 60 00 00 00 00 00
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 080 [0]
can0 701 [1] 7F
can0 000 [2] 01 01
can0 701 [1] 05
can0 181 [3] 40 16 03
can0 281 [4] E0 FE FF FF
can0 381 [2] 00 00
can0 481 [4] 00 00 00 00
can0 181 [3] 40 17 03
can0 080 [0]
can0 201 [3] 00 01 00
can0 701 [1] 05
can0 181 [3] 40 16 03
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05
can0 701 [1] 05

Setup:

  • Device: Nanotec C5-E-1-09
  • OS: Ubuntu 2022
  • ROS-Distro: Humble
  • Branch/Commit:

Additional context
Add any other context about the problem here.

bus.yml

options:
dcf_path: "@BUS_CONFIG_PATH@"

master:
node_id: 2
driver: "ros2_canopen::MasterDriver"
package: "canopen_master_driver"
sync_period: 20000

defaults:
dcf: "C5-E-1-09.eds"
driver: "ros2_canopen::Cia402Driver"
package: "canopen_402_driver"
polling: false
heartbeat_producer: 1000 # Heartbeat every 1000 ms
velocity_mode: 1 # Profile velocity Mode
sdo: # SDO executed during config
- {index: 0x6081, sub_index: 0, value: 100} # Set velocity
- {index: 0x6083, sub_index: 0, value: 500} # Set acceleration
- {index: 0x6084, sub_index: 0, value: 500} # Set deceleration
- {index: 0x6085, sub_index: 0, value: 5000} # Set quickstop deceleration
- {index: 0x6098, sub_index: 0, value: 23} # Set default homing mode to 23
- {index: 0x60C2, sub_index: 1, value: 50} # Set interpolation time for cyclic modes to 50 ms
- {index: 0x60C2, sub_index: 2, value: -3} # Set base 10-3s

nodes:
nanotec_c5e109a:
node_id: 1

real_hw_launch.launch.py

Licensed under the Apache License, Version 2.0 (the "License");

you may not use this file except in compliance with the License.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software

distributed under the License is distributed on an "AS IS" BASIS,

WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and

limitations under the License.

import os
import sys

sys.path.insert(0, os.path.join(os.path.dirname(file), "..")) # noqa
sys.path.insert(0, os.path.join(os.path.dirname(file), "..", "..", "launch")) # noqa

import launch
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from ament_index_python import get_package_share_directory
from launch import LaunchDescription

def generate_launch_description():
ld = LaunchDescription()

device_container = IncludeLaunchDescription(
    PythonLaunchDescriptionSource(
        [
            os.path.join(get_package_share_directory("canopen_core"), "launch"),
            "/canopen.launch.py",
        ]
    ),
    launch_arguments={
        "master_config": os.path.join(
            get_package_share_directory("nanotec_c5-e-1-09_can"),
            "config",
            "single_c5e109",
            "master.dcf",
        ),
        "master_bin": os.path.join(
            get_package_share_directory("nanotec_c5-e-1-09_can"),
            "config",
            "single_c5e109",
            "master.bin",
        ),
        "bus_config": os.path.join(
            get_package_share_directory("nanotec_c5-e-1-09_can"),
            "config",
            "single_c5e109",
            "bus.yml",
        ),
        "can_interface_name": "can0",
    }.items(),
)

ld.add_action(device_container)

return ld

cmakelists.txt
cmake_minimum_required(VERSION 3.8)
project(nanotec_c5-e-1-09_can)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

find dependencies

find_package(ament_cmake REQUIRED)
find_package(canopen REQUIRED)
find_package(lely_core_libraries REQUIRED)
find_package(rclcpp REQUIRED)
find_package(std_srvs REQUIRED)
find_package(canopen_interfaces REQUIRED)

generate_dcf(single_c5e109)

cogen_dcf(single_c5e109)

add_executable(position_tick_client src/position_tick_motor.cpp)
ament_target_dependencies(position_tick_client
rclcpp std_srvs canopen_interfaces)

install(TARGETS
position_tick_client
DESTINATION lib/${PROJECT_NAME})

install launch file

install(DIRECTORY
launch/
DESTINATION share/${PROJECT_NAME}
)

if(BUILD_TESTING)
find_package(ament_lint_auto REQUIRED)
endif()

ament_package()

@ravikiransama ravikiransama added the bug Something isn't working label Sep 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant