I am sorry to ask an old and common issue.
I built a control board with arduino nano +PCA9685Servodriver just like as old Opencat schematic.
Writeinstinct was successfully uploaded and type "c" in the serial monitor window.
Servo(MG90s) looked like responded with "C" command and moved to the calibration pos.
However new pos. is different from neutral position that I set using servo checker prior to the calibration.
I also checked signal length of every output channel of PCA9685 using oscilloscope.
result are following.
If calibration state set every servo to middle position of working angle, signal should be around 1.5(x1/1000sec) as long as using the servo for RC.
I am wondering whether my understanding for the calibration state is simply wrong or something wrong in the hardware or configuration of software.
Your kind advise or comment are very much appreciated
ch0 2.0 (x1/1000sec) ※value is not so accurate but looks "min" or "max" apparently not "middle"
ch1 0.9
ch2 2.2
ch3 0.8
ch8 2.2
ch9 1.9
ch10 2.2
ch11 2.2
ch12 1.7
ch13 0.8
ch14 1.0
ch15 2.2
Good catch. In OpenCat.h:
#ifdef BITTLE int8_t middleShifts[] = {0, 15, 0, 0, -45, -45, -45, -45, 45, 45, -45, -45, -75, -75, -75, -75 }; #else int8_t middleShifts[] = {0, 15, 0, 0, -45, -45, -45, -45, 0, 0, 0, 0, 0, 0, 0, 0 }; #endif
And there are some clipping of the reachable range, to ensure that the angles can always be reached regardless of the variation of production precision of servos. And for the robot, the range is not supposed to be symmetric about the calibration zero location due to the collision between the leg and body.
There's some rescaling and calibration algorithm in the code before sending the neutral position to the servos. That's why the middle point of your servo checker is inconsistent with the calibrated signal.