Stepper speed not the same between drivers

Hi there.

So, I'm doing a project at the moment, where I need 6 stepper drivers to run 6 stepper motors.
For the project, we are gonna use the Sparkfun L6470 Autodriver to run the motors. The motors are the 667oz-in NEMA-17, like the ones shown in this link: 12V, 1.7A, 667oz-in NEMA-17 Bipolar Stepper Motor - RobotShop

For testing purposes I've got another driver, the PoStep60-256, Stepper Motor Driver - PoStep60-256 6A, 256 microsteps - Polabs

In the PoStep software I can set the motor to run at around 20000 steps/s, which is a suitable speed for the project.

However, when I hook up the motor to the Sparkfun driver, the motor will not run as fast as with the PoStep driver. At some point the motor will begin to skip steps, and not rotate at all, and the speed is definitely slower than with the PoStep driver. The power supplied to both drivers is identical.

So my guess is that somehow the settings for the sparkfun driver are not set correct for some reason. I have just taken the example code from sparkfun's website for the driver.

Setup code below:

// Support functions.

#define NOTE_DIVISOR 2 // My cheesy way of reducing the note frequencies to a range
// that doesn't cause the motor to slip. I could rewrite
// the wantYouGone() function to change the notes, but that
// would be a lot of work.

int stepDir = 1; // Direction flipping bit. Rather than all going one way,
// they change directions. It looks cooler.

// To play a note, we start the motor spinning at the note's frequency in steps/s.
// The run() function automagically calculates the appropriate value to feed to the
// dSPIN part based on the desired steps/s.
void playNote(int note, int duration)
{
if (stepDir == 1) boardA.run(FWD, note/NOTE_DIVISOR);
else boardA.run(REV, note/NOTE_DIVISOR);
delay(duration);
stepDir*=-1;
boardA.softStop();
while (boardA.busyCheck());
}

// This is the configuration function for the two dSPIN parts. Read the inline
// comments for more info.
void dSPINConfig(void)
{
boardA.SPIPortConnect(&SPI); // Before doing anything else, we need to
// tell the object which SPI port to use.
// Some devices may have more than one.

boardA.configSyncPin(BUSY_PIN, 0);// BUSY pin low during operations;
// second paramter ignored.
boardA.configStepMode(STEP_FS); // 0 microsteps per step
boardA.setMaxSpeed(10000); // 10000 steps/s max
boardA.setFullSpeed(10000); // microstep below 10000 steps/s
boardA.setAcc(10000); // accelerate at 10000 steps/s/s
boardA.setDec(10000);
boardA.setSlewRate(SR_530V_us); // Upping the edge speed increases torque.
boardA.setOCThreshold(OC_750mA); // OC threshold 750mA
boardA.setPWMFreq(PWM_DIV_2, PWM_MUL_2); // 31.25kHz PWM freq
boardA.setOCShutdown(OC_SD_DISABLE); // don't shutdown on OC
boardA.setVoltageComp(VS_COMP_DISABLE); // don't compensate for motor V
boardA.setSwitchMode(SW_USER); // Switch is not hard stop
boardA.setOscMode(INT_16MHZ_OSCOUT_16MHZ); // for boardA, we want 16MHz
// internal osc, 16MHz out.
boardA.setAccKVAL(128); // We'll tinker with these later, if needed.
boardA.setDecKVAL(128);
boardA.setRunKVAL(128);
boardA.setHoldKVAL(32); // This controls the holding current; keep it low.
}

I cannot seem to make the sparkfun driver run the motor as fast as the PoStep one, but I need to use the sparkfun one for the project. Does somebody know what I need to chance in the sparkfun driver to make is run as well as the PoStep one?

Cheers!

kranzekage:
In the PoStep software I can set the motor to run at around 20000 steps/s, which is a suitable speed for the project.

However, when I hook up the motor to the Sparkfun driver, the motor will not run as fast as with the PoStep driver.

That sounds like a question that should be addressed to Sparkfun.

...R

Have you set the current correctly - that's essential.

This looks really dodgy for a 1.7A motor:

boardA.setOCThreshold(OC_750mA);  // OC threshold 750mA

MarkT:
Have you set the current correctly - that's essential.

This looks really dodgy for a 1.7A motor:

boardA.setOCThreshold(OC_750mA);  // OC threshold 750mA

I upped the setting to 2250 to support the motor, but it's the same result

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html . Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Have you checked that the stepper power supply is supplying the needed current?
Are your stepping parameters the same, it sounds like you may be half-stepping in one of the cases.

Thanks.. Tom... :slight_smile:

Hi!

Thanks for the answer :slight_smile:
I have wired my circuit exactly like this example from sparkfun:
Sparkfun circuit

The setup for the driver is setup like this (hopefully in a code block this time)

void dSPINConfig(void)
{
  boardA.SPIPortConnect(&SPI);      // Before doing anything else, we need to
                                    //  tell the object which SPI port to use.
                                    //  Some devices may have more than one.
  
  boardA.configSyncPin(BUSY_PIN, 0);// BUSY pin low during operations;
                                    //  second paramter ignored.
  boardA.configStepMode(STEP_FS_4);  
  boardA.setMaxSpeed(3000);       
  boardA.setFullSpeed(2000);       
  boardA.setAcc(200);             
  boardA.setDec(200);
  boardA.setSlewRate(SR_290V_us);   // Upping the edge speed increases torque.
  boardA.setOCThreshold(OC_1500mA);  // OC threshold 750mA
  boardA.setPWMFreq(PWM_DIV_1, PWM_MUL_2); // 31.25kHz PWM freq
  boardA.setOCShutdown(OC_SD_DISABLE); // don't shutdown on OC
  boardA.setVoltageComp(VS_COMP_DISABLE); // don't compensate for motor V
  boardA.setSwitchMode(SW_USER);    // Switch is not hard stop
  boardA.setOscMode(INT_16MHZ_OSCOUT_16MHZ); // for boardA, we want 16MHz
                                    //  internal osc, 16MHz out.
  boardA.setAccKVAL(127);           // We'll tinker with these later, if needed.
  boardA.setDecKVAL(127);
  boardA.setRunKVAL(255);
  boardA.setHoldKVAL(32);           // This controls the holding current; keep it low.
  boardA.setLoSpdOpt(true);
}

