Driving Linear Actuator

I am trying to drive a linear actuator using an Arduino Uno and DFRobot Motor Shield, TMC260_Stepper_Motor_Driver_Shield_SKU__DRI0035-DFRobot , and when i run the programme, the StallGuard LED on the board turns on and the linear actuator pulses and gets hot very quickly. Does anyone have any suggestions to make this work?

This is trialling the 2 sample programmes on the motor shield website.

Thank you.

Please follow the advice given in the link below when posting code, in particular the section entitled 'Posting code and common code problems'

Use code tags (the < CODE/ > icon above the compose window) to make it easier to read and copy for examination

https://forum.arduino.cc/t/how-to-get-the-best-out-of-this-forum

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

//we have a stepper motor with 20 steps per rotation,CS pin 6, dir pin 4, step pin 5 and a current of 800mA
TMC26XStepper tmc26XStepper = TMC26XStepper(20,6,4,5,800);
void setup() 
{
    Serial.begin(9600);
    Serial.println("==============================");
    Serial.println("TMC26X Stepper Driver Demo App");
    Serial.println("==============================");
    //set this according to you stepper
    Serial.println("Configuring stepper driver");
    //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.SPI_setCoilCurrent(500);
    tmc26XStepper.setMicrosteps(128);
    tmc26XStepper.setStallGuardThreshold(100,0);
    Serial.println("config finished, starting");
    Serial.println("started");

      tmc26XStepper.SPI_setSpeed(50);    //Set speed at 80 RPM
      tmc26XStepper.SPI_step(20);       //set step at -200 steps,  that is to say stepper will turn a circle reverse
      tmc26XStepper.spi_start() ;         //start stepper
      delay(4000);                         //delay 2s


      tmc26XStepper.SPI_step(20);       // set step at 200 steps,  stepper will turn a circle forward
      tmc26XStepper.spi_start() ;
      delay(4000);

      tmc26XStepper.SPI_setSpeed(50);   // Set speed at 100 RPM
   tmc26XStepper.SPI_step(-40);       // stepper will turn 1.5 circles reverse
      tmc26XStepper.spi_start() ;
      delay(4000);

     tmc26XStepper.SPI_setSpeed(120);   // Set speed at 120 RPM
     tmc26XStepper.SPI_step(40);       // stepper will turn 2 circles forward
     tmc26XStepper.spi_start() ;
     delay(4000);
}

void loop() {
  // put your main code here, to run repeatedly:

}

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

//we have a stepper motor with 20 steps per rotation, CS pin 2, dir pin 6, step pin 7 and a current of 800mA
TMC26XStepper tmc26XStepper = TMC26XStepper(20,6,4,5,800);
int curr_step;
int speed =  0;
int speedDirection = -100;
int maxSpeed = 1000;

void setup() {
  Serial.begin(9600);
  Serial.println("==============================");
  Serial.println("TMC26X Stepper Driver Demo App");
  Serial.println("==============================");
  //set this according to you stepper
  Serial.println("Configuring stepper driver");
  //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(128);
  tmc26XStepper.setStallGuardThreshold(60,0);
  Serial.println("config finished, starting");
  Serial.println("started");


}

void loop() {
  if (!tmc26XStepper.isMoving()) {
    speed+=speedDirection;
    if (speed>maxSpeed) {
      speed = maxSpeed;
      speedDirection = -speedDirection;
    } else if (speed<0) {
      speedDirection = -speedDirection;
      speed=speedDirection;
    }
    //setting the speed
    Serial.print("setting speed to ");
    Serial.println(speed);
    tmc26XStepper.setSpeed(speed);
    //we want some kind of constant running time - so the length is just a product of speed
    Serial.print("Going ");
    Serial.print(10*speed);
    Serial.println(" steps");
    tmc26XStepper.step(10*speed);
  } else {
    //we put out the status every 100 steps
    if (tmc26XStepper.getStepsLeft()%100==0) {
      Serial.print("Stall Guard: ");
      Serial.println(tmc26XStepper.getCurrentStallGuardReading());
    }
  }
  tmc26XStepper.move();
}


Thank you

No.

Please give a link to your specific actuator (data sheet).

These are the only details I have.

why are there 2 different programs posted in post #3 and #4?

is it being driven past its endpoint instead of being stopped?

is the motor being driven with the correct voltage? what is that voltage?

what do you expect it to do? what does it do?

A stepper motor is not a linear actuator.

If it is that stepper motor then configure your driver to the indicated phase current of 500mA. This will give a motor power consumption of 10W and consequential heat.

Thank you, I have got the shaft moving now however as the shaft is moving the stallguard LED is flashing still when it couldnt have stalled due to being able to move and not at its end. Is this something to do with the stallguard threshold?

is the voltage too low to move the actuator?

It shouldn't be as it is actually driving.

are you saying that just because it moves it must be sufficient voltage?

didn't you say ...

what is the required votlage?

what is the actuator model # so we can look it up? (not the driver board)

That's normal with more than 5V PSU.

what is PSU?

what does the "stall" like mean?

why would it be active above some voltage?

Power Supply Unit

Maximum current exceeded, typically because a DC motor is blocked from turning freely.

Higher voltage would cause more current on the given coil resistance.

why is this? I dont understand the stall guard threshold either?

It is difficult to detect stall conditions with stepper motors, and the threshold usually needs to be tuned for a specific motor. Perhaps the driver is not a good match for the motor you have chosen.

i'm curious, how would you detect stall on a stepper motor?

on a DC motor, the max current is the supply voltage divided by the winding resistance. this should never occur unless the motor stops turning because BEMF would reduce the effect voltage across the winding

wouldn't the max current on a stepper motor be the voltage divided by the coil resistance. there is no BEMF except while it stepping. that current wouldn't be any greater if it hasn't reached the target position, would it?

so what does the stall light mean?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.