# Inline current sensing and velocity measurments don't match reality

**URL:** https://community.simplefoc.com/t/inline-current-sensing-and-velocity-measurments-dont-match-reality/8028
**Category:** hardware support
**Tags:** esp32
**Created:** [March 14, 2026, 9:34pm UTC](https://community.simplefoc.com/t/inline-current-sensing-and-velocity-measurments-dont-match-reality/8028 "2026-03-14T21:34:28Z")
**Posts on this page:** 1
**Showing post:** 3

<div class="post-metadata">

### Author: ![OiD-W](https://community.simplefoc.com/user_avatar/community.simplefoc.com/oid-w/32/5431_2.png) [@OiD-W](https://community.simplefoc.com/u/OiD-W)
#### Post date: [March 17, 2026, 2:04pm UTC](https://community.simplefoc.com/t/inline-current-sensing-and-velocity-measurments-dont-match-reality/8028/3 "2026-03-17T14:04:30Z")

</div>

Just for a sanity check I tested the current sense separately with the following code:

```auto
void loop() {
  //Shunt is 0.01R and gain is 50. 1A=0.01V=>0.5V/A
  //3.3V/50=0.066=6.6A=> +-3.3A
  //0A average is 1910, offset=137
  Serial.print(map(analogRead(34)+137,0,4095,-3300,3300));
  Serial.print("\t");
  Serial.print(map(analogRead(35)+137,0,4095,-3300,3300));
  Serial.print("\t");
  Serial.print(map(analogRead(36)+137,0,4095,-3300,3300));
  Serial.print("\t");
  Serial.println(map(analogRead(39)+137,0,4095,-3300,3300));
  delay(250);
}

```

Perfect measurements on all 4 channels.

 ![image1](https://community.simplefoc.com/uploads/default/original/2X/7/793257c3f86067e865b34a6394eed04e77b58989.png)

I’ve also taken note of suggestions 2 and 3 from Runger’s comment;

> [@Motor stuttering at low and high speed with openloop](https://community.simplefoc.com/t/motor-stuttering-at-low-and-high-speed-with-openloop/6514/2):
>
> Hey @MORDRET_Pierre-Yves, Welcome to SimpleFOC! A few points I note: The motors you link, in my experience, have around 5-10ohm phase resistance. Not 100mOhm like you write. Did you measure them? But in your sample code you’re not using the resistance value, so it should not matter. You’re using the same voltage limit on motor and driver, which will lead to a lot of overmodulation. Please try with motor.voltage\_limit = driver.voltage\_limit/2.0f; Please remove the KV value from the mo…

Everything works separately, driver, encoder, current sense…

---

_[View the full topic](https://community.simplefoc.com/t/inline-current-sensing-and-velocity-measurments-dont-match-reality/8028)._
