Configuration of custom BLDC motor test

I’m currently in the process of setting up a proof of concept of a motor driver for a BLDC motor (DF45L024048-E from Nanotec) using a Teensy 4.1 as controller and a TMC6200-BOB.

So far I have managed to get the built-in hallsensors working so I can run SimpleFOC in closed loop. I am however having issues getting motor to spin up to the 5500 rpm I can achieve with the driverboard that came with the motor, because for the purpose of this project a custom PCB with a controller and driver would be preferable.

A bit more specific on the problem I’m having - I can get the motor to spin up to about 2000 rpm if I adjust some of the voltage and current limit variables in SimpleFOC to values where the motor uses the same amount of power (~350mA) as the Nanotec driverboard but can’t seem to get the speed any faster than that. Motor.velocity limit is set to 1000 so that shouldn’t be an issue.
I can however change some settings to get the motor spinning to ~3300 rpm, but this causes the setup to draw over 1.5A of current, resulting in a very hot motor.

My setup file looks like this:

// maximal expected velocity
sensor.velocity_max = 1000; // 1000rad/s by default ~10,000 rpm
// check if you need internal pullups
sensor.pullup = Pullup::USE_EXTERN;

sensor.init();
// enable hall sensor hardware interrupts
sensor.enableInterrupts(doA, doB, doC);
// link the motor and the sensor
motor.linkSensor(&sensor);

//driver.dead_zone = 0.1;
driver.voltage_power_supply = 24; // Set your motor supply voltage
driver.voltage_limit = 20;
motor.voltage_sensor_align =0.5;
motor.current_limit = 6;
driver.init();
motor.linkDriver(&driver);

// Link encoder and motor
//motor.linkSensor(&encoder);

// Set the control mode
motor.controller = MotionControlType::velocity;
motor.torque_controller = TorqueControlType::voltage;
motor.foc_modulation = FOCModulationType::Trapezoid_120;

// Set PID values for velocity control
motor.PID_velocity.P = 0.2;
motor.PID_velocity.I = 20;
motor.PID_velocity.D = 0;
motor.voltage_limit = 12; // Set the voltage limit for the motor (/2 driver voltage)
motor.velocity_limit = 1000;

// Set ramp value for smoother control
motor.PID_velocity.output_ramp = 5;

motor.motion_downsample = 1; // - times (default 0 - disabled)

// Initialize FOC
motor.init();
motor.initFOC();

and a simple:

motor.loopFOC();
motor.move(target);

as the control loop.

Is there any additional settings I have missed to be able to get the motor to spin at the expected >5000 rpm without drawing too much current?

Thanks in advance.

Why are you limiting this ?
Is the Nanotec driverboard doing foc ?

I was simply trying different values, adjusting this variable changes how much current the motor will draw from experimentation.

As for the Nanotec board; I’m not sure but I assume it’s a custom implementation of FOC. The motor is driven by the same 3 phase input as I am trying to drive it with, but their board doesn’t have a dedicated driver IC, instead driving the power MOSFETs directly from a controller.

Additionally, setting the driver.voltage_limit to >22 will sometimes cause the TMC6200 to trigger overcurrent/overvoltage fault and be disabled until powercycle. This kind of confused me however as the datasheet indicates a voltage range of 8-60V.

You are running voltage mode with trapezoidal modulation, that board is probably running FOC. You cannot compare both.

I shared this a few days ago, please have a look.

Don’t use velocity control before having voltage mode work properly.