TOS-100 Stepper card max stepping speed

Hi,

I have this card running, it was pretty easy, but I can’t get it to run over 250 steps/sec. If I try the motor loses step and just stops and buzzes. I was told to expect up to 1000 steps/sec

The test code is:

#include <SPI.h>
#include <TMC26XStepper.h>

//we have a stepper motor with 200 steps per rotation, CS pin 2, dir pin 6, step pin 7 and a current of 350mA
TMC26XStepper tmc26XStepper = TMC26XStepper(200,2,6,7,700);
int curr_step;
int speed =  20;


void setup() {
 //char constant_off_time, char blank_time, char hysteresis_start, char hysteresis_end, char hysteresis_decrement
//  tmc26XStepper.setSpreadCycleChopper(2,24,8,6,0);
//  tmc26XStepper.setRandomOffTime(0);
 

 tmc26XStepper.setMicrosteps(1);
 tmc26XStepper.setStallGuardThreshold(10,-1);
 tmc26XStepper.start();
 tmc26XStepper.setSpeed(250);
}

void loop() {
   tmc26XStepper.step(1000);
   while (tmc26XStepper.isMoving()!=0)
     {
      tmc26XStepper.move();
     }  
}

It could be code or the motor. My power supply is good.

Any ideas?

Thanks!

Steve

A link to the card and to the library are going to be essential if you want help.

My power supply is good.

We need to know more than that the power supply is well behaved.

PaulS: A link to the card and to the library are going to be essential if you want help. We need to know more than that the power supply is well behaved.

Sorry, I've seen other threads on this card, so I thought it was common..

The card: http://www.semiconductorstore.com/cart/pc/viewPrd.asp?idproduct=48894 or https://github.com/trinamic/TOS-100

The library came from: https://github.com/trinamic/TMC26XStepper

It's a 12v 1.5 Amp supply, plugged into the barrel connector of the TOS-100 (I'm an electrical engineer, I have been designing electronic HW like this for 30+ years. I think that the PS is good. If there are any problems, I believe that they are in my code, or the capability of the motor itself - the specs from Adafruit are incomplete, the only spec is that the motor can draw .35 amp, so even if all 4 coils were on at once It'd be OK, and the most that should be on are 2, so there should be plenty of headroom..)

I've played with the tmc26XStepper.setStallGuardThreshold line (not much clear info), as well as the tmc26XStepper.setSpreadCycleChopper line and neither had any effect on the max reliable speed.

Thanks for the help!

SteveW: I have this card running, it was pretty easy, but I can't get it to run over 250 steps/sec. If I try the motor loses step and just stops and buzzes. I was told to expect up to 1000 steps/sec

Sorry, but I don't have the patience to trawl through that Github library stuff. Is there nothing more accessible?

The problem you are describing sounds more like a power supply / motor problem rather than a software problem.

Post a link to the datasheet for the motor. Have you adjusted the driver so that it provides the proper maximum current for the motor.

Maybe you need a higher voltage power supply?

...R Stepper Motor Basics

Maybe you need a higher voltage power supply?

Or amperage. A 1.5 amp power supply is borderline for stepper motors.

PaulS: Or amperage. A 1.5 amp power supply is borderline for stepper motors.

I didn't comment on that because 12v * 1.5A = 18 watts whereas from the data sheet the motor coil requirement seems to be about 6 watts each. Maybe a big capacitor would help.

However more amps won't do any harm.

...R

Thanks folks, I think my loop was a short as it can be, so maybe not the code… It may be the motor, it just may be wimpy… The supply is rated enough, but as was suggested, maybe a big capacitor very close to the switching chip might help, I’ll try that, but right now I am thinking motor…

I just remembered that I had a brand new 5A 12V supply in 'stock.'

It's a high quality supply that I used for a project where I was making LED parking lot lights that required 50W under all conditions (-20C to 40C). I swapped it into the current setup and there was no change in performance at all, so I think it has to either be the stall foldback on the motor driver chip (back to the code) or the motor is just not very capable (this is the last time I get a motor without full specs).

Thanks again.

You have not posted a link to the datasheet for the motor. Maybe it needs more than 12v to perform faster.

