MyActuator X シリーズモーターの入門
この文書は AI によって翻訳されています。内容に不正確な点や改善すべき点がございましたら、文書下部のコメント欄または以下の Issue ページにてご報告ください。
https://github.com/Seeed-Studio/wiki-documents/issues
この記事では、MyActuator シリーズモーターの使い方と、Python および ROS を使用して reComputer Mini Jetson Orin で操作する方法を紹介します。

仕様
以下は、すべてのモーターモデルのパラメータを記載した完全な表です:
パラメータ | X2-7 | X4-10 | X4-36 | X8-120 | X12-320 | X15-450 |
---|---|---|---|---|---|---|
ギア比 | 28.17 | 12.6 | 36 | 19.61 | 20 | 20.25 |
入力電圧 (V) | 24 | 24 | 24 | 48 | 48 | 72 |
無負荷速度 (RPM) | 178 | 317 | 111 | 158 | 125 | 108 |
無負荷入力電流 (A) | 1 | 1 | 0.9 | 1.6 | 2.7 | 3.5 |
定格速度 (RPM) | 142 | 238 | 83 | 127 | 100 | 98 |
定格トルク (N.m) | 2.5 | 4 | 10.5 | 43 | 85 | 145 |
定格出力 (W) | 37 | 100 | 100 | 574 | 900 | 1480 |
定格相電流 A(rms) | 3 | 7.8 | 6.1 | 17.6 | 30 | 25 |
ピークトルク (N.m) | 7 | 10 | 34 | 120 | 320 | 450 |
ピーク相電流 A(rms) | 8.1 | 19.5 | 21.5 | 43.8 | 100 | 69.2 |
効率 (%) | 63 | 69.5 | 63.1 | 79 | 75 | 82.4 |
モーターバックEMF定数 (Vdc/Krpm) | 4.3 | 6 | 6 | 19.2 | 17.9 | 29.9 |
モジュールトルク定数 (N.m/A) | 0.8 | 0.8 | 1.9 | 2.4 | 3.3 | 5.8 |
モーター相抵抗 (Ω) | 0.61 | 0.32 | 0.35 | 0.18 | 0.12 | 0.08 |
モーター相インダクタンス (mH) | 0.13 | 0.14 | 0.17 | 0.31 | 0.05 | 0.14 |
ポールペア | 13 | 13 | 13 | 10 | 20 | 20 |
3相接続 | Y | |||||
バックドライブトルク (N.m) | 0.4 | 0.8 | 1.14 | 3.21 | 3.8 | 4 |
バックラッシュ (Arcmin) | 12 | 10 | 10 | 10 | 10 | 10 |
出力ベアリングタイプ | 深溝玉軸受 | 交差ローラーベアリング | ||||
軸方向耐荷重 (KN) | 0.25 | 1.2 | 1.3 | 4 | 4.5 | 5.4 |
軸方向応力 (KN) | 0.25 | 1.2 | 1.3 | 1 | 4.5 | 5.4 |
ラジアル荷重 (KN) | 1 | 1.2 | 1.5 | 4.5 | 5 | 6 |
慣性 (Kg.cm²) | 0.17 | 0.25 | 0.3 | 1.5 | 12.9 | 31.6 |
エンコーダタイプ & インターフェース | デュアルエンコーダ ABS-17BIT (入力) / 17-18BIT (出力) | |||||
制御精度 (度) | <0.01 | |||||
通信 | CAN BUS / EtherCAT | |||||
重量 (Kg) | 0.26 | 0.33 | 0.36 | 1.40 | 2.37 | 3.50 |
絶縁等級 | F |
RMD-X V4シリーズの命名規則
- RMD: ブランド名 R-Reducer(減速機) M-Motor(モーター) D-Drive(ドライブ)
- X2: Xはシリーズ名を表し、統合型遊星アクチュエータを意味します。2はモーターモデル番号を表します(例:X2、X4、X6、X8など)。
- P28: 遊星ギア比を表します(例:P12、P28、P32など)。
- 7: ピークトルク7N.m
- E: 通信方式 E: CAN BUS & EtherCAT
主な特徴
- CAN BUS & EtherCAT
- 交差ローラーベアリング
- デュアルエンコーダ
- 高トルク密度
- 高精度
- 中空設計
使用開始
使用前の環境準備
PCのWindowsシステム
対応する製品マニュアルをダウンロードしてください。
MYACTUATOR_Setup Software_V4.0.zipをダウンロードしてください。
MYACTUATOR_Setup Software_V4.0.zip
を解凍し、以下をインストールしてください:Required Runtime Environment\ZLGUSBCAN_Driver
ディレクトリ内のUSBCAN_AllInOne_x86_x64_2.0.0.1.exe
Required Microsoft Runtime Libraries
ディレクトリ内のMSVBCRT.AIO.2019.10.19.X86 X64.exe
回路の接続
ここではX4-36モーターを選択し、そのインターフェース図を以下に示します。

