How can i clamp current_cmd to avoid current_limit_violation

would setting the torque limit clamp the commanded current? if so how do i determine the torque limit? I am thinking of the following options and would appreciate the help.

option 1: Based on the motor max torque I would set the torque_limit to 8 N.m, which really means that the current limit is 1908/8.27 = 183.8A (T=8.27Current / KV). Which contradicts with the max current of 85 Ams given by the manufacturer.

option 2: Based on the motor max current I would the torque limit to 3.7N.m, which is based on T=8.27*current/KV. This contradicts with the max torque of 8N.m given by the manufacturer

I am using flipsky 6374190KV BLDC motor (link below), the specs are the following:

  • Max Current: 85 Amps
  • Max Volts: 12S
  • Max Torque: 8Nm
  • Motor Resistance: 0.05Ohm
  • The number of pole: 14

What am i missing in here?

Yes, and torque_constant is the ratio.

Or you can just set current_limit and increase current_limit_threshold

Hobby motor datasheets are nonsense. Just don’t catch the thing on fire.