Driving 4 Steppers With a Push Button/Homing. -Overheating Drivers and More.

Hi! I'm working on my first Arduino project where I'm attempting to rotate 4 display panels 180* simultaneously with a momentary push button and then 180* in the reverse direction with a second button using Nema 23 stepper motors and TB6600 Drivers.
I would also like to add a simple RF reciever to do the same thing remotely but first thing first.

My first attempt was spent using ac motors, limit switches and magnets. It worked well unloaded but as weight was added to the panels a slew of problems arouse not relevant to this forum. Here's a simple sketch of what I'm trying to achieve:

On to the Arduino.

I started with 1 stepper, driver and Uno and wired them per DFRobot's Diagram and ran the sample code provided by DFRobot:

int PUL=7; //define Pulse pin
int DIR=6; //define Direction pin
int ENA=5; //define Enable Pin
void setup() {
  pinMode (PUL, OUTPUT);
  pinMode (DIR, OUTPUT);
  pinMode (ENA, OUTPUT);

}

void loop() {
  for (int i=0; i<6400; i++)    //Forward 5000 steps
  {
    digitalWrite(DIR,LOW);
    digitalWrite(ENA,HIGH);
    digitalWrite(PUL,HIGH);
    delayMicroseconds(50);
    digitalWrite(PUL,LOW);
    delayMicroseconds(50);
  }
  for (int i=0; i<6400; i++)   //Backward 5000 steps
  {
    digitalWrite(DIR,HIGH);
    digitalWrite(ENA,HIGH);
    digitalWrite(PUL,HIGH);
    delayMicroseconds(50);
    digitalWrite(PUL,LOW);
    delayMicroseconds(50);
  }
}

This is where the first problem arose. The motor ran, but only in one direction continually for roughly 30-45seconds before the TB6600 shut down and signaled the Alarm LED. It never reversed direction and ran the other way so I couldnt figure out if i was executing the correct amount of steps with this code. I also cant figure out if the shutdown is due to thermal or current protection, wiring, coding etc. The driver isn't alarmingly hot to the touch.

Determined to get a motor to step 180* I started fooling around with the AccelStepper library. My wiring remains the same and it looks like the AccelStepper library is just using step and direction so my enable - signal is not doing anything.

Running this simple script instead, I was able to rotate the motor exactly 180* but ONLY when microstepping was set to 1 on the TB6600. Here is the new script:

#include<AccelStepper.h>

AccelStepper stepper(1, 7, 6);

int target = 9331/2;

void setup()
{
  stepper.setMaxSpeed(2000);
  stepper.setAcceleration(3500);
  stepper.move(target);
}
void loop()
{
  //while (stepper.distanceToGo()!=0)
  {
    stepper.run();
   
   
  }
}

Keep in mind the Nema 23 stepper that I'm using has a 46.656 planetary reducer so at 200 steps per rotation it takes 9,331.2 theoretical steps to rotate the output shaft 360*. Again, this will only work with microstepping at 1.
With microstepping set to 4,8,16 or 32 on the driver and the initial target values corrected in the code the stepper will not reach its target. It even behaves as strangely as it will sometimes rotate less after increasing the target value. For example with a target value of 20,000 it might turn 360* but with a target value of 200,000 it will turn 90*. And then of course the problem of the driver shutting down after a few minutes of experimenting.

To summarize my first point of attack is figuring out why the drivers are shutting down. Once this is solved I would like to move forward to the programming and adding in the buttons/RF/Homing of the steppers as the planetary reducers don't seem to allow movement from external forces. Therefore manual homing is out of the question.

Any and all help is greatly appreciated. I'm new at this. The only programming experience i have is introductory Matlab stuff and a few led tutorials so Im way outside of my comfort zone. Its been a short journey just getting the motors to turn after starting with a l298 h bridge and then a gecko g540 from a cnc project to now.

Here are some stepper motor,driver and PS specs:

TB6600 Driver
Feature:

PWM chopper type bipolar stepper motor driver IC

  1. 9V-42V DC power supply
  2. H bridge bipolar constant phase flow drive
  3. the maximum 4.0A of the eight kinds of output current
  4. the largest 32 subdivision of the 6 models are optional
  5. input signal high speed photoelectric isolation
  6. common-anodestandard single pulse interface
  7. offline to maintain the function
  8. semi closed enclosure can be adapted to a more stringent environment
  9. to provide energy-saving semi-automatic current lock function
  10. built-in temperature protection and over current protection.
    Can control 2 phase stepper motor forward and reverse rotation, With 1-2, W1 -2 , 2W1 -2, 4W1 -2 phase excitation mode.
    Only the clock pulse signal can be driven two-phase bipolar stepper motor to achieve low vibration, high efficiency work.

