Closed laurensvalk closed 7 years ago
Same experiment with medium motor at 10%:
lms2012-compat: 1207 degrees after 10 seconds (20 rpm)
EV3 : 1687 degrees after 10 seconds (28 rpm)
There is going to be some difference between lens and ev3dev drivers and the concept of % speed
Sure, but that's not what's happening here :)
For reference, these are conversion factors between the LEGO FW speed (%) values and rotations per minute (rpm).
They are different for the Large and Medium motor.
These values don't actually appear in the source code but they are found experimentally. (And equivalent lms2012-compat code would eventually result in the same values.)
FYI, the most important version numbers are the output uname -r
and dpkg -s lms2012-compat | grep Version
. It won't always be clear from the SD card image version what is actually being used. If you ever upgrade a package, the image version becomes meaningless.
Ok, I'll report those too. For the issues reported so far, you may assume a clean image (with given image number) with no updates.
I think I have this close enough.
motor | official firmware | lms2012-compat |
---|---|---|
large | 17.6 RPM | 18.4 RPM |
medium | 28.3 RPM | 27.3 RPM |
It turns out that there were some bad assumptions on my part and some inconsistencies in the official firmware that were throwing off my math.
Thanks for the test programs. They were quite useful. I've attached an updated version that prints the calculated RPM on the screen at the end of the program. (just delete .zip
from the file name)
Ok. I came across this when my existing programs performed visually differently (robot walked much more slowly) than with the official FW. I'll resume testing with your updates.
I'm going to leave this open so that I remember to leave a note when I do a kernel release with this fix.
FWIW, I have also verified that the unregulated motor block works as expected, meaning that the the same power in EV3-G results in the same duty cycle output on both the official firmware and lms2012-compat. 0 = 0% duty cycle, 1 = 20% duty cycle 100 = 100% duty cycle and everything else in between is scaled linearly. duty_cycle = (80 * power + 1900) / 99
Wow, that's pretty crazy :+1:
I'll be using that block extensively in my next test (next week), running this.
Fix has been released in kernel 4.9.4-ev3dev-bpo-stretch-r4-ev3-lms2012
Motors run slower on lms2012-compat, see comment in screenshot:
A motor is commanded to run for 10 seconds at 10% speed, and the final amount of degrees is displayed on the screen. The results differ for lms2012-compat compared to standard firmware.
Test code: https://github.com/laurensvalk/lms2012-compat-demo --> speedtest