Difficulties using Cubemars AK70-10 serial communication in servo mode

I am using a ak70 motor which I can control (servo) using the CAN protocol easily. However, I cannot even make basic communications between the arduino NANO and the motor using serial communication, via UART. The following code is what I am using:
Can anyone please help me with this?
Thanks

#include SoftwareSerial motorSerial(10, 11); // RX, TX

byte rotate90deg[] = {
0xAA, 0x05, 0x4A, 0x05, 0x5D, 0x4A, 0x80, 0x84, 0x93, 0xBB
};

unsigned long lastSend = 0;

void setup() {
Serial.begin(115200);
motorSerial.begin(115200);
Serial.println("Sending new protocol GET_VALUES every 2s...");
}

void loop() {
if (millis() - lastSend > 2000) {
motorSerial.write(rotate90deg, sizeof(rotate90deg));
Serial.println("Sent");
lastSend = millis();
}

while (motorSerial.available()) {
byte b = motorSerial.read();
Serial.print(b, HEX);
Serial.print(" ");
}
}

Welcome to the forum

How is the motor powered ?

The motor, in my case, is powered via a AC/DC converter (24V).

Link to datasheet, please. I suspect RS232 signals, which aren't directly Arduino compatible.


These first two.

Page 9 identifies the 3 pins for the CAN interface. You would need a CAN interface board, or a processor with native CAN ability for that.

Page 12 describes signals typical of a classic RS232 interface, likely 12V, though no signal levels are given. Hard to say without a DMM.

What Arduino do you have? Software Serial at 115200 doesn't work on, for example, an Uno or Nano.

I can perfectly exetuce CAN control using :

Although using a DMM is a brilliant idea. Also, I have seen that a controller also developed by cubemars:

has a 5V-3.3V converter, so I might need to reduce the voltage to 3.3V (I suppose arduino runs on 5V).

My board is a NANO V3.

Okay, so yeah, software serial at 115200 isn't going to work. Maximum for success has been reported to be 38400, but I haven't tried. If you can't change the 115200 on the unit, you'll have to switch to an Arduino with a second hardware serial.
Or, give up Serial Monitor, and use the hardware port for the unit interface. Makes debugging that much harder, though.

Hello, thanks for your reply. I am now using an arduino MEGA and reducing the 5V from the arduino TX to 3.3V for the motor's RX. still not working. Am I missing something?

Did you ever confirm the device is not using standard RS232 voltages for those signals?
I ask, because RS232 to 5V interface units generally involve inverting the signals along with voltage changes, so connecting the RS22 level signal directly to your Arduino is both electrically and logically incompatible.
If you've confirmed the interface is 3v or 5v compatible, I have no other suggestions, but show us your Mega code, just in case.

The motor's UART operates at 3.3V, and I have made a circuit to reduce the arduino's 5V to match the motor. However I still cannot receive/send any info.

@andrefg ,

I have deleted your hijack of another topic and duplication of this topic. Please keep your questions to your own topic not add them to other topics. If you wish to bring your question to the atention of a particular person please use @ followed by their username in the same way as I have to bring this to your attention.

Please read the forum guide:

Thank you.

I am sorry, but the question is still in the same topic, issues with serial/uart communication for the ak motor. The “you” is in the plural, such as “can anyone help me”.

I don't understand your reply. You have your question here in this topic, which is fine. You also asked the same thing at the end of someone else's topic, which is not fine because:

  • It's hijacking another topic
  • it's duplicating this question

All this is covered in the forum guide.