IC parameter:

single chip bipolar sine microstep stepper motor driver
the new BiCD 0.13 nm process
up to 42V
resistance (a +) = 0.4
?the forward and reverse rotation control
5 subdivision mode options (1/1, 1/2, 1/4, 1/8, 1/16,1/32)
output current: IOUT = 4.0A (peak, in 100ms)
rated output: IOUT = 3.5 A
package: HZIP25 - 1.00F
input port internal pull-down resistor: 100 K
alarm output pin current:Ialert = 1mA
monitoring output pin (MO): Imo= 1mA
with reset and enable pin
with standby function
Break through the traditional, single power supply
built in overheating protection (TSD) circuit
Undervoltage protection, built-in (UVLO) circuit
built-in overcurrent detection (ISD), circuit

Package Included:

1 x Motor Driver
1 x Box

Power Supply is a 40v 10A 400w unit

The motor drivers are shutting down because you are overloading them, probably having failed to set the current limit correctly.

Post a link to the motor data sheet (NEMA 23 defines the size of the motor mounting plate and tells us nothing useful).

The data sheet to the Nema 23s was included in my first post. Final embedded image towards the bottom.

The current setup on the TB6600s happens through a row of dip switches.
Here's my driver:

Here's how I have it configured:

Start with a much lower speed and, especially, a much lower rate of acceleration.

You have posted a picture of the DIP switches. It would be much better if you just tell us how you have configured the driver. We will assume you are telling the truth :slight_smile:

...R

That is correct Robin. Surprisingly enough, I'm aware of which images I posted :slight_smile:
I also like to add as much content as possible for anyone else that finds this thread later on down the road with the same questions.

The dip switches are configured (ON,ON,OFF) for S1 - S3, setting Micro Step to 1. And (OFF,OFF,ON) for S4 - S6, setting the current to 2.8A. (ON being the down position and OFF being up.)

In regards to the speed and acceleration. I started with lower values and I also tried higher values. The current values are where the motors seem to be the happiest so i guess you'll just have to believe me.

Also, it doesn't matter if the steppers are running or if they're just idling. The shutdown occurs regardless within a few minutes.

Some interesting developments

I ran an experiment with a 3rd piece of code provided by a Brainy-Bits tutorial on homing steppers using the AccelStepper library. (Hats off to that guy for sharing. Rather than spamming this thread with multiple varieties of code here's a link instead for anyone that wants to check it out: https://www.brainy-bits.com/setting-stepper-motors-home-position-using-accelstepper/)

The idea is when the arduino is powered on it immediately rotates the stepper until it reaches a limit switch and then it rotates the opposite direction until the switch is released at which point you can input a value using the serial monitor and the stepper will moveTo that value. Great

So I power up 3 drivers and stepper motors with the same power supply and I wire just one of them to the UNO that's running the Brainy-Bits code.

The motor spins continually looking for the home switch. After a few minutes, the two drivers that aren't wired to the Arduino go into the Alarm shutdown mode while the homing motor continues to rotate.

After another 5 minutes or so I press the limit switch and start controlling the motor with the serial monitor. speed and accel values are set to 1000.

I complete a series of rotations for another minute or so until the driver finally reaches Alarm shutdown.

Why is it taking the Driver/Stepper that's performing motion longer to reach shutdown than the Driver/Steppers that are at rest?
**Does anyone have suggestions about this and or the wiring/stepper/driver/power supply combination? **

Maybe those display panels are acting like fans and cooling their motors? How fast are they turning? Pushing air out of the way can take a lot of energy (varies with SQUARE of speed change), double the speed = 4 times the force.
Drop your current limit back a step (2.5A?), see if that helps. You may need to fan cool the drives.

Changing the code should not have any effect on the overheating of a stepper driver if the driver is suitable for the job.

What happens if you set the max current to a lower value - try 1.5 amps? I know that may not be satisfactory for your project but if it has the effect of stopping the unexplained shut-downs it would suggest that your stepper-driver is not up to the task regardless of what is printed on it.

..R