Want to speed up stepper motor and can't raise maxSpeed above 3000 steps/s for TMC2209 controlled 24V NEMA 17

I am working on a 2 axis pen plotter. Here is my setup (I am including links at the bottom but hopefully all necessary info is provided in the post):
I have a 24V 6A power supply which is split by a WAGO 221 connector, sending 24V into the VS pin of a BIGTREETECH TMC2209 V1.3 and also sending 24V into a 24V to 5V 3A buck converter. The buck converter then powers an ESP32 through the VIN pin. A schematic of the TMC2209 and ESP32 wiring is attached. The TMC2209 is powering a bipolar 2A 59Ncm NEMA 17 motor.

So far I am only powering one motor to test that my setup works. I want the gantry to be able to move relatively fast, and as far as I can tell the motor and voltage I have is good enough to move it across a 8.5in page in say 1 second. The friction on the gantry is decent as well, so I don't think that's an issue.
I am using AccelStepper to move my motor, below is my code:

#include <AccelStepper.h>

static const int DIR_PIN = 32;
static const int STEP_PIN = 26;
static const int EN_PIN = 33;

AccelStepper stepper(AccelStepper::DRIVER, STEP_PIN, DIR_PIN);

void setup()
{
    pinMode(EN_PIN, OUTPUT);
    digitalWrite(EN_PIN, LOW);

    stepper.setMinPulseWidth(5);
    stepper.setMaxSpeed(3500);
    stepper.setAcceleration(3000);
    stepper.moveTo(7000);
    while (stepper.distanceToGo() != 0)
    {
        stepper.run();
    }
    delay(300);
}

void loop() {}

My problem is that whenever I raise maxSpeed above 3000, the motor begins skipping steps (or at least going much slower and making a grinding noise). It is not moving that fast either. From all the research I did, the motor should be able to spin fine at step speeds above 3000.
I saw that sometimes the current passed by the TMC2209 is too low and that this can be adjusted by the potentiometer. In order to measure the VREF (which I think corresponds to current), I measured from GND to the metal potentiometer however I am unable to read anything above 30mV. I measure after I run my code segment and the motor is no longer moving but everything is on.
Also while testing, after some time, the I think the TMC2209 shorted (VIO -> GND has 1.3ohm resistance) and I had to replace it, but I wonder if I am doing something wrong with the circuit that caused the issue.
How do I get my motor to spin faster and why can't I properly measure VREF?
Attached is a pictures of my TMC2209. Circled is where I am trying to measure VREF and what I am spinning.

power supply: https://www.amazon.com/dp/B0CW598HV8
WAGO connector: WAGO 221 Lever Nuts 12pc Compact Splicing Wire Connector Assortment with Case | Includes 221-2401, 221-412, 221-413, 221-415: Amazon.com: Tools & Home Improvement
buck converter: Amazon.com: DC 12V/24V to 5V 3A Step Down Converter - 12V Voltage Regulator Buck Converter Power Supply Transformer (12V/24V to 5V 3A) : Electronics
NEMA 17: STEPPERONLINE Nema 17 Stepper Motor Bipolar 2A 59Ncm(84oz.in) 48mm Body 4-Lead W/ 1m Cable and Connector Compatible with 3D Printer/CNC: Amazon.com: Tools & Home Improvement
TMC2209: Amazon.com: BIGTREETECH TMC2209 V1.3 UART Stepper Motor Driver Module VS TMC2100 TMC2130 for Octopus V1.1/Octopus Pro/SKR V1.4 Turbo/SKR 3/Manta M8P/M4P/M5P 3D Printer Controller Board 1Pc : Industrial & Scientific

Can't confirm that's the proper pin. Not a 5 volt pin? Other helpers knows better.

Unfortunately that tells nothing useful.

Test lowering that number. Read the datasheet for the stepper and look for "RUN IN/RUN OUT" parameters. They tell about the limits for acceleration, without acceleration if I remember.

The pin for VIN works to power the ESP without problems.
Here is the datasheet for my motor: https://www.omc-stepperonline.com/download/17HS19-2004S1.pdf
I don't see any RUN IN/RUN OUT parameters. The problem with lowering acceleration is that my entire range of motion is 7000 steps, so if the acceleration is too low I'm not sure if it ever reaches maxSpeed. Moreover right now the acceleration seems pretty slow as well. That's why I was thinking about not having enough current but as I mentioned I haven't been able to measure VREF.

You are short on information. Links to Amazon and similar sales sites normally do not provide much more technical detail than is needed to make a sale. Making it work is a different matter.

