Smooth rotation possible with velocity_openloop?

Hi there,

i am starting with simplefoc and try to understand why i cannot make a smooth rotation possible with velocity_openloop. I have an esp32, a simplefoc mini and a small brushless gimbal motor.

currently i have only the motor connected, ignoring the encoder.
what i try to achieve is a simple smooth rotation of the motor. so i followed this example:

https ://docs.simplefoc.com/ velocity_openloop
this is what i have made from it:
```

#include <Arduino.h>
#include <SimpleFOC.h>
#include “Config.h”

BLDCMotor motor(MOTOR_POLE_PAIRS);
// ACHTUNG: Phasenreihenfolge A,B,C beibehalten
BLDCDriver3PWM driver(MOTOR_PIN_A, MOTOR_PIN_C, MOTOR_PIN_B, MOTOR_ENABLE);

const float targetVel = 5.0f; // rad/s open-loop
const float vLimit = 1.0f; // V (unter 4V bleiben)
const float dirSign = 1.0f; // bei Bedarf auf -1.0f flippen

void setup()
{
Serial.begin(SERIAL_BAUD_RATE);
delay(200);
driver.voltage_power_supply = DRIVER_VOLTAGE_SUPPLY;
driver.voltage_limit = min(DRIVER_VOLTAGE_LIMIT, vLimit);
driver.pwm_frequency = DRIVER_PWM_FREQUENCY;
driver.init();
driver.enable();

motor.linkDriver(&driver);
motor.voltage_limit = driver.voltage_limit;
motor.controller = MotionControlType::velocity_openloop;
// motor.LPF_velocity.Tf = 0.02;
// motor.P_angle.P = 20;
// motor.velocity_limit = 4;
motor.initFOC();

motor.init();
Serial.println("Open-loop velocity test, target rad/s: ");
Serial.println(targetVel * dirSign);
}

void loop()
{
motor.loopFOC();
motor.move(10); // Vorgabe in rad/s (open-loop)
}

```

and the config: (not all of them are used (yet))
```
#ifndef CONFIG_H
#define CONFIG_H

// =============================================================================
// HARDWARE PIN CONFIGURATION
// =============================================================================

// Motor Driver (3PWM) - ESP32 DevKit V1
#define MOTOR_PIN_A 25 // PWM Phase A
#define MOTOR_PIN_B 26 // PWM Phase B
#define MOTOR_PIN_C 27 // PWM Phase C
#define MOTOR_ENABLE 14 // Enable Pin

// SPI Encoder (AS5048A) - ESP32 SPI
#define ENCODER_CS 5 // Chip Select
#define ENCODER_MOSI 23 // MOSI (default ESP32)
#define ENCODER_MISO 19 // MISO (default ESP32)
#define ENCODER_SCK 18 // SCK (default ESP32)
// AS5048A: 14-bit absolute encoder (16384 counts per revolution)

// Status LED (onboard LED on ESP32 DevKit V1)
#define LED_PIN 2

// Button for manual start/stop (with internal pullup)
#define BUTTON_PIN 34 // Input-only pin, use external or internal pullup

// =============================================================================
// MOTOR & DRIVER CONFIGURATION
// =============================================================================

// Motor: iFlight GBM2804H-100T with AS5048A encoder
#define MOTOR_POLE_PAIRS 6 // current test motor: 6 pole pairs
#define MOTOR_PHASE_RESISTANCE 5.57f // Ohm (from motor specs)

// Driver settings
#define DRIVER_VOLTAGE_SUPPLY 12.0f // V
#define DRIVER_VOLTAGE_LIMIT 4.0f // V - cap for testing
#define DRIVER_PWM_FREQUENCY 25000 // Hz - 25kHz optimal for ESP32 LEDC

// Motor limits (SAFETY - start conservative!)
#define MOTOR_VOLTAGE_LIMIT 4.0f // V - cap to avoid >4V during tests

// =============================================================================
// MEASUREMENT GEOMETRY (PULLEY)
// =============================================================================

constexpr float PULLEY_DIAMETER = 0.04f; // meters (4 cm)
constexpr float PULLEY_CIRCUMFERENCE = PI * PULLEY_DIAMETER;

// =============================================================================
// PEAK DETECTION TUNING
// =============================================================================

constexpr float MIN_VELOCITY_FOR_PEAK = 1.5f; // rad/s threshold to arm/trigger peaks
constexpr unsigned long MIN_PEAK_DISTANCE = 100; // ms debounce between peaks
constexpr int VEL_BUFFER_SIZE = 20; // samples for moving average

// =============================================================================
// MOTOR PULSE CONTROL (GENTLE START VALUES)
// =============================================================================

constexpr float PULSE_VOLTAGE = 3.0f; // V for a gentle tug (keep <4V)
constexpr float PULSE_DURATION_FRACTION = 0.7f; // fraction of half-period to keep pulse on
constexpr unsigned long PULSE_MAX_DURATION_MS = 300; // safety cap for pulse length
constexpr float PULSE_TRIGGER_VELOCITY = 1.0f; // rad/s negative threshold to trigger
constexpr float PULSE_DIRECTION_SIGN = 1.0f; // flip to -1.0f if pull direction is wrong
// =============================================================================
// SERIAL COMMUNICATION
// =============================================================================

#define SERIAL_BAUD_RATE 115200
#define MONITORING_INTERVAL 100 // ms - How often to print monitoring info

#endif // CONFIG_H

```

the issue i am having is, that the roatation is not smooth: it feels like there are (even audible) little hickups or clicks in between whcih make the rotation somewhat chunky. here is a video for explanation:

i have tried to re-set the pole parameter,
swapped A B C to the motor, swapped the 1 2 3 lines from esp32 to the simplefoc board. changed the volt to up to 5V and down to 1V, i am using a lab power supply to have an eye on the current.

what is that behavior?
is it possilbe to have a smooth rotation without encoders?
what am i doing wrong?

Any help would be great!! Thanks a lot!!

The ticking noise is unusual, but steppy movement (cogging) is typical for open loop on BLDC motors.

Hi there, thanks for your reply!
I have solved the issue by re-checking the voltage settings. they were too high. i did not quite understand how the voltage limits work. i ran into the same problem as here:

cheers and thanks!