Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited
Resolved Resolved by Jeremie!

Dynamixel Plugin Timing Questions

I decided to drive my Robotis Bioloid Robot with an EZ-B4. I removed the Robotis CM350 and replaced it with the EZ-B4. Wiring was no problem. The AX-12s are connected to a 12V supply, the EZ-B4 is powered by a DC converter set to 7.4V.
A 6 port expansion hub connected the EZ-B4 Uart (D5) to the signal chain of the 18 servos.
My scripts are in: AX-12Test2.EZB
The Dynamixel plugin is included. The Initialize Lester script initializes UART 1 to 1000000bd, sets up the EZ-B head and hands servos (not connected), clears all the AX-12 servo speeds (V1 - V18) positions the servos to put Lester in the sit position with arms down, then sets all servos to $speed (set @ 5).

The Auto Position Action 'Arm Swing' is set to repeat. Frame arm 0 has the arms down, frame arm 1 has the arms out, and frame arm2 has the arms up.
I have a serious timing problem. When I Execute Arm Swing, the arm up/down motion is very erratic.
Here is a video:
Arm Swing
The scope traces show the EZ-B commands at 3.5V peak and the AX-12 responses at 5V peak.

BTW - Reference my thread:
Interface Ez-b To A Trossen Robotics Hr-os1 Biped Robot

@OldBotBuilder do you have any pauses between your frames? Have you left enough time for the frame to execute and the servos to arrive in their position?

The voltages are correct, the ez-b has 5V tolerant inputs and they output 3.3-3.5VDC at most. The dynamixels will respond to a TTL high signal as long as it's 2.7V or above. (That's how the Atmel microcontroller inside of it operates)
How do I create pauses between frames? I'm sure that is what is needed.
Is there to be a tutorial on Auto Position that explains the different time,g parameters with examples?

@OldBotBuilder.... You use pauses or sleep commands when you use "actions" which as you know are just a bunch of frames strung together... When you add a frame to an action you can add a pause after it before adding the next frame....
Thanks Jeremie and Richard. I found that the timing issues were more severe than I thought. I hope to have more information and examples that I can post soon.
Timing is instant for the UART data to be transmitted from the EZ-B. However, there is always lag time on the WiFi, but that lag is usually in single digit milliseconds on a local network - specifically on in AP mode.

What could be happening is UART signal interference. The UART Baud Rate of the servos is 1,000,000 bps, which will introduce radio interference AND be affected by radio interference.

This interference would prevent the Dynamixel Servos from decoding the UART data, because it will appear as jibberish and will be ignored. This can be caused by a few things...

1) Lengthy wires
2) Straight wires not twisted with a ground line
3) Poor connections/adapters (i.e. pushing pins in plugs, and not soldering)
4) electrical noise on GND line. Is there servo connected to the battery directly? Those dynamixels draw a lot of current. It would be best to connect their VCC and GND to the battery directly and not through the ez-b v4
Thanks for your interest and input.
Quick response:
I am using the same wiring distribution as the Robotis Bioloid.
The Robotis wiring uses straight wire cables. Maybe like I2C?
I have not found any poor connections.
I have looked at 'GND' at various locations on the 'bot and EZ-B and found no noise.
The 12V to the AX-12 distribution is direct from the power source.

I'll have specific data soon.
Can you set each servo to use a lower baud rate? I have a feeling it's timing related and the servos are skipping packets.

It is not I2C, it's UART which is a TTL Serial communication.

I'll take a look at the dynamixel plugin and see if i made it to configure the baud rate. if not, i'll update it for you.

The new plugin lets me change the transmission baud rate but does not change the baud rate the servo expects.

I am testing with 2 new AX-12s - V1 and V2. They both work at 1000000bd but not at any other bd rate.

Is there a way to change the servo's baud rate?

Thanks for your efforts. I think an EZ-B only controlling the AX-12s in my robot can be made to work very well.

Here are the AX-12 Test scripts: AX-12Test.EZB
According to someone in the Trossen forum it seems that you can change the AX-12 baud rate with a USB2Dynamixel.
That is correct. The baud rate option changes the baud rate from the ezb. It does not change the baud rate of the servo. As previously mentioned, the baud rate of the servo must be changed ahead of time.

