AL5D arm fail operation

Hey guys, I recently bought the AL5D robotic arm ( the one on this site lynxmotion.com/p-868-al5d-robotic-arm-combo-kit-botboarduino.aspx ), and I wanted to control it using the ps2 controller which is on this site ( lynxmotion.com/p-1096-ps2-robot-controller-v4.aspx ) . I followed the assembly guides and did everything as mentioned, but the end result is not what we are expecting. regarding the connection of the servos and the ps2 controller to the BotBoarduino I used the information provided on this site ( lynxmotion.com/images/html/build091b.htm ). The code I used was the ps2 control code which is available on this site ( github.com/Lynxmotion/Arms/tree/Botboarduino ). The power sources we are using are 9VDC battery and the adapter which you guys provided to me ( 6VDC 5A). The problems I am facing are

1- After connecting all of the needed wires and the power sources to my botboarduino v1.0 and connecting the PS2 receiver module, when I try to connect the PS2 controller to the receiver, the red and green lights keep blinking on the PS2 controller and are never able to establish a stable connection. I have tried to wait for a very long time, but nothing seems to work. However the green light on the receiver itself turns solid after few seconds.

2 - After turning on all the power supplies and uploading the code the arm starts immediatlly to act weirdly and not receiving any command.







Hi,

First, thanks for all the clear details about your situation, what was attempted and the pictures! It certainly makes it easier to get a good grasp of the problem when all the information is presented so neatly! :wink:

Since your pictures seem to show at first glance that everything is well setup and connected, the first step would be to test the basic functionality of the robotic arm without the PS2 controller to ensure it actually works and responds properly. Since pictures cannot really show us that, you’ll have to try the following:

  1. Disconnect the PS2 receiver from the BotBoarduino
  2. Program the BotBoarduino with the KeyboardControl example, available here.
  3. Connect by serial communication to the BotBoarduino (you can use the Arduino IDE’s Serial Monitor) and send commands to move the arm.
  4. Indicate in your reply if the arm moves as expected/what happens when you send the various commands. The keys used are found here (line 137). Simply type one letter in the Serial Monitor’s interface and press enter to send it to the BotBoarduino.

If the above test works out well, then we will move on to troubleshooting the PS2 controller/receiver itself/with the BotBoarduino and AL5D.

Sincerely,

Thank you for your generous response.

Firstly I did exactly like you told me. I disconnected the reciever module and the turned off the ps2 controller. and then I tried to program the botboarduino with the code you provde to me. When I tried to verify the code at the first time, some errors showed up to me and they were indicating that was some mistakes in the first few lines of the code, which I finally managed to fix them and make the code work perfectly and be uploaded to the board. The final version of the code I used is:

(The lines in red, were previously wrong and I edited them and made them like this untill the code was verifed by this form and uploaded)

