Hello,
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
current_sense_M4.linkDriver(&driver_M4);
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;
set_MotorParameters(&motor_M4);
current_sense_M4.init(); // current sense init and linking
motor_M4.linkCurrentSense(¤t_sense_M4);
current_sense_M4.gain_b *= -1;
motor_M4.init();
motor_M4.initFOC();
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
command.run();
}
Best,
Jimmy