hi forum. i build quadruped arduino robot and modified the code from this link, i use 12 mg966r servo, the power is 2s lipo 5200mah 30c and 20A stepdown module, i set the voltage to 5,6V. during the build time a have 3 times servo errors (unable to controlled ) the 1st error is with right back leg femur, 2nd error is with left back leg coax servo. for the 1st and 2nd error i could not see clearly what is wrong, the things i remember is i try to increase and reduce the parameter value within x.write(); from 1st and 2nd errors. the 3rd servo errors is with left front leg femur i clearly see and notice that there is smoke come out from the servo and the servo get hot when i run following code
#include <Servo.h>
Servo sc1; // right front coax servo //create servo object to control a servo
Servo sf1; // right front femur
Servo st1; // right front tibia
Servo sc2; // right back coax
Servo sf2; // right back femur
Servo st2; // right back tibia
Servo sc3; // left front coax
Servo sf3; // left front femur
Servo st3; // left front tibia
Servo sc4; // left back coax
Servo sf4; // left back femur
Servo st4; // left back tibia
int i1L1 = 0;
int i2L1 = 0;
int i3L1 = 0;
int i4L1 = 0;
int i1L2 = 0;
int i2L2 = 0;
int i3L2 = 0;
int i4L2 = 0;
int i1L3 = 0;
int i2L3 = 0;
int i3L3 = 0;
int i4L3 = 0;
int i1L4 = 0;
int i2L4 = 0;
int i3L4 = 0;
int i4L4 = 0;
boolean l1status = LOW;
boolean l2status = LOW;
boolean l3status = LOW;
boolean l4status = LOW;
int speedV = 40;
void setup() {
Serial.begin(9600);
sc1.attach(37);
sf1.attach(38);
st1.attach(39);
sc2.attach(40);
sf2.attach(41);
st2.attach(42);
sc3.attach(33);
sf3.attach(32);
st3.attach(31);
sc4.attach(30);
sf4.attach(29);
st4.attach(28);
sc1.write(85);
sf1.write(116);
st1.write(103);
sc2.write(95);
sf2.write(108);
st2.write(104);
sc3.write(115);
sf3.write(65);
st3.write(65);
sc4.write(98);
sf4.write(78);
st4.write(60);
delay(4000);
}
void loop() {
moveLeg3();
delay(speedV);
}
void moveLeg3() {
if (i1L3 <= 10) {
st3.write(63 + i1L3 * 2);
sf3.write(75 + i1L3 * 3);
i1L3++;
}
if (i2L3 <= 30) {
sc3.write(100 - i2L3); //when 115 the femur get hot
i2L3++;
if (i2L3 == 15){
l2status = HIGH;
}
}
if (i2L3 > 20 & i3L3 <= 10) {
st3.write(90 - i3L3 * 2);
sf3.write(100 - i3L3 * 3);
i3L3++;
}
if (i2L3 >= 30) {
sc3.write(70 + i4L3);// 99 the femur get hot
i4L3++;
}
if (i4L3 >= 30) {
i1L3 = 0;
i2L3 = 0;
i3L3 = 0;
i4L3 = 0;
}
}
thank you