Canada
Asked — Edited

Communicating With A Dynamixel Servo

Today is the first time I really had a chance to play with the EZB-4. I've connected a Dynamixel servos and had mixed results. The resolution is 0 to 170 but the servos are unresponsive from 81 to 89 for some reason.

I tried communicating with the servos with EZ script using UART 2 with no luck.

I'm using the communication protocol for the servos. This works with Python through a serial connection.

UARTInit(0,1,1000000)

$AX_Write_Data=3 #Dynamixel Instruction Code $AX_ID=14 #Servo ID $length=7
$table=30 #this is the entry code for setting the goal position of the servo

$position=100 #set goal position for servo

$speed=20 #set the speed of the servo

$MSB=Round($position/256,0) $LSB=$position%256 $MSB2=Round($Speed/256,0) $LSB2=$Speed%256

$checksum= 255-(($AX_ID+$length+$AX_Write_Data+$table+$MSB+$LSB+$MSB2+$LSB2)%256)

$handshake=GetAsByte(255) $AX_ID=GetAsByte(14) $length=GetAsByte(5) $AX_Write_Data=GetAsByte($AX_Write_Data) $table=GetAsByte($table) $LSB=GetAsByte($LSB) $MSB=GetAsByte($MSB) $LSB2=GetAsByte($LSB2) $MSB2=GetAsByte($MSB2) $checksum=GetAsByte($checksum)

UARTWrite(0,1,$handshake) UARTWrite(0,1,$handshake) UARTWrite(0,1,$AX_ID) UARTWrite(0,1,$AX_Write_Data) UARTWrite(0,1,$table) UARTWrite(0,1,$LSB) UARTWrite(0,1,$MSB) UARTWrite(0,1,$LSB2) UARTWrite(0,1,$MSB2) UARTWrite(0,1,$checksum)

Thanks


ARC Pro

Upgrade to ARC Pro

ARC Pro will give you immediate updates and new features needed to unleash your robot's potential!

PRO
Synthiam
#1  

That's neat that you have attempted to create your own:) there is already support built into the EZ-B v4. Check this link out: Dynamixel Servo

#2  

I still can't get the servos to move from 81 to 89 and I would like to have control over the speed.

I should be able to communicate with the servos through the EZ script, what I'm I doing wrong?

PRO
Synthiam
#3  

ServoSpeed() will set the speed of all servos including dynamixel.

I'm unsure of what you mean by not being able to move to positions outside of 81-89? Can you clarify and I'll help you. It works with our servos, but they are standard and have the factory settings still. Perhaps you need to reset yours?

#4  

I can move them from position 0 to 170 but for some reason when I get to position 80 it stops responding until position 90 is indicated. The servo then becomes responsive again all the way to 170.

PRO
Synthiam
#5  

Interesting - I will take a look tomorrow for you.

As for your code, it appears you are using UART 0 and not UART 2.

#6  

Sorry I'm using digital port 5 to connect to the dynamical servo. My python code works but I can't get the EZ script to work. It really would cool if it would.

#7  

I have been playing with Dynamixel servos connected to D5. I haven't seen a dead spot issue but I have been having some communication issues. I am trying to use the D18 and D19 UART to talk to an emic2 serial text to speech device. I found I had to send ARC commands to the Dynamixel servos first or I couldn't talk to them. Also the servos would occasional seem not to recieve commands after I had sent text to the D18/D19 UART2. I didn't try using any commands to set up the D5 Dynamixel port using UART commands. ARC servo speed works with the Dynamixel servos when I can reliably communicate with them. My problem didn't show up until I started using a second UART. Was trying to debug what is really happening when I saw this forum discussion.

PRO
Synthiam
#8  

Use the latest ARC - I am not receiving any dead spots or communication issues. Perhaps check your wires for communication issues - or add a capacitor to filter the motor noise?

As for the dynamixel, I did notice there was an occasional checksum calculation error in the old ARC. It is fixed in the new one. Download the new one from here: ARC release

PRO
Synthiam
#9  

Robert, I am able to communicate with UART2 and Dynamixel at the same time without any issues. Here is my example that I just used with success...

As you can see, I initialize UART 2 at 9600. I then write the word "Banana" to UART2 on every loop. The Dynamixels work great :)


uartinit(0, 2, 9600)

:loop

uartwrite(0, 2, "bannaa")

$position = 50

goto(SetPosition)

sleep(1000)

$position = 100

goto(SetPosition)

sleep(1000)

goto(loop)



:setPosition

servo(ax7, $position)

servo(ax4, $position)

servo(ax5, $position)

servo(ax6, $position)

servo(ax3, $position)

servo(ax18, $position)

return

#10  

Thanks DJ , I'll have to wait for tomorrow to try it out.

#11  

It works, no more dead spots, yay !

Now I don't want to be a pain in the butt. The torque release and enable for the dynamixel is instruction code 24. To have the servo send it's present position is instruction code 36 but you would have to receive data from the servo from UART port D6.

Thanks DJ

PRO
Synthiam
#12  

One day we will add a way to receive data - but right now it's not our highest priority due to supporting Revolution :)

As for Torque Release, I will add that for you :)

We also have support for the XL-320's - but that hasn't been added yet. Maybe i'll do that tonight or tomorrow.

#13  

Awesome, you have created a great platform for us hackers. Nice work.

Thanks

PRO
Synthiam
#14  

Thanks for the compliment :)