ポート定義 | ポート説明 |
---|---|
① VCC | 電源正極 |
② GND | 電源負極 |
③ CAN_H | CAN_Hネットワーク信号端子 |
④ CAN_L | CAN_Lネットワーク信号端子 |
⑤ EtherCAT_IN | EtherCAT入力端子 |
⑥ EtherCAT_OUT | EtherCAT出力端子 |
⑦ T+ | マスターがモジュールに制御コマンドを送信 |
⑧ T- | モジュールがマスターにステータスフィードバックを送信 |
⑨ R+ | マスターがモジュールのステータスデータを反映 |
⑩ R- | モジュールがマスターの制御コマンドを反映 |
ここではCAN通信方式を使用します。この場合、Windows上の上位コンピュータでデバッグするために追加のUSB-CANインターフェースが必要です。

ここで、モーター用に別途24V電源を提供し、USBをコンピュータに接続する必要があります。
MYACTUATOR Setup Software 250206.exe
を使用してモーターをテストする
ID設定と接続 | モーター情報の読み取り | モーターのキャリブレーション | モーターのキャリブレーション | モーター回転テストの実行 |
---|---|---|---|---|
![]() | ![]() | ![]() | ![]() | ![]() |
デフォルトのモーターIDは1です。IDを1として入力し、「Connect」をクリックします。 | 接続後、「Read」をクリックしてモーターの現在の情報を取得します。 | 初回使用時は「Calibrate Motor」をクリックしてキャリブレーションを実行します。 | キャリブレーション後、「Read」と「Save」をクリックします。 | モーターの動作セクションで異なるモーター制御モードをテストできます。 |
詳細な機能については、MYACTUATOR_Setup Software_V4.0.zipファイルに含まれるSetup Software Instruction Manual - V3.0.pdfを参照してください。
モーターを reComputer Mini Jetson Orin を使用して制御する
現在、市場で最も一般的なモーター用のCAN通信インターフェースは、XT30 (2+2) および JSTコネクタを使用しています。私たちの reComputer Mini Jetson Orin デバイスは、デュアルXT30 (2+2)ポートとJSTベースのCANインターフェースを備えており、シームレスな互換性を提供します。

CANの使用に関する詳細は、このwikiを参照してください。
CANインターフェースを有効化する
ステップ1: CAN0およびCAN1を使用する前に、底面カバーを取り外し、両方の120Ω終端抵抗をONの位置に設定してください。

ステップ2: モーターをXT30 (2+2)インターフェースを介して直接reComputer MiniのCAN0に接続します。

