X Y contemplation and, hopefully, feedback

I got a MPU 6050 connected to a RPi. The RPi reads the MPU 6050 does some math and sends DC servo torque data to a Arduino Mega. The Arduino Mega, sends formatted torque info to X and Y DC servos to keep a platform 'level' The system works fairly well.

That thing I been looking at to 'fix' is that the DC servos do not handle degree increments of less than 1 degree.

I been toying with the idea of using a dc motor geared to 2 or 3 degrees per min to see if I can bring the X Y platform down to .2 of a degree or less off level. Perhaps, I'll only get .5 degree off level but I'll not know till I give it a try.

Is there a way to cause the DC Servos to move in increments of less than 1 degree?

I am, also, open to suggestions about what would be a good DC motor controller to use with the Arduino Mega that would be home hobbyist suitable for such a project?

the DC servos do not handle degree increments of less than 1 degree.

Consider replacing the servos you have with better ones, that offer higher resolution.

That thing I been looking at to 'fix' is that the DC servos do not handle degree increments of less than 1 degree.

Most do, you control it with the writeMicroseconds function of the servo libiary.

According to Servo.h the pulse width is between 544 and 2400 µs. I do not fully understand Servo.cpp, but I think that a 2 MHz base frequency is used and a pulse every 20 ms.
Then a 16-bit timer uses 40000 counts for 20ms and the period between 544 and 2400 µs has 3712 counts. With 180 degrees full scale that is 0.05° accurate.

I'm not sure if my calculations are okay :confused:
If they are okay, that is more than the integer accuracy for the degrees of the Arduino function.
However, I can not find a library that uses this.

I suppose that the Servo.writeMicroseconds() will calculate the best Timer value for the pulse in microseconds. That calculation rounds to the nearest timer value. The 544 to 2400 µs are a span of 1856 µs, that is 0.1° accurate. Perhaps 0.15° due to calculation rounding.

It seems that for now you should try the Servo.writeMicroseconds().

I will most certainty give Servo.writeMicroseconds() a try. Thanks.

Idahowalker:
the DC servos do not handle degree increments of less than 1 degree.

Are you sure there is not an error at some place in your code which is unintentionally truncating to 1 degree?

I been using servo.write() which I was under the impression took, as an argument, an int representing a whole number degree.

I changed my X servo to use servo.writeMicroseconds(). After doing a few relational math tweaks, on the Raspberry Pi side, I got the X Gyro bouncing around 0 degrees, with the X servo being tweaked by servo.writeMicroseconds(). I am really liking this change.

I'll watch, for a day or two, the results, perhaps a refinement here and there, before applying the change to the Y servo.

I've yet to determine the +/- mean X Gyro bounce around zero; that will take a bit of time.

Thanks for the heads up on servo.writeMicroseconds().