# SimpleFOC Drive v1.3 + BLDC 5010 360KV + STM32 Blackpill

**URL:** https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334
**Category:** hardware support
**Created:** [September 16, 2026, 3:17pm UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334 "2026-09-16T15:17:03Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![nomtix](https://community.simplefoc.com/user_avatar/community.simplefoc.com/nomtix/32/10100_2.png) [@nomtix](https://community.simplefoc.com/u/nomtix)
#### Post date: [September 16, 2026, 3:17pm UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/1 "2026-09-16T15:17:03Z")

</div>

Hello everyone,

For a few days now, I’ve been trying to successfully start closed-loop control on my SimpleFOC Drive v1.3. I initially tried with an Arduino Uno, and now I’ve migrated to an STM32 Blackpill (F411CE), but I am hitting the exact same problem on both MCUs.

**My Hardware Setup:**

- **MCU:** STM32 Blackpill (STM32F411CE) / previously Arduino Uno

- **Driver:** SimpleFOC Drive v1.3

- **Motor:** 5010 360KV (14 magnets, 12 coils → exactly 7 pole pairs)

- **Encoder:** AS5600 via I2C

- **Power:** 4S Li-Ion pack (16.8V)

 ![097b90c7a3d9ef03606c1c9e3967af730a86bf55_2_1035x690](https://community.simplefoc.com/uploads/default/original/2X/7/7e07a9adca75cc58adc80426b35f518af5f4756f.jpeg)

**The Problem:** When running in closed-loop velocity control, the motor moves smoothly during the calibration sequence (a little left, then right). However, right after that, the pole pair check fails (estimating ~14 or 6 instead of 7), and the motor either starts shaking aggressively or locks completely in place (the shaft becomes rigid).

This happens whether current sensing is enabled or disabled. Here is the output from the Serial Monitor when running without current sensing:

```auto
MOT:Enable driver.
MOT:Align sensor.
MOT:sensor dir: CW
WARN-MOT:PP check: fail - est. pp: 14.12
Skip dir calib.
MOT:Zero elec. angle: 0.48
ERR-MOT:No current sense.
MOT:Ready.

```

Here is the exact code I

am currently testing (stripped down to just voltage/velocity mode to isolate the issue):

```auto
#include <Arduino.h>
#include <SimpleFOC.h>
#include <Wire.h>

MagneticSensorI2C sensor = MagneticSensorI2C(AS5600_I2C);
// My motor definitely has 7 pole pairs
BLDCMotor motor = BLDCMotor(7);
BLDCDriver3PWM driver = BLDCDriver3PWM(PA8, PA9, PA10, PB12);
Commander command = Commander(Serial);

void doTarget(char* cmd) { command.scalar(&motor.target, cmd); }

void setup() {
  Serial.begin(115200);
  while (!Serial) {}
  Wire.setClock(400000);
  
  sensor.init();
  motor.linkSensor(&sensor);
  
  driver.voltage_power_supply = 16.8;
  driver.init();
  motor.linkDriver(&driver);
  
  // Safe voltage limits for a low-resistance 360KV motor
  motor.voltage_sensor_align = 1.0;
  motor.voltage_limit = 2.0;
  
  // Closed loop, voltage-based velocity control
  motor.controller = MotionControlType::velocity;
  motor.torque_controller = TorqueControlType::voltage;
  
  // Gentle PI tuning for velocity
  motor.PID_velocity.P = 0.1;
  motor.PID_velocity.I = 1.0;
  motor.LPF_velocity.Tf = 0.02;
  
  motor.useMonitoring(Serial);
  motor.init();
  motor.initFOC();
  
  command.add('T', doTarget, "Target velocity (rad/s)");
  motor.target = 0.0;
}

void loop() {
  motor.loopFOC();
  motor.move();
  command.run();
}

```

Does anyone know why the PP check calculates ~14 instead of 7, and why the motor locks up right after a seemingly smooth alignment? Any guidance or tips on what I might be doing wrong would be greatly appreciated! The motor runs smoothly in open loop velocity control.

---

<div class="post-metadata">

### Author: ![Antun\_Skuric](https://community.simplefoc.com/user_avatar/community.simplefoc.com/antun_skuric/32/21_2.png) [@Antun\_Skuric](https://community.simplefoc.com/u/Antun_Skuric)
#### Post date: [September 16, 2026, 3:54pm UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/2 "2026-09-16T15:54:57Z")

</div>

Did you try torque control?

Does the motor still lock up if you change from velocity to torque?  
Also I assume you tried sending some velocity commands right? Because at the moment the target is set to 0 :).

On the open loop mode, if you set 6.28 as target do you get exactly one rotation per second?

The pp check is optional and if it fails everything still runs. You can also try lowering the voltage\_sensor\_align to 1 v or under to reduce the current.

And also, did you try to test only the sensor, is it working well?  
We had issues with magnets before, this might maybe be one of these.

---

<div class="post-metadata">

### Author: ![nomtix](https://community.simplefoc.com/user_avatar/community.simplefoc.com/nomtix/32/10100_2.png) [@nomtix](https://community.simplefoc.com/u/nomtix)
#### Post date: [September 16, 2026, 4:22pm UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/3 "2026-09-16T16:22:52Z")

</div>

Hey, thanks for the quick reply!

- Yeah, I tried `MotionControlType::torque` (with voltage). I used the Commander to send targets like T1 and T2. As soon as I input anything \> 0, the motor immediately locks up rigid (like a holding electromagnet) or starts vibrating aggressively. My battery’s BMS even tripped once because of the massive current spike.

- Open loop _did_ work perfectly smoothly when I tested this exact setup on an Arduino Uno earlier, BUT it only worked when I downgraded the SimpleFOC library to **v2.0.0**. On the newest version (both on the Uno and now on the STM32), open loop just sits there with a slight resistance and doesn’t spin at all.

- I played around with `voltage_sensor_align`. 0.5V is too weak and just skips steps/beeps (it’s a low resistance drone motor). At 1.0V to 3.0V, the left/right alignment sequence actually looks totally smooth, but the PP check still spits out either 6 or 11 instead of 7.

- I am using the standard magnet that came with the AS5600, mounted to the motor shaft with a custom 3D printed part, so it’s most likely perfectly centered. To be sure, I just ran a standalone test just reading `sensor.update()`. The values are super smooth. I even marked the shaft, rotated it exactly 360 degrees by hand, and the output changed by around 6.25 everytime.

---

<div class="post-metadata">

### Author: ![nomtix](https://community.simplefoc.com/user_avatar/community.simplefoc.com/nomtix/32/10100_2.png) [@nomtix](https://community.simplefoc.com/u/nomtix)
#### Post date: [September 16, 2026, 8:39pm UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/4 "2026-09-16T20:39:43Z")

</div>

I also made an interesting observation with my arduino and osciloscope. On version 2.4.0 of simple foc there is abosolutely no PWM, the only thing thats coming out of the board is the enable signal. When I change to 2.0.0 open loop works perfectly and the PWM signals are there. Its the same with stm

---

<div class="post-metadata">

### Author: ![o\_lampe](https://community.simplefoc.com/letter_avatar_proxy/v4/letter/o/85e7bf/32.png) [@o\_lampe](https://community.simplefoc.com/u/o_lampe)
#### Post date: [September 17, 2026, 6:58am UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/5 "2026-09-17T06:58:55Z")

</div>

According to your PCB solder bridges the PWM pins are (6,10,5,8) = (A,B,C,EN)  
Does that match the Blackpill pins you are using : BLDCDriver3PWM(PA8, PA9, PA10, PB12)  
And what about the I2C pullups? I don’t see them soldered, although you mentioned it works.

---

<div class="post-metadata">

### Author: ![nomtix](https://community.simplefoc.com/user_avatar/community.simplefoc.com/nomtix/32/10100_2.png) [@nomtix](https://community.simplefoc.com/u/nomtix)
#### Post date: [September 17, 2026, 8:25am UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/6 "2026-09-17T08:25:42Z")

</div>

The PCB is just the example of the board i have. I changed 0 ohm resistor and as I said in older version it works in open loop (2.0.0) and in the new one it spins during calibration and then stops or starts shaking. I didnt solder pullups because I use A4 and A5 pins on arduino for SDA SCL (B6 B7 on stm).

---

<div class="post-metadata">

### Author: ![Antun\_Skuric](https://community.simplefoc.com/user_avatar/community.simplefoc.com/antun_skuric/32/21_2.png) [@Antun\_Skuric](https://community.simplefoc.com/u/Antun_Skuric)
#### Post date: [September 17, 2026, 8:54am UTC](https://community.simplefoc.com/t/simplefoc-drive-v1-3-bldc-5010-360kv-stm32-blackpill/8334/7 "2026-09-17T08:54:06Z")

</div>

In the library Verizon v2.4.0+ you need motor  
loopFOC() call in the `loop`. Do you have it in your code?

I forgot to update it oint he Library examples. But the docs are up to date. 🙂

In the open loop, when you are in velocity mode, does the target 6.28 result in once per second rotation of the motor?
