Encoder Motor RPM Restrcition

Hello everyone,

With regards to the Encoder Motor it is restricted to a specific RPM but if I use another motor with a faster RPM it restricts it to the Encoder Motor RPM not that specific motor RPM. Is there any solution to this?

Thank you in advance!

Hi @Noah_Kemp, you’ll have to modify this file which is located in this folder: /usr/lib/python3/dist-packages/pitop/pma

These are the lines you want to change:

MMK_STANDARD_GEAR_RATIO = 41.8
MAX_DC_MOTOR_RPM = 4800

Bear in mind that MAX_DC_MOTOR_RPM should be lower (rule of thumb: 80%) of the theoretical maximum of the DC motor if it has a gear box attached to it to account for losses - this is only important if you want to ensure two or more motors peak at max without one being torque limited at a higher value than another (so they are synchronised).

In future we might make this configurable, but for now you can either edit the file directly or create a copy of it for your own motor (so you still have one to use for pi-top motors)

Hi, @duwudiPreformatted text Thanks for the advice. We are using a different motor that is compatible with the Pitop, therefore a higher rpm is not a problem for the gearbox. When I run, encoder_motor.py my edited version, it gives me the error -
ModuleNotFoundError: No module named ‘main.parameters’, ‘main’ is not a package.

How can I fix this or is it possible to ignore the “permission denied”, therefore I can change the original?

@Noah_Kemp you can edit the file by typing:

sudo nano /usr/lib/python3/dist-packages/pitop/pma/encoder_motor.py

in a terminal. You shouldn’t be running the file directly, go to further.pi-top.com to learn how to write python code that runs the motor.

We are using a different motor that is compatible with the Pitop, therefore a higher rpm is not a problem for the gearbox.

Not sure I understand what you mean here.