- C++ 98.3%
- C 1.6%
- CMake 0.1%
| examples | ||
| include | ||
| schematic | ||
| .gitignore | ||
| actuator.cpp | ||
| arduino_droppings.cpp | ||
| CMakeLists.txt | ||
| dynamixel2espressif.cpp | ||
| idf_component.yml | ||
| Kconfig.projbuild | ||
| LICENSE | ||
| master.cpp | ||
| port_handler.cpp | ||
| protocol.cpp | ||
| README.md | ||
Dynamixel2Espressif
This is an espressif port of the Dynamixel2Arduino Dynamixel library.
Using the component
Run the following command in your ESP-IDF project to install this component from the espressif component registry:
idf.py add-dependency "hansj66/dynamixel2espressif"
Or - add the following to your idf_component.yml to define a dependency to the github repository
dependencies:
dynamixel2espressif:
path: dynamixel2espressif.git
git: ssh://git@github.com:hansj66/dynamixel2espressif.git
To run an example, create it as follows:
idf.py create-project-from-example "hansj66/dynamixel2espressif:<example name>"
Example: If you want to create a project based on the "ping" example:
idf.py create-project-from-example "hansj66/dynamixel2espressif:ping"
The default pinout is:
- DATA_PIN=18
To change the default pinout:
idf.py menuconfig
And then navigate to the menu "Dynamixel 2 Espressif configuration" to customize the pinout to your application.
Examples
Examples beyond the "ping" and "position" examples can be found in the original Dynamixel2Arduino repository. The syntax is identical with the espressif version, except for the constructor.
License
This component is provided under Apache 2.0 license, see LICENSE file for details.
Hardware
This library has been tested with Dynamixel XL-320 and Dynamixel AX-12 servos. These are all using half duplex protocol.
Test setup
This schematic shows a section of the schematic for a PCB with 6 physical ports (Since the servos are normally daisy chained, you can get away with having only having one physical port).
Since the ESP32 is a 3.3V device and the servos use 5V logic, we have to add a level shifter between the ESP and the dynamixel bus.
The level shifter controls the NC7WZ241/74LVC2G241 buffer which in turn controls the bus. The port handler pulls the SERVO_DIR pin high before transmission and then pulls it low after transmission, to enable reception of status packets from the servos.
Please refer to the The Dynamixel 2.0 protocol in the ROBOTIS e-manual for details.