OpenCM Example Set Spin Dynamixel Wheel Mode Example This example shows how to

Opencm example set spin dynamixel wheel mode example

This preview shows page 4 - 7 out of 7 pages.

OpenCM Example Set Spin /* Dynamixel Wheel Mode Example This example shows how to use dynamixel as wheel mode All dynamixels are set as joint mode in factory, but if you want to make a wheel using dynamixel, you have to change it to wheel mode by change controlmode to 1 Compatibility CM900 O OpenCM9.04 O Dynamixel Compatibility AX MX RX XL-320 Pro CM900 O O O O X OpenCM9.04 O O O O X **** OpenCM 485 EXP board is needed to use 4 pin Dynamixel and Pro Series **** created 22 May 2014 by ROBOTIS CO,.LTD. */ #define DXL_BUS_SERIAL1 1 //Dynamixel on Serial1(USART1) <-OpenCM9.04 #define DXL_BUS_SERIAL2 2 //Dynamixel on Serial2(USART2) <-LN101,BT210 #define DXL_BUS_SERIAL3 3 //Dynamixel on Serial3(USART3) <-OpenCM 485EXP #define ID_NUM 1 Dynamixel Dxl ( DXL_BUS_SERIAL1 ) ; void setup () {
Image of page 4
// Initialize the dynamixel bus: // Dynamixel 2.0 Baudrate -> 0: 9600, 1: 57600, 2: 115200, 3: 1Mbps Dxl. begin ( 3 ) ; Dxl. wheelMode ( ID_NUM ) ; //wheelMode() is to use wheel mode } void loop () { Dxl. goalSpeed ( ID_NUM , 400 ) ; //forward delay ( 5000 ) ; Dxl. goalSpeed ( ID_NUM , 400 | 0x400 ) ; //reverse delay ( 5000 ) ; Dxl. goalSpeed ( ID_NUM , 0 ) ; //stop delay ( 2000 ) ; } Read Encoder Example This example shows how to read the encoder value from motor ID 1 of a Dynamixel (XL-320) and print it to the USBSerial terminal. OpenCM XL 320 Read Encoder Example /* Dynamixel ID Change Example */ /* Serial device defines for dxl bus */ #define DXL_BUS_SERIAL1 1 //Dynamixel on Serial1(USART1) <-OpenCM9.04 #define DXL_BUS_SERIAL2 2 //Dynamixel on Serial2(USART2) <-LN101,BT210 #define DXL_BUS_SERIAL3 3 //Dynamixel on Serial3(USART3) <-OpenCM 485EXP /* Dynamixel ID defines */ #define J_ID 1 #define PRESENT_POS 54 Dynamixel Dxl ( DXL_BUS_SERIAL1 ) ; void setup () { // Initialize the dynamixel bus: // Dynamixel 2.0 Baudrate -> 0: 9600, 1: 57600, 2: 115200, 3: 1Mbps Dxl. begin ( 3 ) ; Dxl. maxTorque ( J_ID , 1 ) ; // it has maxtorque for weak movement // Dxl.jointMode(J_ID); //jointMode() is to use position mode
Image of page 5
} void loop () { int pos ; // Wait for 20 milliseconds delay ( 20 ) ; pos = Dxl. readWord ( J_ID , PRESENT_POS ) ; // Read present position SerialUSB. print ( "Present Position: " ) ; SerialUSB. println ( pos ) ; } Change Motor ID Example This example shows how to change the motor ID of a Dynamixel (XL-320) with any motor ID to ID 2. It will
Image of page 6
Image of page 7

You've reached the end of your free preview.

Want to read all 7 pages?

  • Fall '14
  • Serial port, dynamixel, Dynamixel Dxl, dynamixel id

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Stuck? We have tutors online 24/7 who can help you get unstuck.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes