TB6600 Alarm LED

Hi all,

I've written a program that gives me three different options depending which button I press: 1. run procedure, 2. homing procedure, 3. quick return to home procedure. Eventually I'll be hooking up two additional steppers and limit switches, but that's besides the point.

I'm currently using a TB6600 motor driver purchased from Amazon. Included datasheet is basically useless. HERE is a generic one I found on google. My question is in regards to the ALARM or ALERT led that lights up on the TB6600. I'm not entirely sure what this led is supposed to notify me of, but I've read that when the stepper motor is idle the led should be on and when the stepper motor is running the led should pulse. I've also read that when this led is on it means the TB6600 is warning me of overcurrent. I'm not sure what to follow.

When I run the "homing program" below, the alarm led is on at startup. Upon hitting the run procedure or homing procedure button, the alarm led remains off even after the stepper motor has completed it's motion. Is it critical for this led to turn back on when the motor isn't running or does it not really matter? I guess I'm just concerned if how I've written my program will lead to any hardware damage in the long term.

In a separate program I've written, the alarm led is on during idle, pulses during motion, then turns back on when it goes back to idle. The code is also attached below.

Thanks

Homing program

#include <AccelStepper.h>

AccelStepper stepperX(AccelStepper:: DRIVER, 2, 5); // driver mode enabled
                                                    // pin 2 connected to pulse+
                                                    // pin 5 connected to dir+

const int button1Pin = 8;
const int button2Pin = 9;
const int button3Pin = 10;
const int homeSwitch = 11;
int button1State = LOW;
int button2State = LOW;
int button3State = LOW;
long initial_homing = -1; // used for homing procedure

void setup(){
  pinMode(homeSwitch, INPUT_PULLUP);
  
  stepperX.setMaxSpeed(4000);
  stepperX.setAcceleration(2000);
}

void loop(){
  button1State = digitalRead(button1Pin); // button 1 for run procedure
  button2State = digitalRead(button2Pin); // button 2 for homing procedure
  button3State = digitalRead(button3Pin); // button 3 fast motion to home

  // homing procedure //
  if(button2State == HIGH){
    stepperX.setMaxSpeed(1000);
    stepperX.setAcceleration(1000);

    // stepper moves ccw until the switch is activated
    while(digitalRead(homeSwitch)){
      stepperX.moveTo(initial_homing);
      initial_homing--;
      stepperX.run();
      delay(5);
    }

    stepperX.setCurrentPosition(0); // set current position as zero for now
    stepperX.setMaxSpeed(100); // slower speed for limit switch retraction
    stepperX.setAcceleration(100);
    initial_homing = 1;

    // stepper moves cw until the limit switch is deactivated
    while(!digitalRead(homeSwitch)){
      stepperX.moveTo(initial_homing);
      stepperX.run();
      initial_homing++;
      delay(5);
    }

    stepperX.setCurrentPosition(0); 
    stepperX.setMaxSpeed(4000);
    stepperX.setAcceleration(2000);
  }

  // run procedure //
  if(button1State == HIGH && stepperX.distanceToGo() == 0)
  stepperX.move(4252); // 1mm/800 steps at 1/8th microstepping
  stepperX.run();

  // quick return to home position //
  if(button3State == HIGH){
    stepperX.setMaxSpeed(2000);
    stepperX.setAcceleration(1000);
    stepperX.moveTo(0); 
    stepperX.run();
  }
}

Just spinning program

#include <AccelStepper.h>

AccelStepper stepperX(AccelStepper:: DRIVER, 2, 5); // driver mode enabled
                                                    // pin 2 connected to pulse+
                                                    // pin 5 connected to dir+

AccelStepper stepperY(AccelStepper::DRIVER, 3, 6); // driver mode enabled
                                                   // pin 3 connected to pulse+
                                                   // pin 6 connected to dir+

AccelStepper stepperZ(AccelStepper::DRIVER, 4, 7); // driver mode enabled
                                                   // pin 4 connected to pulse+
                                                   // pin 7 connected to dir+
// pin assignments //
const int button1Pin = 8;
const int button2Pin = 9;
const int homeXPin = 10;

// pin states //
int button1State = LOW;
int button2State = LOW;

void setup(){
  stepperX.setMaxSpeed(4000);
  stepperX.setAcceleration(2000);

  stepperY.setMaxSpeed(4000);
  stepperY.setAcceleration(2000);

  stepperZ.setMaxSpeed(4000);
  stepperZ.setAcceleration(2000);
}

void loop(){
  button1State = digitalRead(button1Pin);
  
  if (button1State == HIGH && stepperX.distanceToGo() == 0)
  stepperX.move(1600); // 1mm/800 steps or 800 steps/.5 revolution
  stepperX.run();

  if (button1State == HIGH && stepperY.distanceToGo() == 0)
  stepperY.move(3200); // 1mm/800 steps or 800 steps/.5 revolution
  stepperY.run();

  if (button1State == HIGH && stepperZ.distanceToGo() == 0)
  stepperZ.move(3200); // 1mm/800 steps or 800 steps/.5 revolution
  stepperZ.run();
  
}