Arm freezing on out of reach commands

Firmware Version: 3.2.0
Operation System: Win10

Hi, I am trying to run some tracking with OpenMV and the arm does all sorts of funny stuff. The one for this report is that it just dies off when getting to the edge of its range.
Bellow is the list of commands with responses. They are sent at 10/3Hz frequency. Sent by the M7 camera. I tried to send the same sequence from serial monitor by hand and it did not fail, so the frequency makes a difference. Don’t mind the high speed at the commands, bug in my code, but the arm does not seem to mind.
Thanks, Dominik

G0 X250 Y0 Z160 F15000
b’ok \r\n’

G2205 S0 R-4.78125 H-21.09 F216251.8
b’ok \r\n’

G2205 S0 R-4.0375 H-21.46 F218365.1
b’ok \r\n’

G2205 S0 R-2.86875 H-20.72 F209176.5
b’ok \r\n’

G2205 S0 R-1.7 H-20.72 F207896.2
b’ok \r\n’

G2205 S0 R2.3375 H-18.5 F186470.9
b’ok \r\n’

G2205 S0 R1.59375 H-17.02 F170944.6
b’ok \r\n’

G2205 S0 R1.16875 H-17.39 F174292.3
b’ok \r\n’

G2205 S0 R0.53125 H-16.28 F162886.7
b’ok \r\n’

G2205 S0 R0.10625 H-16.28 F162803.5
b’ok \r\n’

G2205 S0 R-0.85 H-14.06 F140856.7
b’ok \r\n’

G2205 S0 R-0.85 H-13.69 F137163.6
b’ok \r\n’

G2205 S0 R-0.31875 H-13.69 F136937.1
b’ok \r\n’

G2205 S0 R-0.10625 H-12.95 F129504.4
b’ok \r\n’

G2205 S0 R0.10625 H-11.84 F118404.8
b’ok \r\n’

G2205 S0 R0.2125 H-11.47 F114719.7
b’ok \r\n’

G2205 S0 R0.31875 H-10.73 F107347.3
b’ok \r\n’

G2205 S0 R-0.0 H-10.73 F107300.0
b’ok E22 unreachable\r\n’

G2205 S0 R0.2125 H-9.62 F96223.47
b’\r\n’
b’ok E22 unreachable\r\n’

G2205 S0 R-0.0 H-9.99 F99899.99
b’\r\n’

G2205 S0 R-0.10625 H-9.99 F99905.65
b’ok E22 unreachable\r\n’
b’\r\n’

G2205 S0 R0.425 H-11.84 F118476.3
b’ok E22 unreachable\r\n’

G2205 S0 R0.2125 H-10.36 F103621.8
b’\r\n’

G2205 S0 R-0.10625 H-10.73 F107305.3

Hi, which example did you use? The vision camera kit?

Some single color rgb blob tracking.

This one? GitHub - uArm-Developer/OpenMV-Examples: OpenMV Demo For Swift Pro

This one https://github.com/openmv/openmv/blob/master/scripts/examples/10-Color-Tracking/single_color_rgb565_blob_tracking.py. Just added sending the relative commands into the loop.

Was it probably caused by miss one command while you sending commands? As it’s a relative motion, miss one command may cause a big difference. BTW, the last coordinate is on the edge position.

There is one missing response already on the 5th command from the end. I believe that the hand is on the edge for several last commands, hence the unreachable responses. But either way, it should not crash/freeze :slight_smile:

How about try the firwmare 4.4.0 first:GitHub - uArm-Developer/SwiftProForArduino at Version_V4.0

Did that, but found that it does not support M2500 I need (afaik) to communicate with the camera.

Hi, if you use the firmware 3.2.0, please add delay for each commands. Here is a example:

int i = 0;
char AS=“”;
char buf[30];
void reck()
{

AS = “”; //clear the buffer
while (Serial2.available() > 0) {
AS = Serial2.read();
Serial.print(AS);
buf[i]=AS;

// Serial.print(i);
// Serial.print(“:”);
// Serial.print(buf[i]);
i++;
}
i=0;
}

void setup() {
// put your setup code here, to run once:
Serial2.begin(115200);
Serial.begin(115200);

Serial2.write(“G0 X250 Y0 Z160 F15000\n”);
AS=“”;
}
void check_connect()
{
Serial2.write(“P2204\n”);

reck();
delay(1000);
if(buf[3]==‘V’&&buf[4]==‘3’&&buf[6]==‘2’)
{

work();
}
//for(i=0;i<30;i++)
//{
// buf[i]=“”;
//}
}
void work()
{
Serial2.write(“G0 X250 Y0 Z160 F15000\n”);
reck();

Serial2.write(“G2205 S0 R-4.78125 H-21.09 F216251.8\n”);delay(1500);
reck();
Serial2.write(“G2205 S0 R-4.0375 H-21.46 F218365.1\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-2.86875 H-20.72 F209176.5\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-1.7 H-20.72 F207896.2\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R2.3375 H-18.5 F186470.9\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R1.59375 H-17.02 F170944.6\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.53125 H-16.28 F162886.7\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.10625 H-16.28 F162803.5\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.85 H-14.06 F140856.7\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.85 H-13.69 F137163.6\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.31875 H-13.69 F136937.1\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.10625 H-12.95 F129504.4\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.10625 H-11.84 F118404.8\n”);delay(500);reck();

Serial2.write(“G2205 S0 R0.2125 H-11.47 F114719.7\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.31875 H-10.73 F107347.3\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.2125 H-9.62 F96223.47\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.0 H-9.99 F99899.99\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.10625 H-9.99 F99905.65\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.425 H-11.84 F118476.3\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R0.2125 H-10.36 F103621.8\n”);delay(1500);reck();

Serial2.write(“G2205 S0 R-0.10625 H-10.73 F107305.3\n”);delay(1500);reck();
Serial.print(“end”);
}
void loop() {
check_connect();
}