この電源供給は単一モーターの学習およびテスト専用です。複数のモーターを使用する場合は、別途電源ボードを設計し、Jetsonの電源供給をモーターの電源供給から分離して、高電流が直接Jetsonを通過するのを防いでください。
Jetson CAN通信を有効化する
ターミナルを開き、以下のコマンドを入力してGPIOピンをハイに設定し、CAN0を有効化します:
gpioset --mode=wait 0 43=0
JSTインターフェースCAN1を使用する場合は、ピン106をハイに設定します。
gpioset --mode=wait 0 106=0
このターミナルを開いたままにして、新しいターミナルを起動し、CAN0を設定します。
sudo modprobe mttcan
sudo ip link set can0 type can bitrate 1000000
sudo ip link set can0 up
PythonおよびC++環境を構築する
ステップ1: SDKをGitクローンします。
git clone https://github.com/ZhuYaoHui1998/myactuator_rmd.git
ステップ2: このドライバSDKには以下の依存関係が必要です。Debian Linuxでは、以下のコマンドでaptを使用してインストールできます:
sudo apt-get install -y build-essential cmake
sudo apt install linux-modules-extra-5.15.0-1025-nvidia-tegra # Jetson Jetpack 6.0用
Pythonバインディングを使用する場合は、追加でPython 3、pip、およびpybind11をインストールする必要があります:
sudo apt-get install -y python3 python3-pip python3-pybind11 python3-setuptools
依存関係をインストールした後、以下の手順に従ってC++ライブラリまたはPythonパッケージとしてドライバSDKをインストールします。どちらの場合もCMakeを使用してC++コードをコンパイルします。
C++ライブラリのビルド
C++ドライバSDKをビルドするには、このフォルダ内で新しいターミナルを開き、以下のコマンドを実行します。古いLinuxバージョンでは、エラーメッセージ error: 'const struct can_frame' has no member named 'len'
が表示される場合があり、その場合はissue 5で議論されているコード修正を適用する必要があります。
cd ~/myactuator_rmd
mkdir build
cd build
cmake .. -D PYTHON_BINDINGS=on
make -j $(nproc)
sudo make install
フラグ PYTHON_BINDINGS
(デフォルトはoff)は、C++ライブラリに加えてPythonバインディングをビルドします。C++ライブラリのみを使用する場合は、このフラグをオフのままにしても問題ありません。この方法でPythonバインディングをビルドすると、共有ライブラリとしてコンパイルされますが、インストールはされません。そのため、ライブラリを手動でインストールするか、ビルドフォルダ内でローカルにインポートする必要があります。
パッケージをアンインストールする場合は、以下のコマンドを使用します:
xargs rm < install_manifest.txt
Pythonライブラリのビルド
このSDKのPythonバインディングをビルドしてインストールするには、メインフォルダ内で新しいターミナルを開き、以下のコマンドを実行します:
cd ~/myactuator_rmd
pip3 install .
これにより、setup.py
がCMakeを呼び出し、バインディングをC++ライブラリとしてインストールします。再度削除する場合は、以下のコマンドを実行します:
pip3 uninstall myactuator-rmd-py
C++を使用した制御
- プロジェクトディレクトリ構造を作成する
コードのsrcディレクトリ内にプロジェクトディレクトリを作成します。例えば、myactuator_example
という名前を付け、そのサブディレクトリ内にsrcフォルダを作成します。
cd ~/myactuator_rmd
mkdir -p ~/myactuator_rmd/src/myactuator_example/src
cd ~/myactuator_rmd/src/myactuator_example
- CMakeLists.txtを作成する
~/myactuator_rmd/src/myactuator_example/CMakeLists.txt
ファイルに以下の内容を書き込みます:
touch CMakeLists.txt
cmake_minimum_required(VERSION 3.20)
project(myactuator_example)
# myactuator_rmdライブラリを探す
find_package(myactuator_rmd REQUIRED)
# 実行可能ファイルを作成
add_executable(myactuator_node
src/main.cpp
)
# C++17標準を使用
target_compile_features(myactuator_node PUBLIC
cxx_std_17
)
# myactuator_rmdライブラリをリンク
target_link_libraries(myactuator_node PUBLIC
myactuator_rmd::myactuator_rmd
)
- main.cppを書く
~/myactuator_rmd/src/myactuator_example/src/main.cpp
ファイルに以下のコードを書き込みます:
touch src/main.cpp
#include <cstdlib>
#include <iostream>
#include <myactuator_rmd/myactuator_rmd.hpp>
int main() {
myactuator_rmd::CanDriver driver {"can0"};
myactuator_rmd::ActuatorInterface actuator {driver, 1};
std::cout << actuator.getVersionDate() << std::endl;
std::cout << actuator.sendPositionAbsoluteSetpoint(180.0, 500.0) << std::endl;
actuator.shutdownMotor();
return EXIT_SUCCESS;
}
- プロジェクトをビルドする
cd ~/myactuator_rmd/src/myactuator_example
mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make
- プログラムを実行する
sudo ./myactuator_node

