Hi All,
I just managed to get my simple foc project to work. However my motor speed seems to be limited, topping out at about 20rad/s. As I raise the velocity limit above this level, the speed doesn’t increase further. I have upped the velocity limit to 800rad/s in the below code and no change. Top speed does not change when I up the amperage or change to velocity mode (below code is in angle mode). How do you think I can turn up the speed? I am using an arduino nano clone and an as5600 as the sensor. Would this be the issue?
Below is my code for your reference.
Appreciate any help regarding this!
#include <SimpleFOC.h>
MagneticSensorI2C sensor = MagneticSensorI2C(AS5600_I2C);
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 10, 11, 8); //tried this last
BLDCMotor motor = BLDCMotor(7, 0.4);
void setup() {
Serial.begin(115200);
motor.useMonitoring(Serial);
sensor.init();
motor.linkSensor(&sensor);
driver.voltage_power_supply = 21;
driver.init();
motor.linkDriver(&driver);
motor.controller = MotionControlType::angle;
motor.PID_velocity.P = 0.2;
motor.PID_velocity.I = 20;
motor.PID_velocity.D = 0.001;
motor.PID_velocity.output_ramp = 1000;
motor.LPF_velocity.Tf = 0.01;
motor.P_angle.P = 40;
motor.P_angle.I = 0; // usually only P controller is enough
motor.P_angle.D = .001; // usually only P controller is enough
motor.P_angle.output_ramp = 10000; // default 1e6 rad/s^2
motor.LPF_angle.Tf = 0.01; // default 0
motor.current_limit = 5; // Amps
motor.velocity_limit = 800;
motor.init();
motor.initFOC();
_delay(1000);
}
void loop() {
motor.loopFOC();
motor.move(100);
motor.monitor();
}
Thanks,
Amit