Go Down

Topic: Running Dynamixel on Arduino Due (Read 3 times) previous topic - next topic

cmaglie


The problem I am running into is I don't believe the USARTs on the Due can run the Dynamixels at their full buss speed of 1000000.
That is, if I understand the baud rates on the Due, when  I ask for a baud rate of 1000000, the actually generated baud rate is: 84000000/(n*16). Best fit n=5, so actual baud rate is: 1050000 so off by about 5%, which is not close enough.  I believe the spec for the servos is it can handle a delta of up to 3%


Are the servos sending data back to the Due?
If the answer is no, you can try to set the USART in synchronous mode, where the baudrate is generated directly from the master clock, and you can use a divider of 84.
(in the SAM3X datasheet is chapter 36.7.1.3)
C.

KurtE

Thanks,

Unfortunately (or fortunately) the servos provide feedback, so that probably won't work.

But thanks again
Kurt

ephesus

Hi what do mean of the connection of the 1k resistor between TX and RX.How do you connect it in series after that.Can you provide a schematic of this connection.Thank you for your help.Appreciate it.


I am using the Mega to control two MX-64T servos. I see no reason why it cannot be used on the Due in the same fashion.

Here is how it's done. First, the AX-12 library didn't work. You can still #include it to get the #defines. However, I just copied the #define block and changed the compliance constants to the PID values in the correct registers. Next, copy the AX routines for register read8, write8, and write16 to appropriately name functions in your sketch. Once you have these written, you can create other functions by just writing to the appropriate registers. You won't need that many.

On the hardware side, the Mega serial1 port is used with the baud set to 57,600, the servos default. You can go much higher but I had no need to do so, therefore, have no idea where the upper limit lies. The servos have a specific set of baud values set by a series of constants. The match is not perfect but within the tolerance of RS232.

There was also a strange problem in the wiring of the half-duplex line. Fortunately, it can be fixed with a single 1K resistor. I found that I could talk to the servos but not receive any data back. The problem is that the sender in the servo cannot overcome the pullup effect of the Mega TX1 line. This can be solved with a 1K resistor between the Mega TX1 and RX1 pins. The 1K is then in series with the TX1 line going out but the input impedance of the servo receiver is high so no net effect. On receive, the 1K resistor is a pullup which the servo can overcome.

My application is a stable platform for aerial photography so I need only two servos, roll and pitch. The tilt signal comes from an ADXL345 accelerometer breakout board on I2C. The two servos are daisy chained and fed through a single cable. I like the Dynamixel servos due to their high torque, absolute position sensing, high angular resolution, and digital communication.



KurtE

Hi,

I have not tried this, as I was trying using a device that properly handled making a half duplex setup, but How I read this was:

TX ----1K Resistor------+----------To Servos
RX-----------------------+

That is there is a 1K resistor between the TX line and the servos, and the RX line is directly connected to the servos.

Again I have not tried, but that is how I read it and it made some sense.  This helped the receiving of data back from the servos as the TX line was probably still in a high state, but through the resistor it acted more like a Pull up resistor, which the servos could still pull low when needed...

Kurt

Go Up