I am certain robotis has a tool for changing settings? They must have some sort of utility for configuring their servos? I have no idea what robotis makes their products so difficult to use...

Yes, Robotis has a tool for inspecting and changing all the registers of the AX-12s.
I have all the necessary hardware and software, unfortunately, Robotis messed up the FTDI/USB driver so an older version must be used. My computer updates any driver it sees and an "old" one. I must get rid of the application that is doing that.

As soon as I get the old driver re installed, I will try setting the AX-12 bd rate.

Thanks again.
I have used the USB2Dynamixel and the Robotis Dynamical Wizard software to change all my servos bd rates. Register 4 from 1 to 16. 16 switches the servo bd rate to 117647.1 bd. That is close enough to 115200 bd to work.

After the change, I tested the 'bot with the new Dynamixel plugin and it works.
I have some mechanical issues to fix but I'll have more results soon.

It's looking good!
@OldBotBuilder Wow.... you stuck with it, so awesome... I have yet to mess with dynamixels.... Maybe one day... It's threads like these that will make using dynamixels that much easier...

Great to hear - i also think ez-robot will need to make a dynamixel config tool in the plugin since robotis can't make one that non-programmers understand.

I hope you do add more dynamixel plugins. The AX-12s are very good servos if you don't mistreat them. The gears are plastic and they will strip if stressed. You can get gear sets at:

Is it possible to change the Configure - servo Fine Tune Profile so that values other than 90 can be entered as the 'trim from' value? For my 'bot Lester, I would like to trim from:
V1 = 40
V2 = 140

V7 = 60
V8 = 120

All the rest 90.
Testing of the Dynamixel Plugin

AX-12 Test:
Dynamixel plugin
init script: Initializes UART 1 to 115200bd
Vertical Servo: Moves servo V1 (right shoulder)
Horizontal Servo: Moves servo V2 (left shoulder)
Results: Works very well.

AX-12 Test 1:
Dynamixel plugin
Initialize Lester: Initializes UART 1 to 115200bd, sets V1 to V18 servo speeds to 0,
sets servos to 'sit' position with arms down and sets all servo speeds to $speed
Auto Position: Only arm servos.
Frames; arm 0 - arms down, arm 1 - arms out, arm 2 - arms up
Action: Move arms from down to out to up.
Results: Erratic operation. Initialize Lester did not always set each servo, action movement very erratic..

Ax-12 Test 2:
Dynamical plugin
Initialize Lester sit: Initializes UART 1 to 115200bd, sets $dly to 10, sets V1 to V18
servo speeds to 0, but with $dly between each step, sets servos to 'sit' position
with arms down with $dly between each step, and sets all servo speeds to
$speed with $dly between each step.
Auto Position: All servos.
Frames; arm 0 - 'sit' position with arms down, arm 1 - 'sit' position with arms
out, arm 2 - 'sit' position with arms up.
Action: Stay in 'sit' position,' move arms from down to out to up.
arm 0: Sets each servo to 'sit' position with arms down with $dly between each
arm 1: Sets each servo to 'sit' position with arms out with $dly between each
arm 2: Sets each servo to 'sit' position with arms up with $dly between each
Arm Swing: Repeats ControlCommand calls to "arm 0", "arm 1", arm 2,
"arm 0", $i times.
Initialize Lester seemed to work most of the time.
Auto Position movements are very erratic.
Operation with 'Arm Swing" is much better. It works most of the time. Still some skipping and erratic positioning.

I named a frame STAND and now I can't delete it. Don't know if there might be hidden problems.

There is no servo feedback. When I 'initialize' all the servos, I am not sure all of them will work correctly. Because of the 'most of the time' correct movements, I can't rely on getting a reliable "Stand" set of movements. If one servo doesn't work correctly, Lester falls or a servo goes to an unintended position.

For some reason, Robotis building instructions set V7 and V8 at 45 degrees.
These are the hip rotate servos and if I try to use 'Configure' to trim the positions, the hip servos are driven to 90 degrees which bangs them into each other and causes both of them to overheat and shut down.