Go Down

Topic: Connecting/driving a Large SureStep Stepper motor with Arduino Uno (Read 4971 times) previous topic - next topic

dakujr

Hello,

I have a stepper motor from Automation direct STP-MTRH-34097: http://www.automationdirect.com/static/specs/surestepmotors.pdf

And the stepping Drive STP-DRV-80100: http://www.automationdirect.com/static/specs/surestepdrive.pdf

The Stepper is a NEMA 34 with 800 Oz-in torque and a rated current of 6.3 Amp/Phase.

How do we connect big motors like the one above to Arduino and control its direction and speed?

One example I found online is here:
 http://www.nyccnc.com/driving-large-nema-34-stepper-motors-with-arduino.html

The driver board used in the above example is here:
 http://g03.s.alicdn.com/kf/HTB1SmVRGXXXXXXqXVXXq6xXFXXXq/206137637/HTB1SmVRGXXXXXXqXVXXq6xXFXXXq.jpg

But if I follow the same steps with my driver it does not work. Here is the schematic:- http://postimg.org/image/4ksx726jh/

And here is the code:-

#include <AccelStepper.h>

// Define a stepper and the pins it will use
AccelStepper stepper(1,8,9);

void setup()

  stepper.setMaxSpeed(150);
  stepper.setAcceleration(100);
}

void loop(){   
stepper.moveTo(500);
  while (stepper.currentPosition() != 300) // Full speed up to 300
    stepper.run();
  stepper.stop(); // Stop as fast as possible: sets new target
  stepper.runToPosition();
  // Now stopped after quickstop

  // Now go backwards
  stepper.moveTo(-500);
  while (stepper.currentPosition() != 0) // Full speed basck to 0
    stepper.run();
  stepper.stop(); // Stop as fast as possible: sets new target
  stepper.runToPosition();
  // Now stopped after quickstop
}


What could be the reason(s)?

Thank you for going through this!



MarkT

Stepper drives are opto-isolated and either have bare opto coupler
inputs or with resistors built in.  If with resistors you just drive the step (PUL+),
direction (DIR+) and enable (ENA+) lines from Arduino and return all the
cathodes to Arduino ground.

If without resistors you simply add 150 ohm or 220 ohm resistors into each
signal yourself.

The particular model of drive linked above might have common anodes on the
opto coupler (not sure from the marking), in which case you connect to the PUL-, DIR-,
ENA- using negative logic and return the anodes to Arduino +5V.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

dakujr

Thank you Mark!

Yes, the STP-DRV-80100 is opto-isolated so I connected the arduino as shown here:-
 http://postimg.org/image/4ksx726jh/

Still no movement of the stepper :(

Any possible solutions?


dakujr

I connected a small NEMA 17 stepper to test the system as it was not driving the large NEMA 34. But the

stepper did not work (motor does not spin).

The connection pictures are here:-

http://postimg.org/image/mzxth9x99/

http://postimg.org/image/mogd4igt9/

http://postimg.org/image/5pc02zuzh/

Can you check the connection and see if I am doing it right?

MarkT

No, you have not connected to the enable inputs, so obviously nothing will happen.

I mentioned these already.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

dakujr

Sorry, I am new to Arduino and electronics in general.
From the step drive manual: middle of page 4-9 on : http://www.automationdirect.com/static/manuals/surestepmanual/ch4.pdf

"The ENABLE input allows the user to turn off the current to the motor by providing
a 5-12 VDC positive voltage between EN+ and EN-"
So I assumed EN pins are used for limit switches type of scenario.

Did you mean: STEP-,DIR-,EN- pins are connected to Arduino Ground (cathode)?
                    STEP+ to pin 9 , DIR+ to Pin 8 on arduino. (But how about EN+?)

I did not understand "in which case you connect to the PUL-, DIR-, ENA- using negative logic and return the anodes to Arduino +5V."
Does it mean: STEP- to pin 9 , DIR- to Pin 8 on arduino. (But how about EN-?)
                   STEP+,DIR+,EN+ pins are connected to Arduino +5V (Anode)?

This step drive is opto isolated and assuming it is has common anodes on the optocoupler, it would be great if you can point to me which drive pin is connected to where on the arduino?
STEP drive pins:
STEP+/-, DIR+/-,EN+/-
Arduino PINS:
+5V, GND, 8(DIR), 9(STEP). Again where is the EN+/- pin connected to on Arduino?

dakujr

I might have found the problem. In my setup Arduino  Pin 8 is connected to DIR- and Pin 9 is connected to STEP-
And my  Accelstepper library is declared as: AccelStepper stepper(1,8,9);
indicating PIN 8 to be step and PIN 9 to be direction.
I realized this from reading about the accelstepper library on https://www.pjrc.com/teensy/td_libs_AccelStepper.html
Where it says: AccelStepper mystepper(1, pinStep, pinDirection);

So I swapped the pins around i.e. PIN 8 to STEP- and PIN 9 to DIR-  in my setup and the stepper works fine now.
So the new setup look like this:-
http://postimg.org/image/nvlkom93x/


Thank you for your inputs. It helped me a lot!


flytyer232

I think you may be right..... I have been doing too of the brute force programming, just throwing things at the problem, and not really understanding them.

What exactly does this part of the code mean:

Code: [Select]

void loop(){   
stepper.moveTo(5000);
  while (stepper.currentPosition() != 4000) // Full speed up to 300
    stepper.run();
  stepper.stop(); // Stop as fast as possible: sets new target
  stepper.runToPosition();
  // Now stopped after quickstop



I am thinking the 4000, in the while loop, means that the stepper motor goes full speed till 4000 steps, and then begins to ramp down? since the total movement steps would be 5000, this mean that the ramp down period is 1000 steps?

I really appreciate your help, like i said i am not a programmer by nature.....

0504698


Go Up