前提条件
- CANインターフェース
can0
が正しく設定されていること(モーターとCANバスが正しく接続されていることを確認してください)。 myactuator_rmd
ライブラリが正しくインストールされていること(インストールされていない場合は、最初にインストールしてください)。
C++ の実装詳細については、myactuator_rmd.hpp
のすべての内容を参照してください。ここでは、Python の使用方法について詳しく紹介します。
Python を使用した制御
~/myactuator_rmd/src/myactuator_example
ディレクトリ内に scripts という名前のフォルダを作成し、Python スクリプトを保存します。
cd ~/myactuator_rmd/src/myactuator_example
mkdir scripts
バージョン番号の取得
scripts ディレクトリ内に test.py
という名前のカスタム Python スクリプトを作成し、以下のコードを記述します。
import myactuator_rmd_py as rmd
import time
# CAN ドライバとアクチュエータインターフェースの初期化
driver = rmd.CanDriver("can0") # can0 を使用
actuator = rmd.ActuatorInterface(driver, 1) # CAN ID を 1 に設定
# バージョン番号の取得
print("バージョン番号:", actuator.getVersionDate())

ライブラリをロードし、特定のネットワークインターフェース(ここでは can0)とドライブ(ここでは 1、CAN アドレス 0x140 + 1 = 0x141 に対応)を作成します。
モーターのステータスを取得
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# モーターのステータス 1
status1 = actuator.getMotorStatus1()
print(f"""
モーターのステータス 1:
温度: {status1.temperature}°C
ブレーキステータス: {'解除済み' if status1.is_brake_released else 'ロック中'}
電圧: {status1.voltage}V
エラーコード: {status1.error_code}
""")
# モーターのステータス 2
status2 = actuator.getMotorStatus2()
print(f"""
モーターのステータス 2:
温度: {status2.temperature}°C
電流: {status2.current}A
シャフト速度: {status2.shaft_speed} RPM
シャフト角度: {status2.shaft_angle}°
""")
# モーターのステータス 3
status3 = actuator.getMotorStatus3()
print(f"""
モーターのステータス 3:
温度: {status3.temperature}°C
フェーズ A 電流: {status3.current_phase_a}A
フェーズ B 電流: {status3.current_phase_b}A
フェーズ C 電流: {status3.current_phase_c}A
""")
## トルク計算
import myactuator_rmd_py as rmd
from myactuator_rmd_py.actuator_constants import X4_24 # モーターのモデルに応じてインポート
def get_normalized_torque(actuator):
"""電流から正規化されたトルクを計算"""
# 電流値を取得
status = actuator.getMotorStatus2()
current = status.current
# 正規化されたトルクを計算(電流/定格値)
torque_ratio = current / X4_24.rated_current
actual_torque = torque_ratio * X4_24.rated_torque
return actual_torque
# 使用例
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
try:
while True:
torque = get_normalized_torque(actuator)
print(f"現在のトルク: {torque:.3f} Nm (定格: {X4_24.rated_torque} Nm)", end='\r')
time.sleep(0.1)
except KeyboardInterrupt:
actuator.shutdownMotor()

制御モード
- 現在の制御モードを取得
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
mode = actuator.getControlMode()
print(f"現在の制御モード: {mode}")

- 絶対位置制御
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# 180 度の位置に 100 deg/s で移動
actuator.sendPositionAbsoluteSetpoint(180.0, 300.0)
time.sleep(5) # モーターが目標位置に到達するまで待機
# 現在の位置を取得
angle = actuator.getMultiTurnAngle()
print(f"現在の位置: {angle}°")
time.sleep(5)
mode = actuator.getControlMode()
print(f"現在の制御モード: {mode}")
actuator.shutdownMotor()

モーターが 180 度の位置に回転する様子が確認できます。
- 相対位置制御
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# 現在の位置からさらに 90 度移動
current_angle = actuator.getMultiTurnAngle()
target_angle = current_angle + 90.0
actuator.sendPositionAbsoluteSetpoint(target_angle, 50.0)
time.sleep(3)
angle = actuator.getMultiTurnAngle()
print(f"現在の位置: {angle}°")
mode = actuator.getControlMode()
print(f"現在の制御モード: {mode}")
actuator.shutdownMotor()

