-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add motor calibration feature. #343
Comments
Currently, the MINDSTORMS App does not recognize Large Angular Motors (either SPIKE white/blue or Technic grey) as motors that support calibration. |
Here is a capture of the calibration procedure from the MINDSTORMS software. The motor is "reset" by stopping UART comms, then it is allowed to come up at 2400 baud rather than doing the initial 115200 baud setting. Then the baud rate is changed to 4800 baud. The the interesting stuff happens at 4800 baud. After the last write at 4800 baud, the hub switches back to 2400 baud but it takes the motor a while to reset again. The attached data just contains the messages during the 4800 baud portion. I haven't really looked at it yet, so if someone wants to have some fun decoding the write messages, go for it. Mode 4 is the CALIB mode. According to info reported by the sensor the DATA messages in this mode are supposed to be 2 16-bit integers. After a a certain WRITE command though the DATA changes to a 32-byte payload. |
It looks like it goes something like this:
Finally, stop sending NACKs to allow motor to resync at higher baud rate. |
So there appear to be 5 different "commands"
Reading and writing DATA probably reads/writes starting at the address specified in the 0x02 command. |
Same CSV with additional columns for DATA messages: |
Is your feature request related to a problem? Please describe.
Some LEGO Powered Up motors need to have the zero position calibrated. The LEGO MINDSTORMS app can do this, but other apps for other hubs don't have this feature yet.
Describe the solution you'd like
It would be nice if we had a script that we could copy and paste into Pybricks Code to to the calibration.
Describe alternatives you've considered
For people with a MINDSTORMS or SPIKE hub, they can just use the MINDSTORMS app.
Additional context
Related thread: #334 (comment)
The text was updated successfully, but these errors were encountered: