Motor rpm and torque values

When programming, I noticed motors only take in values in the range of 1 to 127. How are rpm and torque values affected as I change this value? Can I calculate rpm and torque values by just using that value you put into the code? Thank you in advance.

Take a look at

So what I’ve read on the second link, as speed (rpm) goes up, torque (in-lbs) goes down, and vice versa. As speed (rpm) goes up, current (amps) goes up, and vise versa. As toque (in-lbs) goes up, current (amps) goes up, and vise versa. However, I still don’t get what power or efficiency is referring to and how the values 1 to 127 have to relate to any of this.

Generally speaking, I don’t think there is any way to do this in advance of building your mechanism and doing a lot of testing and time motion study with it. So much depends on the type of mechanism you are powering with the motor, what sort of gear ratios you might be using, how much friction there is, how much weight you are lifting, whether or not you are using elastics to assist the lift, and even the charge level of the battery and other electrical loads the battery might have on it at that moment, etc. Even for a motor that is free-wheeling (one that has no load on it), the speed vs. commanded motor value is very non-linear: for example, it makes only a little difference if you command the motor to run at 110 vs 127.

You might be able to do something fancy to control speed by incorporating an encoder and using a feedback loop to monitor a motor’s speed and adjust the motor commands (0-127) so you maintain a certain speed, but such a system would be limited to a certain range of performance.