Open PSLLSP opened 5 years ago
Hi I'm Ben from Meet Edison
Ed.ReadDistance() and Ed.SetDistance() using CM and INCH is a bug and it is already on our backlog of bugs.
Yes the distance Edison travels changes with speed because Edison is a real object and does not stop immediately when the motors turn off. The faster you go the greater this error becomes, there is some allowance in the software for this but it is not going to be perfect for all Edisons in all conditions
Additionally, this repository is not the best place to report bugs and issues. We do not continuously monitor this repository. For future bugs and issues, please send them directly to us, via our contact form: https://meetedison.com/edison-robot-support/contact-us/
Functions Ed.ReadDistance() and Ed.SetDistance() should work with "ticks" as it is described in the documentation (https://meetedison.com/content/EdPy-app-documentation-guide.pdf).
Current implementation in EdPy converts ticks to CM or INCH. What conversion is used depends on value of Ed.DistanceUnits. Please, don't do conversion!
Other idea. What about extending Ed.DistanceUnits with value "TICK"? This will allow to work with motors at low level, with ticks. To pass TICKS as parameter to function Drive(), DriveLeftMotor(), etc
Documentation defines that one tick is 1.25mm. That is nice theory. In practice, there is no easy relation between distance and ticks, 1.25 is just an approximation (and that value is wrong from my point of view).
Some real data, relation between ticks and distance passed by robot at speed SPEED_5: 20 ticks => 44mm => 1 tick ~ 2.200 mm 40 ticks => 66mm => 1 tick ~1.650 mm 60 ticks => 94mm => 1 tick ~ 1.567 mm 80 ticks => 114mm => 1 tick ~ 1.425 mm
Distance depends on motor speed: 60 ticks @ SPEED_1 => 84mm => 1 tick ~ 1.400 mm 60 ticks @ SPEED_5 => 93mm => 1 tick ~ 1.550 mm 60 ticks @ SPEED_10 => 105mm => 1 tick ~ 1.750 mm
It is probably problem of driver in firmware, how it controls motor and measures distance. Other problem is that when motor receives stop command, it still passes few millimeters before it really stops, when motor runs faster it needs longer distance to stop. In my simple test I measured value of 1 tick between 1.400 mm and 2.200 mm... This is more than value in documentation that is 1.25mm
This is a demo program I used to measure relation between distance and ticks:
I have found these problems when I tried to drive Edison through a grid maze and I found that motor accuracy is a serious problem for Edison. Other toy robots on the market can handle grid maze much better, for example robot Botley or Code&Go Mouse.