RE: Half Duplex UART for TTL Commincation and Wiring w/ the HC126 and HC04

Hello,

@Kurt and @ROBOTIS-Will

You guys…thank you again for adding more support to this cause. I tried to make some circuitry. I failed so far but I think I figured out how to make an amplifier out of the HC04 and HC126. I tested the circuit instead of directly plugging it in to the BBB or Servo. Phew. I need to configure things more before I can understand what it is that needs to happen.

On the HC126, I think I misread what exactly I need to do to conform to its standard and the instructions for that specific chip. Dodged another bullet. Phew. So, my chips are still intact and the Servo/MCU is not damaged either.

Seth

P.S. I will keep plugging at it to see if I can alter things within the chip with source and/or how to communicate with both chips in @ROBOTIS-Will diagram. Anyway, I am playing it safe for now. I only have so many boards to damage before opting to purchase new ones. So, safety freak I “be.”

@ROBOTIS-Will,

I will make a schematic soon of what I have done to see if this schematic is of any use for this particular AX-12A.

Seth

P.S. Sir, is the Direction_PORT on the sample.png schematic a GPIO pin on my board?

Hello Sir,

I compiled the SDK on my linux host SBC. The python3 scripts work but I am receiving an error.

python3 read_write.py
Succeeded to open the port
Succeeded to change the baudrate
[TxRxResult] There is no status packet!

What is the status packet?

Seth

@Kurt,

Sir, is the Direction_Port a GPIO or PWM pin? I can use either but I am unaware of what Direction_Port means.

Seth

P.S. I have the communication down pat but the Direction_Port is the missing link so far on my end. The AX-12A turns on for a bit but then the LED fades out. I tried 9v and 12v. I am getting close. Anyway, I will produce a schematic when it is all done and completed.

Hi,

The DIRECTION_PORT should be connected to a GPIO pin so that it can control the Input / Output direction of data from the buffers.
[TxRxResult] There is no status packet! error means that your program failed to receive the status packet from DYNAMIXEL.
Please refer eManual for more information about the status packet.
You should set up a correct direction control in order to communicate with DYNAMIXEL.

If you are using an SBC with available USB port, you could simply use U2D2 + U2D2 PHB to control DYNAMIXEL.

Thank you.

Hello,

Okay. No issue. Thank you.

Seth

Hello,

@ROBOTIS-Will

I finally got connected via the Wizard. I am not sure how to use it just yet but I will find the manual and figure it out.

Seth

P.S. Does the Wizard work with 64-bit machines or does it only work with 32-bit machines?

@silver2row
Glad that you figured out the connection and successful communication.
DYNAMIXEL Wizard 2.0 supports 3 major OS so please refer to the eManual below.
https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/
If you are using 32bit Windows, the software should work on your machine.

@ROBOTIS-Will,

Sir…w/ the SDK, can I run ping.py as python3 ping.py and receive feedback via the console or should I type up my own source from your SDK?

Seth

P.S. I installed dynamixel_helper via pip and I am trying it now. I have failed so far but I think I need to alter the source of the DynamixelSDK to suit my needs.

Hi,

The codes in the tests directory is written to be run under Linux.
I’d recommend to check if a correct data is transmitted from the port on the control board before getting the response from DYNAMIXEL.

ping.py will work as is if you are running Protocol 2.0 DYNAMIXEL with the factory default setting on Linux.
Below products will work with ping.py example on Linux :

  • XL430-W250-T
  • All XM/XH430 series
  • All XM/XH540 series

Hello Sir,

@ROBOTIS-Will the UART channel and GPIO onboard my SBC works. I have tested it. I need to use Protocol 1 b/c I have an AX-12A only. I have two of them.

Should ping.py work under Linux with Protocol 1?

Seth

Seth,

My bad, let me rephrase my last comment.
The test codes under the Protocol2_0 directory is written for Protocol 2, and you can use test codes under Protocol1_0 for your AX-12A.
If you haven’t change any setting on AX-12A, the code should work on your Linux without any change.
If you are using an embedded controller, this python code may not work as the port defined by DEVICENAME will work differently.
For more accurate information, please describe your development environment with more details such as SBC product name, OS, version, which port name your UART is assigned at, and etc.
Thank you.

