Velocity limits

Hello, i have problems with reaching velocities over some limit (about 34 rad/s), my motor’s KV is 180 and i’m running it with 24V power supply, so it shouldn’t be problem to get higher speed.

I tried to change resistance and KV in software over and below it’s actuall value, but it didn’t change anything, i don’t reach current limit. Also I noticed that q voltage is growing rapidly while crossing the limit (34 rad) i don’t know it is actually cause or effect :wink:

what else can i try?


Have you checked all the other threads about this topic ?
Here is one of the recent threads.

Yes, people most often have problems with frequency of loop, but that is not my case

Those threads mention much more than just the loop frequency.
Also from your first post it’s unclear what Motion control type, what Torque control type, what modulation type, what sensor you are using.

You’re right :
motor.torque_controller = TorqueControlType::foc_current;
motor.controller = MotionControlType::angle;
motor.foc_modulation = FOCModulationType::SinePWM;

but I also tried MotionControlType velocity and torque, foc_modulation SpaceVectorPWM

i’m measuring currents on shunt resistor and STSPIN32G4’s ADC, position using encoder, which handles much bigger velocities

With foc_current, setting phase_resistance or KV won’t have any effect.
No lag compensation needed as foc_current d axis PI takes care of it, so no effect when setting phase_inductance neither.

The q voltage going up and staying flat looks like a run away happening with low side current sensing when the duty cycle is too high for proper phase current sampling. If it’s the case, you should propably limit the driver voltage:

driver.voltage_limit = driver.voltage_power_supply * 0.95f;

SpaceVectorPWM usually helps

You should use torque mode when you start with foc:

motor.controller = MotionControlType::torque;