モーターが反時計回りに 90 度回転する様子が確認できます。
- 速度制御
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# 500 RPM で連続回転
actuator.sendVelocitySetpoint(500.0)
time.sleep(15)
# モーターを停止
actuator.stopMotor()
# 現在の位置を取得
angle = actuator.getMultiTurnAngle()
print(f"現在の位置: {angle}°")
mode = actuator.getControlMode()
print(f"現在の制御モード: {mode}")

- トルク制御
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# 0.5A の電流(トルク)を適用
actuator.sendCurrentSetpoint(0.5)
time.sleep(2)
# トルク出力を停止
actuator.stopMotor()
# 現在の位置を取得
angle = actuator.getMultiTurnAngle()
print(f"現在の位置: {angle}°")
mode = actuator.getControlMode()
print(f"現在の制御モード: {mode}")

- 閉ループモーション制御
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
# 初期化
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# フィードバック付き位置制御
feedback = actuator.sendPositionAbsoluteSetpoint(180.0, 100.0)
time.sleep(5)
print(feedback)
# フィードバック付き速度制御
feedback = actuator.sendVelocitySetpoint(20.0)
time.sleep(5)
print(feedback)
# フィードバック付きトルク制御
torque_constant = 0.32 # モーターのモデルに応じて設定
feedback = actuator.sendTorqueSetpoint(1.5, torque_constant)
time.sleep(5)
print(feedback)
actuator.stopMotor()

モーターブレーキ制御
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# ブレーキをかける
actuator.lockBrake()
print("ブレーキがかかりました")
# ブレーキを解除する
actuator.releaseBrake()
print("ブレーキが解除されました")
モーターパワー制御
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# モーターの電源をオフにする
actuator.shutdownMotor()
print("モーターの電源がオフになりました")
エンコーダー機能
- マルチターンエンコーダー位置を取得
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
encoder_pos = actuator.getMultiTurnEncoderPosition()
print(f"マルチターンエンコーダー位置: {encoder_pos}")
- 現在の位置をゼロ点として設定(再起動が必要)
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
actuator.setCurrentPositionAsEncoderZero()
print("現在の位置がエンコーダーのゼロ点として設定されました")
- カスタムゼロ点を設定(再起動が必要)
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
# 現在の位置をゼロ点として取得
current_pos = actuator.getMultiTurnEncoderOriginalPosition()
print(f"生のエンコーダー位置: {current_pos}")
# ゼロオフセットを設定
actuator.setEncoderZero(current_pos)
print(f"エンコーダーのゼロ点が設定されました: {current_pos}")
# 設定を適用するために再起動
actuator.shutdownMotor()
time.sleep(1) # シャットダウンを待つ
actuator = rmd.ActuatorInterface(driver, 1) # 再初期化
# 検証
new_pos = actuator.getMultiTurnEncoderPosition()
print(f"再起動後の位置(0付近であるべき): {new_pos}")
加速度設定
# -*- coding: gbk -*-
import myactuator_rmd_py as rmd
import time
from myactuator_rmd_py.actuator_state import AccelerationType
# 初期化
driver = rmd.CanDriver("can0")
actuator = rmd.ActuatorInterface(driver, 1)
## 初期加速度を取得
print(f"初期加速度: {actuator.getAcceleration()}")
actuator.setAcceleration(5000, AccelerationType.POSITION_PLANNING_ACCELERATION)
## 修正後の加速度を取得
print(f"修正後の加速度: {actuator.getAcceleration()}")
# 異なる加速度タイプを設定
actuator.setAcceleration(1000, AccelerationType.POSITION_PLANNING_ACCELERATION)
actuator.setAcceleration(800, AccelerationType.POSITION_PLANNING_DECELERATION)
actuator.setAcceleration(1200, AccelerationType.VELOCITY_PLANNING_ACCELERATION)
actuator.setAcceleration(1000, AccelerationType.VELOCITY_PLANNING_DECELERATION)
技術サポートと製品に関する議論
弊社製品をご利用いただきありがとうございます!製品の使用体験をスムーズにするために、さまざまなサポートを提供しています。異なる好みやニーズに対応するため、複数のコミュニケーションチャネルをご用意しています。