Open yoursunny opened 5 years ago
The last test result was incorrect due to bug #4. I retested on the real unit with the following code:
def measureTiming(port):
"""
Measure rotation timing of a turntable and print as TSV.
"""
for n in range(0, 1800, 30):
turntable = Turntable(port)
if not turntable.zero():
raise RuntimeError("zero command failed")
t0 = time.time()
ok = turntable.rotateBy(n)
t1 = time.time()
if not ok:
raise RuntimeError("rotateTo command failed")
print("%d\t%0.2f" % (n, t1-t0))
turntable.close()
The results are:
rotateBy | duration(seconds) |
---|---|
0 | 0.10 |
30 | 6.23 |
60 | 7.42 |
90 | 8.48 |
120 | 9.50 |
150 | 10.51 |
180 | 11.51 |
210 | 12.51 |
240 | 13.52 |
270 | 14.47 |
300 | 15.48 |
330 | 16.48 |
360 | 17.48 |
390 | 18.48 |
420 | 19.48 |
450 | 20.48 |
480 | 21.48 |
510 | 22.48 |
540 | 23.45 |
570 | 24.45 |
600 | 25.45 |
630 | 26.46 |
660 | 27.45 |
690 | 28.46 |
720 | 29.46 |
750 | 30.46 |
780 | 31.46 |
810 | 32.46 |
840 | 33.47 |
870 | 34.47 |
My test indicates that the display is consistent with LCD display, but the actual motor/turntable is very inaccurate. In fact, rotateTo(oldPosition)
does not actually go to the old position. This is probably a hardware issue.
I measured timing of StepperFast.ino.
This test was performed on a Sintro Uno R3 unit, not connected to any motor etc. The command sequence is: "E", "Z", "Tn", and I measure how soon does
-
appear after sending the T command.Test results:
I was expecting the duration to increase from 0 to 180 and decrease from 180 to 359. It's surprising that there are only two duration values and the gap suspiciously falls between 255 and 256, the overflow point of
uint8_t
type.The program for this test is: