lego_dynamixel_control_xl320
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
lego_dynamixel_control_xl320 [2019/05/16 21:49] – [NXC Code] ntorresreyes | lego_dynamixel_control_xl320 [2019/06/06 23:03] (current) – [NXC Code] ntorresreyes | ||
---|---|---|---|
Line 143: | Line 143: | ||
**RS485 to TTL** | **RS485 to TTL** | ||
\\ | \\ | ||
- | The XL-320 uses TTL logic levels (0 to 5v) for communication. Since the NXT uses RS485 communication, | + | The XL-320 uses TTL logic levels (0 to 5v) for communication. Since the NXT uses RS485 communication, |
\\ | \\ | ||
\\ | \\ | ||
+ | {{: | ||
+ | \\ | ||
+ | \\ | ||
+ | The MAX485 chip offers some simplicity over using an off the shelf converter although many higher level features are not included. Nevertheless, | ||
+ | \\ | ||
+ | *1 - TTL Output | ||
+ | *2 - LOW (GND) | ||
+ | *3 - LOW (GND) | ||
+ | *4 - Not Connected | ||
+ | *5 - GND | ||
+ | *6 - SDA (From NXT) | ||
+ | *7 - SCL (From NXT) | ||
+ | *8 - 5 volts | ||
**Writing Dynamixel ID's** | **Writing Dynamixel ID's** | ||
\\ | \\ | ||
Line 216: | Line 229: | ||
The NXC code files as well as the header file is included below in a .zip file: | The NXC code files as well as the header file is included below in a .zip file: | ||
\\ | \\ | ||
- | {{:torres:tutorials: | + | {{:torres:xl320_codev2.zip|}} |
\\ | \\ | ||
**Controlling Multiple Dynamixels** | **Controlling Multiple Dynamixels** | ||
Line 222: | Line 235: | ||
When controlling multiple Dynamixels, only a few more steps are required. First, each Dynamixel should have its own ID as described in the preliminary section. | When controlling multiple Dynamixels, only a few more steps are required. First, each Dynamixel should have its own ID as described in the preliminary section. | ||
< | < | ||
- | #define ID1 90 | + | #define ID1 01 |
- | #define ID2 91 | + | #define ID2 02 |
</ | </ | ||
\\ | \\ | ||
- | Next, each Dynamixel should be initialized with the " | ||
- | < | ||
- | SetMode(ID1, | ||
- | SetMode(ID2, | ||
- | </ | ||
\\ | \\ | ||
Finally, when using the " | Finally, when using the " | ||
Line 266: | Line 274: | ||
Wait(10); | Wait(10); | ||
} | } | ||
- | | ||
- | | ||
| | ||
Line 304: | Line 310: | ||
} | } | ||
</ | </ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
====Running and Analysis==== | ====Running and Analysis==== | ||
- | Running the code is straight forward. Ensure that the NXT is connected to the computer via the USB cable and the [[http:// | + | Running the code is straight forward. Ensure that the NXT is connected to the computer via the USB cable and the [[http:// |
\\ | \\ | ||
- | For a single servo control, connect one of the Dynamixel cables to the power supply and another to the breadboard adapter. If using two or more, one cable goes from the breadboard adapter | + | For a single servo control, connect one of the Dynamixel cables to the TTL output. If using two or more, one cable goes from the TTL output |
\\ | \\ | ||
**Video:** | **Video:** | ||
\\ | \\ | ||
- | {{youtube> | + | {{youtube> |
\\ | \\ | ||
\\ | \\ | ||
**Logic Analyzer (OPTIONAL)** | **Logic Analyzer (OPTIONAL)** | ||
\\ | \\ | ||
- | The logic analyzer can be connected to the +5V, GND, SDL, SDA pins on the breadboard adapter before connecting to a dynamixel. Instruction on using the logic analyzer with your computer can be found [[https:// | + | The logic analyzer can be connected to the +5V, GND, SDL, SDA pins on the breadboard adapter before connecting to a dynamixel. Instruction on using the logic analyzer with your computer can be found [[https:// |
\\ | \\ | ||
{{: | {{: | ||
Line 330: | Line 331: | ||
This tool is useful in debugging any errors that may arise when communicating with the Dynamixels that may otherwise be impossible to catch. | This tool is useful in debugging any errors that may arise when communicating with the Dynamixels that may otherwise be impossible to catch. | ||
====Conclusions==== | ====Conclusions==== | ||
- | In Conclusion, this tutorial has provided a brief introduction into RX-485 serial communication, | + | In Conclusion, this tutorial has provided a brief introduction into RS-485 serial communication, |
lego_dynamixel_control_xl320.1558068545.txt.gz · Last modified: by ntorresreyes