A Python Driver for MIT Mini-Cheetah Actuator which uses SocketCAN for communication.
Project description
Python Motor Driver for Mini Cheetah Actuator: T-Motor AK80-6
This driver was developed at Robotics Innovation Center at DFKI GmbH, Bremen.
It assumes the use of PEAK System's PCAN-USB adapter connected to a linux (tested on Ubuntu) computer. The SocketCAN inteface is used, thus allowing the use of Python Socket library.
Dependencies:
- bitstring
Install via:
pip3 install bitstring
Documentation
- Useful videos:
- Datasheet
- Documentation from Ben Katz
Pre-requisites:
-
Setting up the CAN interface:
-
Run this command and make sure that
can0
(or any other can interface depending on the system)shows up as an interface after connecting the USB cable to your laptop:ip link show
-
Configure the
can0
interface to have a 1 Mbaud communication frequency:sudo ip link set can0 type can bitrate 1000000
-
To bring up the
can0
interface, run:sudo ip link set up can0
-
-
To change motor parameters such as CAN ID or to calibrate the encoder, a serial connection is used. The serial terminal that can be used on linux for this purpose is
cutecom
.
Usage:
Import: from motor_driver.canmotorlib import CanMotorController
Example Motor Initialization: motor = CanMotorController(can_socket='can0', motor_id=0x01, socket_timeout=0.5)
Available Functions:
enable_motor()
disable_motor()
set_zero_position()
send_deg_command(position_in_degrees, velocity_in_degrees, Kp, Kd, tau_ff):
send_rad_command(position_in_radians, velocity_in_radians, Kp, Kd, tau_ff):
change_motor_constants(P_MIN_NEW, P_MAX_NEW, V_MIN_NEW, V_MAX_NEW, KP_MIN_NEW, KP_MAX_NEW, KD_MIN_NEW, KD_MAX_NEW, T_MIN_NEW, T_MAX_NEW)
All functions return current position, velocity, torque in SI units except for send_deg_command
. change_motor_constants
does not return anything.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for mini-cheetah-motor-driver-socketcan-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 345cd4ce946a91180e718286afaabd2cadd29a884a8697df24800b37be796cbd |
|
MD5 | 344cc87f17be39b78feac26bf874eb70 |
|
BLAKE2b-256 | 96886d7fed7fcbeded105d3379d62ecbb0e26cf0d99c176d853b53c0713cccd0 |
Hashes for mini_cheetah_motor_driver_socketcan-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca7e2a7ff49689937e59ab73471265ab5956f014b5ee6d687ea73c4fbe7f4f65 |
|
MD5 | 8bc466fee6abcefe73a126a9525c2b0f |
|
BLAKE2b-256 | 22b59a46f78b6e16c9bb4df1ab7b8be384b44b5433afc598aabd83b76102413e |