# Velocity limits

**URL:** https://community.simplefoc.com/t/velocity-limits/4433
**Category:** Uncategorized
**Created:** [February 9, 2024, 2:17pm UTC](https://community.simplefoc.com/t/velocity-limits/4433 "2024-02-09T14:17:42Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![DarkMajster](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@DarkMajster](https://community.simplefoc.com/u/DarkMajster)
#### Post date: [February 9, 2024, 2:17pm UTC](https://community.simplefoc.com/t/velocity-limits/4433/1 "2024-02-09T14:17:42Z")

</div>

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 😉

what else can i try?

 ![image](https://community.simplefoc.com/uploads/default/original/2X/1/1dd0a461bc89bd69e464efbf0c0e690aa79cbd98.png)

---

<div class="post-metadata">

### Author: ![Candas1](https://community.simplefoc.com/user_avatar/community.simplefoc.com/candas1/32/5296_2.png) [@Candas1](https://community.simplefoc.com/u/Candas1)
#### Post date: [February 9, 2024, 2:28pm UTC](https://community.simplefoc.com/t/velocity-limits/4433/2 "2024-02-09T14:28:46Z")

</div>

Hi,

Have you checked all the other threads about this topic ?  
Here is [one](https://community.simplefoc.com/t/speed-limited-to-400-rad-s-with-low-resistance-high-k-motors/4314) of the recent threads.

---

<div class="post-metadata">

### Author: ![DarkMajster](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@DarkMajster](https://community.simplefoc.com/u/DarkMajster)
#### Post date: [February 9, 2024, 2:38pm UTC](https://community.simplefoc.com/t/velocity-limits/4433/3 "2024-02-09T14:38:11Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Candas1](https://community.simplefoc.com/user_avatar/community.simplefoc.com/candas1/32/5296_2.png) [@Candas1](https://community.simplefoc.com/u/Candas1)
#### Post date: [February 9, 2024, 3:08pm UTC](https://community.simplefoc.com/t/velocity-limits/4433/4 "2024-02-09T15:08:06Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![DarkMajster](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/d/47e85d/32.png) [@DarkMajster](https://community.simplefoc.com/u/DarkMajster)
#### Post date: [February 9, 2024, 4:46pm UTC](https://community.simplefoc.com/t/velocity-limits/4433/5 "2024-02-09T16:46:40Z")

</div>

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

---

<div class="post-metadata">

### Author: ![Candas1](https://community.simplefoc.com/user_avatar/community.simplefoc.com/candas1/32/5296_2.png) [@Candas1](https://community.simplefoc.com/u/Candas1)
#### Post date: [February 9, 2024, 5:01pm UTC](https://community.simplefoc.com/t/velocity-limits/4433/6 "2024-02-09T17:01:19Z")

</div>

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](https://docs.simplefoc.com/foc_theory#which-one-should-i-use) usually helps

You should use torque mode when you start with foc:

> motor.controller = MotionControlType::torque;
