How can i control mx-106 by arduino

We are trying to connect arduino → CM-530 → MX-106 + MX-64. We’ve connected them through the Tx, Rx port of Arduino(Mega 2560) and CM-530 by using UART communication. MX-106 and MX-64 is connected to the CM-530 now and we also recognized that we need fit the data packet to the CM-530 in arduino. Please tell us how can we activate the MX-64, MX-106 through arduino and CM-530. If you can, please tell us how can we fix this(Please we need it in specific details).
KakaoTalk_20240813_174608721
KakaoTalk_20240813_174624468

Rather than using the CM-530, I would recommend the use of the DYNAMIXEL Shield to control these actuators using Arduino.

Unfortunately, we must use cm-530.

Your Arduino code has some errors that you should have caught on:

  1. Your code shows this

image

which I think that you meant " uint16_t data = 0x000A; "

  1. Regarding the 6-bytes for the Remocon Packet, you constructed packet[0], packet[1], packet[2] and packet[4] CORRECTLY.

  2. But packet[3] and packet[5] were constructed INCORRECTLY (essentially the outer parentheses should not have been used):
    They should be like these statements:
    packet[3] = ~data & 0xFF;
    packet[5] = ~(data >> 8) & 0xFF;

or this code would be much easier to understand:
packet[3] = ~packet[2];
packet[5] = ~packet[4];

On the TASK code side for the CM-530, please try this example code to verify that the Remocon packet had been received and processed by the CM-530 properly:

image

image
image
Thanks for your help. but it didn`t work… what can i do?

Can you share how you hook up Tx and Rx between Mega 2560 and CM-530? Also the Ground line and Power line of the UART port.

Also increase the delay time on the Mega 2560 to 2 seconds for now.

Update 8/14/2024

First, if I used the USB connection on the CM-530, I can confirm that I got the same “not-working” result as you got.

So I had to dig in further into my own book from 2017 :grinning: (Amazon.com) and I found/remembered that the CM-530 has a particular requirement for communications - see picture below:

CM530-WiredWireless

meaning that we cannot use the USB port and the UART port at the same time on the CM-530.

Next, as I do not have a Mega 2560, I used an UNO-R4 Minima and first tried to use wired UART between my UNO-R4 and the CM-530 - see picture below:

image

and I did get the RXD LED to blink every time (5 seconds) that my UNO-R4 sent a Remocon Packet to the CM-530 and my TASK code on the CM-530 was supposed to play some melody too at that point - but it did not.

Consequently, I switched to a BT solution: Master BT-210 on the UNO-R4 and Matching Peripheral BT-210 on the CM-530 (see picture below):

image

Then everything worked as programmed - see video clip below:

Make sure to note that the RXD LED and DATA LED blinked on before Melody 3 got played. While on the “Wired” configuration, the DATA LED never blinked! - must be some peculiar feature on the Firmware of the CM-530?

The details of my Arduino sketch is shown below:

image

And the details of my TASK code is shown below - I am using TASK V2

image

So this project turned out to be more involved that I thought at first :smiley: but you should be able to go forward with your project now - assuming that you have a matching pair of BT-210s.

1 Like

Hi,

CM-530’s 4-pin UART port checks if there is a BT-210/BT-410/ZIG-110 connected to this UART port.
If any of them is connected, then the baudrate of the UART port is 57600bps, otherwise, it will be set to 1900bps.
So, If you just connect CM-530’s UART Tx/Rx to a Arduino board, then the UART port is set to 1900bps.
If you want to set it to 57600bps, you can use following task command at the beginning of your task code.
image

This is great information that you shared. Very handy if users do not have access to a pair of matching BT transceivers.

@plz_make_easily used this CH255 option at first, but he/she got issues with Serial() and Serial1() in the Arduino sketch. I guess that was why the Remocon packets did not go through in his/her original tests, as they were sent to Serial() instead of Serial1().

Thanks for your help

Also Thanks for your help!

But, my current situation is still bad. I can`t use these board(BT-210/BT-410/ZIG-110). Because, my goal is the same implementation of a paper. Recently i learned that Arduino has 5volt TTL comm level and cm-530 has 3.3volt CMOS level. So i make a Voltage descent circuit.

First from Jason’s post, you do not need those BT modules any more if you use CH255 option. So do not buy them, you can use simple wires for UART connections.

But yes, those older Arduino boards use 5V Logic Level, so you’ll need these Logic Level Shifter boards - very easy to use. They are not expensive but shipping cost can be high for you.

1 Like

Thanks for your help. I really appreciate for your help! Thanks Have a good day~

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.