Hi kmin, thanks for the answer. Yes, I have set the max current to 1.4A in the code. This is the scheme of my wiring :
As for the code being used is exactly the example from Basic Stepping apart from small changes to maxcurrent and delays... : ```#include <SPI.h>
#include <HighPowerStepperDriver.h>
const uint8_t DirPin = 2;
const uint8_t StepPin = 3;
const uint8_t CSPin = 4;
// This period is the length of the delay between steps, which controls the
// stepper motor's speed. You can increase the delay to make the stepper motor
// go slower. If you decrease the delay, the stepper motor will go faster, but
// there is a limit to how fast it can go before it starts missing steps.
const uint16_t StepPeriodUs = 2000;
HighPowerStepperDriver sd;
void setup()
{
Serial.print("setting up the driver");
SPI.begin();
sd.setChipSelectPin(CSPin);
// Drive the STEP and DIR pins low initially.
pinMode(StepPin, OUTPUT);
digitalWrite(StepPin, LOW);
pinMode(DirPin, OUTPUT);
digitalWrite(DirPin, LOW);
// Give the driver some time to power up.
delay(1);
// Reset the driver to its default settings and clear latched status
// conditions.
sd.resetSettings();
sd.clearStatus();
// Select auto mixed decay. TI's DRV8711 documentation recommends this mode
// for most applications, and we find that it usually works well.
sd.setDecayMode(HPSDDecayMode::AutoMixed);
// Set the current limit. You should change the number here to an appropriate
// value for your particular system.
sd.setCurrentMilliamps36v4(1000);
// Set the number of microsteps that correspond to one full step.
sd.setStepMode(HPSDStepMode::MicroStep32);
// Enable the motor outputs.
sd.enableDriver();
}
void loop()
{
Serial.print("starting loop");
// Step in the default direction 1000 times.
sd.setDirection(0);
for(unsigned int x = 0; x < 1000; x++)
{
step();
delayMicroseconds(StepPeriodUs);
}
// Wait for 300 ms.
delay(300);
// Step in the other direction 1000 times.
sd.setDirection(1);
for(unsigned int x = 0; x < 1000; x++)
{
step();
delayMicroseconds(StepPeriodUs);
}
// Wait for 300 ms.
delay(300);
}
// Sends a pulse on the STEP pin to tell the driver to take one step, and also
//delays to control the speed of the motor.
void step()
{
// The STEP minimum high pulse width is 1.9 microseconds.
digitalWrite(StepPin, HIGH);
delayMicroseconds(2000);
digitalWrite(StepPin, LOW);
delayMicroseconds(2000);
}
// Writes a high or low value to the direction pin to specify what direction to
// turn the motor.
void setDirection(bool dir)
{
delayMicroseconds(1);
digitalWrite(DirPin, dir);
delayMicroseconds(1);
}```