[highlight=#ff0000]#if ARDUINO >= 100[/highlight]
[highlight=#ff0000]#include “Arduino.h”[/highlight]
[highlight=#ff0000]#if defined(ARDUINO) && ARDUINO >= 100[/highlight]
[highlight=#ff0000] #include “Arduino.h”[/highlight]
[highlight=#ff0000] #else[/highlight]
[highlight=#ff0000] #include “WProgram.h”[/highlight]
[highlight=#ff0000] #endif[/highlight]
[highlight=#ff0000]#endif[/highlight]

#include <Servo.h>
#include <math.h>

//comment to disable the Force Sensitive Resister on the gripper
//#define FSRG

//Select which arm by uncommenting the corresponding line
//#define AL5A
//#define AL5B
#define AL5D

//uncomment for digital servos in the Shoulder and Elbow
//that use a range of 900ms to 2100ms
//#define DIGITAL_RANGE

#ifdef AL5A
const float A = 3.75;
const float B = 4.25;
#elif defined AL5B
const float A = 4.75;
const float B = 5.00;
#elif defined AL5D
const float A = 5.75;
const float B = 7.375;
#endif

//Arm Servo pins
#define Base_pin 2
#define Shoulder_pin 3
#define Elbow_pin 4
#define Wrist_pin 10
#define Gripper_pin 11
#define WristR_pin 12

//Onboard Speaker
#define Speaker_pin 5

//Radians to Degrees constant
const float rtod = 57.295779;

//Arm Speed Variables
float Speed = 1.0;
int sps = 3;

//Servo Objects
Servo Elb;
Servo Shldr;
Servo Wrist;
Servo Base;
Servo Gripper;
Servo WristR;

//Arm Current Pos
float X = 4;
float Y = 4;
float Z = 90;
int G = 90;
float WA = 0;
int WR = 90;

//Arm temp pos
float tmpx = 4;
float tmpy = 4;
float tmpz = 90;
int tmpg = 90;
int tmpwr = 90;
float tmpwa = 0;

//boolean mode = true;

int Arm(float x, float y, float z, int g, float wa, int wr) //Here’s all the Inverse Kinematics to control the arm
{
float M = sqrt((yy)+(xx));
if(M <= 0)
return 1;
float A1 = atan(y/x);
if(x <= 0)
return 1;
float A2 = acos((AA-BB+MM)/((A2)M));
float Elbow = acos((A
A+BB-MM)/((A*2)*B));
float Shoulder = A1 + A2;
Elbow = Elbow * rtod;
Shoulder = Shoulder * rtod;
if((int)Elbow <= 0 || (int)Shoulder <= 0)
return 1;
float Wris = abs(wa - Elbow - Shoulder) - 90;
#ifdef DIGITAL_RANGE
Elb.writeMicroseconds(map(180 - Elbow, 0, 180, 900, 2100 ));
Shldr.writeMicroseconds(map(Shoulder, 0, 180, 900, 2100));
#else
Elb.write(180 - Elbow);
Shldr.write(Shoulder);
#endif
Wrist.write(180 - Wris);
Base.write(z);
WristR.write(wr);
#ifndef FSRG
Gripper.write(g);
#endif
Y = tmpy;
X = tmpx;
Z = tmpz;
WA = tmpwa;
#ifndef FSRG
G = tmpg;
#endif
return 0;
}

void setup()
{
Serial.begin(9600);
Base.attach(Base_pin);
Shldr.attach(Shoulder_pin);
Elb.attach(Elbow_pin);
Wrist.attach(Wrist_pin);
Gripper.attach(Gripper_pin);
WristR.attach(WristR_pin);
Arm(tmpx, tmpy, tmpz, tmpg, tmpwa, tmpwr);
}

const float posDeltaX = 0.25;
const float posDeltaY = 0.25;
const float posDeltaZ = 2.5;
const float posDeltaWa = 2.5;
const int posDeltaG = 5;
const int posDeltaWr = 5;
long lastReferenceTime;
unsigned char action;

#define actionUp 119 // w
#define actionDown 115 // s
#define actionLeft 97 // a
#define actionRight 100 // d
#define actionRotCW 101 // e
#define actionRotCCW 113 // q
#define actionGripperOpen 114 // r
#define actionGripperClose 116 // t
#define actionWristUp 122 // z
#define actionWristDown 120 // x
#define actionWristRotCW 103 // g
#define actionWristRotCCW 102 // f

void loop()
{
if(Serial.available() > 0)
{
// Read character
action = Serial.read();
if(action > 0)
{
// Set action
switch(action)
{
case actionUp:
tmpy += posDeltaY;
break;

case actionDown:
tmpy -= posDeltaY;
break;

case actionLeft:
tmpx += posDeltaX;
break;

case actionRight:
tmpx -= posDeltaX;
break;

case actionRotCW:
tmpz += posDeltaZ;
break;

case actionRotCCW:
tmpz -= posDeltaZ;
break;

case actionGripperOpen:
tmpg += posDeltaG;
break;

case actionGripperClose:
tmpg -= posDeltaG;
break;

case actionWristUp:
tmpwa += posDeltaWa;
break;

case actionWristDown:
tmpwa -= posDeltaWa;
break;

case actionWristRotCW:
tmpwr += posDeltaWr;
break;

case actionWristRotCCW:
tmpwr -= posDeltaWr;
break;
}

// Display position
Serial.print("tmpx = “); Serial.print(tmpx, DEC); Serial.print(”\ttmpy = “); Serial.print(tmpy, DEC); Serial.print(”\ttmpz = “); Serial.print(tmpz, DEC); Serial.print(”\ttmpg = “); Serial.print(tmpg, DEC); Serial.print(”\ttmpwa = “); Serial.print(tmpwa, DEC); Serial.print(”\ttmpwr = "); Serial.println(tmpwr, DEC);

// Move arm
Arm(tmpx, tmpy, tmpz, tmpg, tmpwa, tmpwr);

// Pause for 100 ms between actions
lastReferenceTime = millis();
while(millis() <= (lastReferenceTime + 100)){};
}
}
}

Other than that, I find myself completely disabled to perform any operation or even use the serial monitor to control the arm because of some problems that happen when I turn on the power switches, In the next videos, I tried to connect the arm with the power sources in 4 different ways. The videos will show clearly what happens in every situation.

1 - Using 2 power sources. 6VDC/ 5A and 9V battery
youtube.com/watch?v=D7lqJxZk2zw

2 - Using 2 power sources. 6VDC/ 2A and 9V battery
youtube.com/watch?v=AZjtQfy-L1U

Using 1 power source. 6VDC/ 5A
youtube.com/watch?v=33sTjtw0ufY

Using 1 power sources. 6VDC/ 2A
youtube.com/watch?v=KZsBcLkIFLcHELP…

Hi,

Here are answers to your questions/comments (in-line):

Please note that the code at the top (see below) was left for legacy reasons and is commented because it has not been useful in many years. Indeed, only > #include “Arduino.h” < should be required to initialize properly. If your IDE causes issues with compiling this code, then you are probably using a very old version of the Arduino IDE. The code as-is on GitHub was tested with Arduino 1.8.5 (the newest version at the time of writing this) and compiles without any changes. If you are not running the newest version, we greatly recommend that you upgrade now, as this may be causing other issues (such as using deprecated code and libraries).

//#if ARDUINO >= 100 #include "Arduino.h" //#else //#include "WProgram.h" //#end if

Also, if you need to attach code in the future, please do so as a file (attachment), as this makes it easier to read the post.

If you are using the “keyboard control” example as mentioned in the previous post, then the arm will first initialize to a 1500 position on each motor. Since your arm seems to be going straight down at the elbow, it may be possible that during assembly this motor was not centered properly.

To check this out, here’s a few things to test:
First, lets check the power situation. With the robotic arm powered off (all switches), remove the 9 V battery and connect the 6 V DC 5 A power supply. Set the jumper to VS=VL (as in your third video, basically). This is the recommended setup for the current version of this kit if using it autonomously. If only using it by USB, you can remove the VS=VL and use USB power instead of external (change that jumper too).

With the power setup completed, lets check the elbow joint. Disconnect the elbow servomotor from the BotBoarduino. Then, upload this code to it. It should play a two tones and then have the on-board “L” LED blink. All servomotors used by the robotic arm should be fixed to 1500. If this works well with the elbow disconnected for all the other joints, then it should be a simple matter of fixing the elbow joint.

To do this, remove power to the arm and unscrew the horn from the bracket at the elbow joint. Then, power the arm using the Fixed1500 code, this will center the horn. Then, place the bracket so that the elbow-wrist tube is perpendicular with the shoulder-elbow tube. Remove power again and reattach the horn back on to the bracket. Power the arm again; it should now have roughly a standard starting position of 1500 where the arm is bent ~90 degrees at the elbow.

In this case, the power supply is simply not powerful enough (we do ship the arm with a 6 V, 5 A power supply). Therefore, the BotBoarduino is continuously in brownout/reset.

Let us know how if this works out and if you have any other issues. If the calibration part works out well, you can try the keyboard control code again.

Sincerely,

Hey again, I have followed the instructions you gave me and thankfully the arm worked fine But still we are facing a simple issue which is that we open the power source switch for the servo motors which is the power adapter (6VDC,5A), the arm kind of have a strong shock and kind of go in a freezing state, but then when we send start to send commands for it by the serial monitor it responds normally, except for the gripper motor we are also facing some lagging and it doesn’t open or close all the time, like sometimes we send the action “GripperOpen” or “GripperClose” and nothing happens and sometimes its servo motor start to heat up. Any suggestions about those 2 problems?

Next thing is, we are willing to control the robotic arm motors through Kinect sensor, and we are wondering if there is any information you can provide us with to help us regarding this point.

Thank you in advance. best regards.

Hi,

Here are answers to your questions and comments (in line):

Great news!

Please provide a video of this situation. Make sure the video show all that happens from before power-up to working normally.

Please describe the “lagging” in more details. Also provide a video if possible / for clarity.

It would seem like the servomotor is not centered properly with the bracket for controlling the gripper. Please note that the default grippe closes/opens fully in less than the full range. If you try and use the full range of the servomotor motion (180 degrees), you will most likely get the motor in a stall condition. Please also provide a video of you doing this so we can see what is happening exactly. If possible, try to identify when you are doing which actions, too.

We do not have any information about using the Kinect sensor, since that is not a direct use and more of a general idea. You may want to search online about projects that use the Kinect to get a better idea of what is possible.

As for the AL5D robotic arm, usually it is best to use the kit with a SSC-32U when trying to connect it to external controllers (such as a computer with a Kinect).

We hope this helps.

Sincerely,