Increase torque in position motion control


I am currently trying to play with angle position of a motor that seems to work pretty well. The only problem I have is that the torque (current drawn) is not big enough and I would like to increase it by still being in the same control mode type.
I am applying a 12V to the driver and the phase resistance of my motor is around 11.4Ohms that would theoretically mean that I can draw a bit more than 1A and the power supply only shows that it draws 0.6A.

Is there a way to force the torque and then the current to increase ? I guess it should since I use the FOC torque control.

Thank you for your help.

Here is my code:

BLDCMotor motor_M4 = BLDCMotor(7);
MagneticSensorI2C sensor_M4 = MagneticSensorI2C(AS5048_I2C_M4);
InlineCurrentSense current_sense_M4 = InlineCurrentSense(0.01, 50, M4_CURRENT_I1, M4_CURRENT_I2); // Not measuring C // Adapted for NUCLEO
BLDCDriver3PWM driver_M4 = BLDCDriver3PWM(M4_IN1, M4_IN2, M4_IN3); // A-B-C
void doTarget_M4(char* cmd) {command.scalar(&target_M4, cmd);}

void setup() {
// put your setup code here, to run once:
Serial_MCU2.println(“Init Motor 4”);
sensor_M4.init(&myWire2); // initialize magnetic sensor hardware
motor_M4.linkSensor(&sensor_M4); // link the motor to the sensor
driver_M4.voltage_power_supply = 12;
driver_M4.init(); // link the motor and the driver
motor_M4.linkDriver(&driver_M4); // link the motor and the driver
motor_M4.foc_modulation = FOCModulationType::SinePWM;
// set torque mode:
motor_M4.torque_controller = TorqueControlType::foc_current;
motor_M4.controller = MotionControlType::angle;
motor_M4.motion_downsample = 0.0;
current_sense_M4.init(); // current sense init and linking
current_sense_M4.gain_b *= -1;
command.add(‘T’, doTarget_M4, “Target M4”);
Serial_MCU2.println(“Init M4 Done !”);

void loop() {
// put your main code here, to run repeatedly:
motor_M4.loopFOC(); // the faster you run this function the better
motor_M4.move(target_M4); // this function can be run at much lower frequency than loopFOC() function;


Double check what the motor.current_limit is set to. Ultimately you’ll be limited by the supply voltage and motor resistance as you noted. Also, the DC current drawn by the board will usually be less than the Iq current of motor - the driver and motor act as a buck converter, so Iq may be higher than the DC current from the power supply in most cases.

1 Like


Thank you. I have checked it and I actually set it in another function so this should work. The question is:
Is there a way to increase the torque by software or is it always the highest one ?


Hey @jimmyBb,

Check here: Setting current limits in main loop - #2 by Antun_Skuric

If you are in a mode such as velocity or angle mode, following the above will limit the max Iq current, and thus limit the torque.