Advertisement

Quick Links

MAB ROBOTICS
MD80 x CANdle User Manual
rev 2.0 - 05.09.2022
www.mabrobotics.pl
contact@mabrobotics.pl

Advertisement

Table of Contents
loading

Summary of Contents for Mab Robotics MD80 x CANdle

  • Page 1 MAB ROBOTICS MD80 x CANdle User Manual rev 2.0 - 05.09.2022 www.mabrobotics.pl contact@mabrobotics.pl...
  • Page 2: Table Of Contents

    TABLE OF CONTENTS Ecosystem overview MD80 CANdle and CANdle HAT Safety information Operating conditions (MD80 and CANdle) Hardware setup Quick startup guide MD80 General parameters Connectors pinout Control modes Controller tuning Safety limits FDCAN Watchdog Measurements Calibration CANdle and CANdle HAT Principle of operation USB bus SPI bus...
  • Page 3: Ecosystem Overview

    1. Ecosystem overview MD80 x CANdle is a system of brushless actuator controllers (MD80) and translator devices (CANdle) used for interfacing with them. MD80-based actuators can be used in advanced robotic projects like quadrupedal robots, robotic manipulators, exoskeletons, gimbals, and many more.
  • Page 4: Safety Information

    1.3. Safety information The instructions set out below must be read carefully before the initial commissioning or installation to raise awareness of potential risks and hazards, and to prevent injury to personnel and/or property damage. To ensure safety when operating this servo drive, it is mandatory to follow the procedures included in this manual.
  • Page 5: Operating Conditions (Md80 And Candle)

    1.4. Operating conditions (MD80 and CANdle) Ambient Temperature (Operating) 0°C - 40°C Ambient Temperature (non-operating) 0°C - 60°C Maximum Humidity (Operating) up to 95%, non-condensing at 40 ºC Maximum Humidity (Non-Operating) up to 95%, non-condensing at 60 ºC Altitude (Operating) -400 m to 2000 m 1.5.
  • Page 6: Quick Startup Guide

    1.6. Before first use Here are some things to look out for while playing with the MD80 x CANdle ecosystem for the first time: Always stay cautious when dealing with actuators. Even though they don't seem like it, they may severely hurt you when unintentional movement occurs.
  • Page 7: Connectors Pinout

    Control modes TL;DR: MD80 x CANdle - motion modes To control the motor sha with the userʼs command MD80 is equipped with multiple control loops. All controllers are based on a regular PID controller design with an anti-windup block. The saturator (anti-windup) is an additional module that acts as a limiter to the ʻIʼ...
  • Page 8 Velocity PID Velocity PID controller calculates velocity error based on target velocity (set by user) and estimated velocity read from the encoder. Its output is a torque command for the internal current/torque controller. The parameters of the controller are: Velocity Target (in [rad/s]) ●...
  • Page 9 For Position PID Position Target (in [rad]) ● kP (proportional gain) ● kI (integral gain) ● kD (derivative gain) ● I windup (maximal output of an integral part in [rad/s]) ● Max output (in [rad/s]) ● For Velocity PID: Velocity Target (in [rad/s]) ●...
  • Page 10: Controller Tuning

    compensate for any high-frequency oscillations (vibrations) that may occur, as the Impedance controller works at 40kHz (much faster than <100 Hz). Raw torque controller - when kP and kD are set to zero, the torque_ff command is equal to the ●...
  • Page 11: Safety Limits

    Position PID Position PID is the mode used when high positioning accuracy is required. Usually, no compliance is assumed in this mode, so the actuator will try to hold the read position as close to the commanded value as possible. One must be aware that position mode is actually made out of two PID controllers - the inner loop which is the velocity PID discussed earlier and the position PID working on top of the velocity loop.
  • Page 12 Letʼs start with the max current limit. This setting limits the maximum current (and thus torque) the motor can output. It is the last user-configurable limit in the control scheme. The maximum current is set using the mdtool config command, and by default, it is usually set to 10A. This setting can be saved in the non-volatile current memory so that it is always loaded on the actuator power-up.
  • Page 13: Fdcan Watchdog

    These parameters allow restricting the output of high-level controllers - the position PID, velocity PID, and impedance PD controllers. These limits are applied before the max current limit, so even when set high they will not lead to a hazardous situation until the max current is fixed at a safe level. The max velocity limit is respected only in position PID mode, whereas the max torque limit is respected in all motion modes.
  • Page 14: Calibration

    The velocity is estimated by measuring position change in time, at a frequency of 40kHz. The measurements are then filtered using a low-pass filter with a cut-off frequency of 5 kHz since the position differentiation method introduces noise. Torque Actuator torque is estimated by measuring motor phase currents. This method can be used on low gear ratio actuators (preferably below 9:1), that are easily back drivable, to get an estimate of the torque applied by the motor.
  • Page 15: Principle Of Operation

    The first one is a simple version that uses only the USB bus to communicate with the host, whereas the latter can communicate using USB, SPI, and UART bus, and is easy to integrate with SBCs such as Raspberry PI. The communication with MD80 controllers is performed using FDCAN bus.
  • Page 16 Generally, a program using CANdle should follow the workflow below: Creating a Candle object creates a class that will hold all the data and provides an API for the user. During the creation of the class, the so ware will attach itself to the ttyACMx port used by the CANdle, or SPI/UART bus if CANdle HAT is considered.
  • Page 17: Usb Bus

    When the control code finishes, the Candle::end() method should be called. This will ensure a ʻclean exitʼ meaning a properly closed communication on both USB and FDCAN side. Candle::begin() can be called later to resume communication if needed. 3.2. USB bus The USB bus is the most common one, used in both CANdle and CANdle HAT.
  • Page 18 To enable access to CANdle from userspace, the user should be added to dialout group by calling: sudo usermod -a -G dialout <user> # where <user> is current username If this is not possible, devices access level can be granted by: sudo chmod 777 /dev/ttyACMx # where x is CANdle port number, usually 0 If this is also not possible, programs that use CANdle (including examples), can be launched with sudo.
  • Page 19: Latency

    a er that open the cmdline.txt sudo nano /boot/cmdline.txt and remove the part: console=serial0,115200 and reboot: sudo reboot 3.6. Latency The latency was measured in a real scenario to get the most accurate results. A special flag was embedded into the MD80 command which the MD80 should return in the next response it sends. This way the whole route from the host, through CANdle, MD80 and back was profiled in terms of the delay.
  • Page 20: So Ware Pack

    4. So ware Pack The MD80 x CANdle so ware pack consists of a few modules. All of them are based on the main CANdle C++ library which takes care of the low-level communication and provides API for high-level so ware.
  • Page 21 The quick startup guide includes cloning the repo, building and running the examples. First, you should clone the candle repo from the MAB Robotics GitHub page to your local machine. Then, make sure you're in the main directory candle/ and run the following commands:...
  • Page 22 or delete the build directory contents and call cmake .. again (the default library type is shared). This is what the cmake output looks like when reconfiguring for shared lib: CANdle Python library CANdle Python library is a translated version of the C++ library using pybind11. The package can be found on PyPi: https://pypi.org/project/pyCandleMAB/ and installed using pip:...
  • Page 23: Mdtool

    4.2. MDtool MDtool is a console application for configuring and performing basic diagnostics on MD80 drives via CANdle. The application is available as a standalone executable and as a .deb package. The program is designed as a complementary tool for APIs, reducing the overhead when setting up the drives for the first time or reconfiguring them.
  • Page 24 Note: this setting has to be saved to be preserved a er power down! Please see the config save <ID> command. mdtool config save command <ID> For the config commands to take action a er the next power cycle a save command has to be executed. This command saves the current driveʼs settings to the non-volatile FLASH memory.
  • Page 25: Candle Ros/Ros2 Nodes

    CANdle ROS/ROS2 nodes TL;DR: MD80 x CANdle - ROS/ROS2 startup guide While C++ API is the most flexible way of inter facing with CANdle/MD80, ROS/ROS2 APIs are also available. These have been designed as standalone C++ nodes that use the CANdle library on the backend. The nodes are designed to be used with already configured drives, thus functions such as setting FDCAN parameters are unavailable via ROS/2 API.
  • Page 26 for more information on how to run the node you can call: rosrun candle_ros candle_ros_node --help Example output from the terminal a er launching the node: In this example, we will be working with USB bus and 8M FDCAN baudrate. Adding drives Firstly, the node should be informed which drives should be present on the FDCAN bus.
  • Page 27 rosservice call /zero_md80s "{drive_ids:[200, 800]}" Enabling/Disabling drives Using services /enable_md80s /disable_md80s the drives and the node publishers and subscribers can be enabled/disabled. Note: A er calling /enable_md80s service, no calls to services other than /disable_md80s should be done. A er enabling, the node will publish current joint states to /joint_states at a frequency dependent on a currently chosen communication bus and speed mode.
  • Page 28 First letʼs run the node with arguments that fit your MD80 x CANdle setup. The general syntax is: ros2 run candle_ros2 candle_ros2_node <BUS> <FDCAN baud>...
  • Page 29 Set mode Next desired control mode should selected. This accomplished with /candle_ros2_node/set_mode_md80s service. For example: ros2 service call /candle_ros2_node/set_mode_md80s candle_ros2/srv/SetModeMd80s "{drive_ids: [200, 800], mode:["IMPEDANCE", "IMPEDANCE"]}" Should produce: response: candle_ros2.srv.SetModeMd80s_Response(drives_success=[True, True]) Informing that for both drives mode has been set correctly. Set Zero O en when starting, setting a current position to zero is desired.
  • Page 30 Example set up of custom gains for POSITION PID mode: ros2 topic pub /md80/position_pid_command candle_ros2/msg/PositionPidCommand "{drive_ids: [150, 350], position_pid: [{kp: 40.0, ki: 0.5, kd: 0.0, i_windup: 10, max_output: 3.0},{kp: 20.0, ki: 0.5, kd: 0.0, i_windup: 10, max_output: 3.0}], velocity_pid: [{kp: 0.2, ki: 0.3, kd: 0.0, i_windup: 2.0, max_output: 2.0}, {kp: 0.1, ki: 0.1, kd: 0.0, i_windup: 1, max_output: 2.0}]}"...
  • Page 31: Md80 Update Tool - Mab Can Flasher

    4.4. MD80 update tool - MAB CAN Flasher MAB_CAN_Flasher is a console application used to update the MD80 controller so ware using CANdle. When an update is released our engineers will prepare a MAB_CAN_Flasher application and send it to you. The MD80 firmware is contained in the MAB_CAN_Flasher application itself, thus it can upload only one firmware version for one motor type.
  • Page 32: Candle Update Tool - Mab Usb Flasher

    and while the command is running connect the power supply. This command will wait for the bootloader response and try to recover the firmware. If the flashing does not occur in the first power cycle you can repeat it until the bootloader is detected. The example output of the wait option for the ak80-64 motor is shown below: 4.5.
  • Page 33: Common Issues And Faq

    5. Common Issues and FAQ 5.1. How to check if my motor is operating properly First thing to check is the mdtool setup diagnostic command output. If there are no errors (meaning the error field shows 0x00, or it shows only the CAN watchdog error) the drive did not detect any issues by itself. The other thing is to make sure that the actuator runs smoothly - such that there is no excessive cogging torque when rotating (you can check it using mdtool test...
  • Page 34: Different Fdcan Speeds Between Actuators

    Different FDCAN speeds between actuators MD80 x CANdle ecosystem is not adopted for working with actuators of different FDCAN baudrates. Trying to control actuators with different baud rates on a common FDCAN bus can cause the communication to fail or not start at all.
  • Page 35 Revision history Revision Release date Changes v1.0 December 2021 Preliminary release v2.0 September 2022 CANdle HAT release + so ware pack update www.mabrobotics.pl contact@mabrobotics.pl...

Table of Contents