Thanks. Happy to hear you liked it.
Is that the battles after the boob job one? Does that one also have out of sync scripts? I probably missed the fact that the speeds change. Most of my testing was in the gallery. I’ll go back and add the scripts for the other speeds.
I recently had to buy new servos for my SR6 and they inverted everything for me as well. Most of the inversion was correctable by just flipping the pins. Basically making the firmware think my right servos were on the left and vice-versa.
This still had my roll inverted though. Which I fixed by negating the values in the firmware.
Tempest firmware
if (OSR2_MODE) {
// Calculate arm angles
// Linear scale inputs to servo appropriate numbers
int stroke,roll,pitch;
stroke = map(xLin,0,9999,-350,350);
roll = map(yRot,0,9999,-180,180);
pitch = map(zRot,0,9999,-350,350);
ledcWrite(LowerLeftServo_PWM, map(LowerLeftServo_ZERO + stroke + roll,0,MainServo_Int,0,65535));
ledcWrite(LowerRightServo_PWM, map(LowerRightServo_ZERO - stroke + roll,0,MainServo_Int,0,65535));
ledcWrite(LeftPitchServo_PWM, map(LeftPitchServo_ZERO - pitch,0,PitchServo_Int,0,65535));
// Unused servo pins.
ledcWrite(UpperLeftServo_PWM, map(UpperLeftServo_ZERO,0,MainServo_Int,0,65535));
ledcWrite(RightPitchServo_PWM, map(RightPitchServo_ZERO,0,PitchServo_Int,0,65535));
ledcWrite(UpperRightServo_PWM, map(UpperRightServo_ZERO,0,MainServo_Int,0,65535));
}
// SR6 Kinematics
else {
// Calculate arm angles
int roll,pitch,fwd,thrust,side;
int out1,out2,out3,out4,out5,out6;
roll = -map(yRot,0,9999,-3000,3000);
pitch = map(zRot,0,9999,-2500,2500);
fwd = map(yLin,0,9999,-3000,3000);
thrust = map(xLin,0,9999,-6000,6000);
side = map(zLin,0,9999,-3000,3000);
// Main arms
out1 = SetMainServo(16248 - fwd, 1500 + thrust + roll); // Lower left servo
out2 = SetMainServo(16248 - fwd, 1500 - thrust - roll); // Upper left servo
out5 = SetMainServo(16248 - fwd, 1500 - thrust + roll); // Upper right servo
out6 = SetMainServo(16248 - fwd, 1500 + thrust - roll); // Lower right servo
// Pitchers
out3 = SetPitchServo(16248 - fwd, 4500 - thrust, side - 1.5*roll, -pitch);
out4 = SetPitchServo(16248 - fwd, 4500 - thrust, -side + 1.5*roll, -pitch);
// Set Servos
ledcWrite(LowerLeftServo_PWM, map(LowerLeftServo_ZERO - out1,0,MainServo_Int,0,65535));
ledcWrite(UpperLeftServo_PWM, map(UpperLeftServo_ZERO + out2,0,MainServo_Int,0,65535));
ledcWrite(LeftPitchServo_PWM, map(constrain(LeftPitchServo_ZERO - out3,LeftPitchServo_ZERO-600,LeftPitchServo_ZERO+1000),0,PitchServo_Int,0,65535));
ledcWrite(RightPitchServo_PWM, map(constrain(RightPitchServo_ZERO + out4,RightPitchServo_ZERO-1000,RightPitchServo_ZERO+600),0,PitchServo_Int,0,65535));
ledcWrite(UpperRightServo_PWM, map(UpperRightServo_ZERO - out5,0,MainServo_Int,0,65535));
ledcWrite(LowerRightServo_PWM, map(LowerRightServo_ZERO + out6,0,MainServo_Int,0,65535));
}
This is for Tempest’s firmware, but Khrull’s should have something similar. Under the SR6 specific code, you can see I placed a “-” next to the roll’s map function. I’m sure doing the same if you’re using an OSR2 might fix it for you.