Hello Sir,

Okay. No issue. I understand that I was not giving the entire view. So…

I am using a BBB (BeagleBone Black), Linux Debian 10, kernel 4.19.x, and DEVICENAME is equal to “/dev/ttyS2”.

"/dev/ttyS2" is my UART Ports onboard the BBB.

I have been running through the DynamixelSDK to change some things under silver2row on Github.com. This way, when I clone it, I can then use sudo python3 setup.py install to get things working properly.

I know I do not know a bunch about you all’s SDK so far.

Seth

P.S. My GPIO pin is P9.12 and I have it setup as GPIO. I can add a library in the source to make it so I can control the GPIO with code.

Thank you for additional information.
It looks like you haven’t modified the writePort function in the port_handler.py which will control your GPIO pin for direction control.
If you take a look at the writePort function in port_handler_arduino.cpp, you’ll see setTxEnable() and setTxDisable(). These functions control the GPIO pin of the Arduino related boards in their HAL layer. You should do the same for your python code in order to make your code work correctly when sending or receiving data.
Thank you.

@ROBOTIS-Will,

Hello. Okay, you rule. I will test this later. I was not even aware of this .cpp file called port_handler_arduino.cpp and I must have gotten mixed up in the Python source thinking that I could do everything w/ Python. Oops.

Again, and I repeat, you rule!

Seth

My pleasure!
Please let me know how it works as your case can be an important reference for other users as well.
I’m considering creating a tutorial for a similar case like this.

Hello,

Yes sir…I will test it soon so I can reply with my findings.

Seth

Hello @ROBOTIS-Will,

Why would my RX timeout and create the issue of, [TxRxResult] There is no status packet!, no status packet when my wiring seems to be correct?

I know there are a lot of differences in my circuit and the U2D2 circuit. I will purchase the U2D2 soon but I would still like to be able to compile the entire library on my Linux_SBC.

I mean…

Could my RX timeout be happening b/c of no compiled examples or could my RX timeout be b/c of my 3.3v logic from my UART connection? I can use a dc-dc converter or logic level shifter w/ ease. This is not a concern. When you have time, please try to make me understand. I can use all the help one man can get. Peace!

Okay. I was reading some more and found that compilation gives me errors under the ld prefix like so:

 /usr/bin/ld: cannot find -ldxl_sbc_c

I compiled this file correctly (dxl_sbc_c). Should I have compiled it later or before the compilation of the other C/C++ examples?

Anyway, ping.c and the other examples do not compile in C or C++ even when the .so file is created. I cannot use make to compile those files. Are there any hints or ideas spanning around for this endeavor?

@silver2row - sorry I know I am not much help with this one.

A long time ago (about 7 years ago) I did play around some with the BeagleBone Black. Needles to say probably things have changed a lot since then, but back then you had to jump through hoops to enable GPIO. I don’t remember the details any more. At some point I believe you had to do something with device trees.

Again I don’t remember if any regular GPIO pins are already setup…

But that would be one of the first things I would check. And of course if it were me, I would have one of my logic analyzers setup to watch the TX, RX and Direction pin, to see if your setup is properly setting the direction to TX mode at the proper time and then switching to RX mode and to see if anything comes in on the RX pin.

And Note I would also have a 4th pin hooked up on my LA to the actual Dynamixel BUS to make sure things like what I TX actually makes it out.

Again I know that is not much help.

Hello @Kurt,

Seth here. No issue at all. I am most likely going to purchase the U2D2 and power supply to test things out (most likely).

If that does not get my motors up and running, I think I need to look deeper into the source and rearrange some items dedicated to my particular setup.

The GPIO enablement on the boards these days, for the BBB, is as easy as config-pin p9.12 gpio.

There is a “new” config-pin utility to set up modes of peripherals onboard the chip. For instance, there are many modes on one, single pin. So, say Pin 12 on P9 or p9_12 (same thing), I use a pin for UART, I can then change the pin to GPIO w/ the config-pin utility in userspace.

Seth