...R

Heyho and Happy New Year.

Is it just me, or might it be this bit of code:

   while (tmc26XStepper.isMoving()!=0)
     {
      tmc26XStepper.move();
     }

A look into the implementation of char TMC26XStepper::isMoving(void) reveals that the function returns a 1 if the stepper still has steps to go, and zero otherwise. In other words: if the stepper is moving, isMoving() returns a 1.

So, only if the stepper is already moving, the code in the bracket is executed.

Should it not rather be this?

   while (tmc26XStepper.isMoving()==0)
     {
      tmc26XStepper.move();
     }

broekai: So, only if the stepper is already moving, the code in the bracket is executed.

I think the original logic is correct. The name isMoving() is misleading. Think of it as hasCompletedAllSteps()

...R

Robin2:
You have not posted a link to the datasheet for the motor. Maybe it needs more than 12v to perform faster.

…R

It’s an adafruit #324, there is no spec sheet, it just says 12V 350 mA. On one page it said that it made 40 RPM, that is only 133 steps/sec (40 * 200)/60. So I am back to suspecting the motor… It’s just an inexpensive toy., I am going to get a motor that specifies at least 1000 step/sec capability.

Thanks again

It would hardly have killed you to include a link to the motor to save me having to find it. Help us to help you.

That motor will work much better with 20v or more.

...R

That motor will not go fast till you use more like 80 to 160V (not safe or practical). Its a high impedance motor and thus a slow motor.

If you want performance (speeds upto 2000rpm, reasonable torques upto 1000rpm), then you will need a low impedance motor, something about 1 or 2 ohms, a 24V or higher supply, and a chopper-driver set to the appropriate current rating of the motor.

I have a similar motor and I can get a bit over 1000 full steps per second with an 18v power supply and an A4988 driver. Of course there is probably not much useable torque.

I agree with @MarkT if you want higher speeds.

Thanks for that into.

How do you know that the motor can handle that high a voltage when the only spec they provided says to use 12V and there are no markings on the motor (except 12V, 200X) to find the actual data sheet?

Again, sorry, I am new to this community and not used to supplying a link for each item, it’s a much better way to get the into to you to help, so I will be more careful.

SteveW: How do you know that the motor can handle that high a voltage when the only spec they provided says to use 12V

I wrote the text in the link I gave you in Reply #3 to answer that sort of question.

The important factor for stepper motors is the permitted current, not the voltage.

...R

Robin2: I wrote the text in the link I gave you in Reply #3 to answer that sort of question.

The important factor for stepper motors is the permitted current, not the voltage.

...R

OK, thanks, I agree with respect to torque, but if you put too high a voltage, the windings are going to short. At 40 - 60 V on a motor spec'd for 12 I'd start to worry.

SteveW: OK, thanks, I agree with respect to torque, but if you put too high a voltage, the windings are going to short. At 40 - 60 V on a motor spec'd for 12 I'd start to worry.

Why do I get the impression you have not read Stepper Motor Basics

I'm not going to do a re-write here.

...R

I did read it and except for your comment on voltage I agree with all you said and think it is a great intro.

I've been designing electronics for about 40 years and I tend to find that ignoring any of the manufacturer's specs will produce a design that will fail at some point, sometimes dangerously.

Back before stepper motor drivers chips were available, I designed stepper motor drivers for medical equipment (EKG printers) and found that there are all sorts of safety hazards you can produce with steppers (e.g. without the kick diodes in all of the modern driver chips, you can create a 200v+ spike as you turn off the coli driver as the field collapses with each step, that can knock a person clear across a room, try it sometime).

My current situation started with a mistake, I should never have used the #324 motor as it is a toy, with incomplete specifications. It said 12V, I used 12V, so far that has been the only thing I am guilty of. I'll get a properly spec'd motor and use the appropriate voltage and current for the performance I am trying to achieve. The Trinamic card I am using will go high enough in both voltage and current to get there.

I was mostly interested in Arduino specifics (my original question started with a potential code error). I've been learning a lot about the platform and I appreciate all of the suggestions.

Thanks Again...