The PoSted60 driver is set to 1/4 microstepping as standard, and that works perfectly. If I set the driver to Full-step, the motor will not spin at all.
In the Sparkfun driver, I have set the microstepping to 1/4 as well (boardA.configStepMode(STEP_FS_4);
), which will also make the motor spin. If set to Full-step here, the motor, again, will not spin.

The power supply is set to 15V, which should be enough for the motor. Again, works perfectly with the PoSted60 driver, but with the Sparkfun driver, the motor begins to skip steps very easily.

Hi,
Have you measured the 15V supply while either stepper controllers are working?

Tom.. :slight_smile:

TomGeorge:
Hi,
Have you measured the 15V supply while either stepper controllers are working?

Tom.. :slight_smile:

When the system is powered on, I am measuring 15V with a multimeter on the input on the driver :slight_smile:

kranzekage:
When the system is powered on, I am measuring 15V with a multimeter on the input on the driver :slight_smile:

And when they are running and in fault mode?
I'm off to bed mate..
Tom.... :slight_smile: :slight_smile:

TomGeorge:
And when they are running and in fault mode?
I'm off to bed mate..
Tom.... :slight_smile: :slight_smile:

I'll check once I get back to the project some time tomorrow! Again, thanks for your help so far :slight_smile:
I just find it weird that one driver can run the motor faster than the other, when the supplied power is the same for both drivers.

Voltage is the same all the time, it seems like.

Measure the current taken from the supply - it should be pretty similar for the two drivers if they are
both set to the same output current. Note that the input and output currents are different, stepper
drivers are power converters.

My suspicion is one of the drivers is not setup for the correct output current.

You have verified the motor winding pinout with a multimeter?

MarkT:
Measure the current taken from the supply - it should be pretty similar for the two drivers if they are
both set to the same output current. Note that the input and output currents are different, stepper
drivers are power converters.

My suspicion is one of the drivers is not setup for the correct output current.

You have verified the motor winding pinout with a multimeter?

Can you point me to exactly where on the boards I should measure the current output? Just to make sure I do it correctly. I only have a multimeter available, no oscilloscope.

But yes, it does seem plausible that the Sparkfun driver does not output the same amount of current, since the motor begins to skip steps earlier than with the other driver.

Also, please explain how to verify motor windings with a multimeter :slight_smile: Sorry for the noob questions.
But thanks for the help so far!

On my power supply, I can see how much A is currently drawn from it. When the motor is running it will only go up to around 0.5 A, even though the motor is a 1.6A motor. I cannot seem to change the current supply from the driver to the motor anywhere in the Sparkfun L6470 Autodriver library.
There is a KVAL setting, where it is possible to input voltage regulations, but setting it either to a low value or high does not change anything. Motor is still running quite slow.

Hi,

 boardA.setRunKVAL(128);
  boardA.setHoldKVAL(32);           // This controls the holding current; keep it low.

I setHoldKVAL is holding current, then setRunKVAL is running current.

Change that and see what happens.
The Amp Meter on the power supply should be able to see any difference.

Sparkfun site and its Github site is not accessible at the moment so I can't down load the Library.

Tom... :slight_smile:

kranzekage:
On my power supply, I can see how much A is currently drawn from it. When the motor is running it will only go up to around 0.5 A, even though the motor is a 1.6A motor.

Reread my post #11. The point of interest is the difference between the two drivers, not the difference
between motor and supply current, that is totally expected.

I cannot seem to change the current supply from the driver to the motor anywhere in the Sparkfun L6470 Autodriver library.

Then you have a question for the Sparkfun forums...

There is a KVAL setting, where it is possible to input voltage regulations, but setting it either to a low value or high does not change anything. Motor is still running quite slow.

I've spent the day adjusting the Run, Acc, Dec and Hold values, but doesn't really seem to change anything.
The documentation says that the values can be set between 0 and 255. If I set the value at around 200 or higher, the motor won't spin at all. Around 128, it will spin, but still begin to slip quite early. Other values does not seem to change this behavior.

If I ramp up the power supply to around 24V, the system seems to get unstable, although the driver is rated for up to 45V and the motor's datasheet says that it will happily run at 24V. At 24V the motor will sometimes just stop spinning in the middle of a command, even at a speed that I can easily maintain at 12V.

I am so confused with this entire system... :smiley:

Hi,
Why can't you use the PoStep60-256 throughout?

Tom... :slight_smile:

That was our original plan, but they do not suit the project unfortunately. It works great for testing purposes, but not really for the bigger scale project.

The project is not ruined by the slow turning speed of the Sparkfun driver, but it would be very nice if they could make the motor spin a bit faster :slight_smile:

I will continue to experiment with the settings and see if anything will work out. Will post here with my findings :slight_smile:

Thanks for your help though! Really appreciate it.

If the current is set correctly and the motor is not behaving with that driver, it sounds like the driver
is fried. All current-controlling stepper drivers should work roughly the same at the same set current and
microstepping rate. You are not seeing this.

Did you ever hot plug the motor wires? This is a really good way to blow up any stepper driver - never
do it, always ensure the motor is connected securely (breadboards aren't great for this), before powering
up. Any loose connection will arc and send high voltage spikes back at the driver as the windings are
very inductive.