NEMA is a mechanical specification. A complete annotated schematic would help us help you and improve the chances of getting an accurate answer.

As a rough rule, most NEMA-17 motors are happiest below about 500 to 1000 RPM. Some can exceed that, especially with higher supply voltages and light loads, but the available torque falls rapidly as speed increases.

It appears you have plenty of voltage but not much current capability. Your picture is incomplete. You have connections shown to only 5 of the 16 pins. Where do the remaining pins go?

I am not sure why you want to measure Vref. That normally means "Voltage Reference." How does that relate to the current you are trying to set or measure?

The real question is not "How fast can it spin?" but "How fast can it spin while still producing enough torque for the load?" That is why manufacturers publish torque-versus-speed curves. Those curves tell the real story. A motor that can hold 80 oz-in at zero RPM may only have 10 or 20 oz-in available at higher speeds.

It will do. Test it! Lowering the acceleration will make it take some more time to reach "top speed" but there's no other option without changing stepper, maybe driver.

That datasheet looks like "tiny" to me. It only tells about "... inertia", a figure I don't know how to use. Remains, getting a "better" stepper if not a lowered acceleration can be used.

I see @gilshultz posted more advice. Check that post!

Unfortunately I think the manufacturer who I purchased from does not provide more than the 1 page sheet I linked in post #3.

I am fairly sure that before skipping steps my motor is doing at most 100 RPM but probably more around 80.

Aside from the 5 connections shown in the schematic, 24V is passed to the VS pin and the 4 pins A1 A2 B1 B2 are connected to the motor. No other pins on the motor driver are being used.

While I've looked at a few internet references on this, this one seems to describe what I'm trying to do: https://all3dp.com/2/vref-calculator-tmc2209-tmc2208-a4988/

While the torque vs speed question makes sense, it seems doubtful to me that at the speeds I am spinning my motor it should be struggling with torque.
It's possible I just need to get a motor with more info provided by the manufacturer, but again I'm not pushing the motor to go that fast or with much load.

@MicroBahner might have wisdom to share on this issue.

What happens if you temporarily remove the load and just let the motor turn freely? That would highlight if there is a problem with insufficient torque.

Setting the current with this pot is mandatory! This should be done as a first step.

That's weird. You should be able to adjust between 0.2 to 2.2V
From the manual:

What I can see, there is the capacitor at VS missing ( at least 100µF low ESR). This capacitor is mandatory too!

Hi, @lemurme
Welcome to the forum.

Can you please post a copy of your circuit, a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, power supplies, component names and pin labels

Thanks... Tom.... :smiley: :+1: :coffee: :australia:

Ok I've made some progress. First,

Here should be a complete diagram:

I was able to find a place on the pot to successfully measure and I set my VREF voltage to around 1650mV which should be around 1.17A (as per the docs TMC2209 - BIGTREETECH WIKI). I don't remember whether I ended up increasing or decreasing the current but the grinding and missed steps seems to have increased.

I have now also installed this capacitor (a 100µf 50V rated capacitor).

When the load is removed the grinding remains, however it is hard for me to tell if the grinding/slowdown is decreased because I'm just looking at the axle of the motor vs a whole belt moving. It does seem like the grinding is quieter, so maybe the load causes more steps to be skipped.

Am I really at the limit of the motor? It is powering a GT2 20 tooth pulley. With my motor having 1.8 degree step, thats 200 steps/rev and since with MS1 and MS2 unpowered the TMC 2209 does 1/8 microstepping, 1 revolution = 200*8 = 1600 accelstepper steps. Since the GT2 pulley has a pitch of 2mm, 1 revolution of my pulley is 40mm of motion. Hence it takes 1600 steps/40 mm so 1 step = 0.025 mm.
Therefore, 3500 steps/sec max speed is the same as 87.5 mm/s and the max accel is 75mm/s^2.
Aren't these pretty average speeds for these motors to be able to move stuff at?

Hi, @lemurme

Have you looked at this site?

Can you please post data/specs of the 24V to 5V converter.
You may need a gnd connection from 2209 to ESP32.

Tom.... :smiley: :+1: :coffee: :australia:

Here is what amazon info says:

Parameters

  • Input voltage: 12V/24V DC;
  • Input voltage range:DC 10V~35V
  • Output voltage: 5V/3A
  • Output power: 15W
  • Maximum working temperature: 80℃
  • size:53*50*20mm
  • Net weight: 67 g / 2.35oz

Yes, I already have one. Sorry I forgot to include this in my diagram.

What exactly do you mean? I'll note that unlike many of the sources online such as this one, my TMC2209 does not have an exposed SPREAD pin, instead it has a CLK pin.