Go Down

Topic: Stepper driver shutoff?  (Read 1 time) previous topic - next topic

smorale1

Hi, (new to the forum, not new to arduino)

For a project I am using 3 steppers (nema 23s) and controlling them though a Big Easy Drive each.

The 3 motors are attached to the celling and each connects to the same platform at a different point (see image attached). When the time comes they move in different ways making the platform/sculpture dance. It all seems to be working fine until one (any) of the motors won't return to its original position and will keep rotating until the corner of the platform starts hitting the celling.





I don't know how to fix this, but disconnecting the power to the drivers makes the entire thing fall back into place. Is there a way to interrupt the power to the drivers through code without fiscally having some relay? Or make the steppers move freely? This way I could just reset everything every few moves just to make sure this doesn't happen.

Thoughts?
(Here more info and a video of the project)
Thanks,

Sebastian

Robin2

I think if you trigger the enable pin on the driver board it cuts power to the motors - I don't have a BigEasydriver.

You could also use a relay controlled by the Arduino to switch the motor power.

However that is a very crude solution for the problem you describe. There must be some fixable reason for the errant behaviour.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Peter_n

#2
Jan 17, 2015, 10:09 am Last Edit: Jan 17, 2015, 10:10 am by Peter_n
Hi, welcome to the forum.

Thanks for the photos and information, but we are mainly interested in the sketch (the code in the Arduino), the used libraries, the hardware, the wiring and the power supply. It seems that there might be a bug in the sketch. I agree with Robin2, it is better to find the reason why it is doing this.

A sketch can be inserted in a post between code tags.
Which Arduino board are you using ?
Do you use this driver board ? https://www.sparkfun.com/products/11876

TomGeorge

Hi, how do you know where the platform is when you turn it on?
There does not appear to be any way of you knowing when the platform is about to run out of space.
You cannot count steps because you have no idea of initial position, also if it slips a step then it will be out of step.
You need a switch on each winding drum that senses when the platform is getting to close, this then tells the controller to stop and reverse that particular motor.
Nice design and concept, just needs a little more....

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

smorale1

#4
Jan 17, 2015, 08:20 pm Last Edit: Jan 17, 2015, 08:30 pm by smorale1
Hi thanks for your quick response, I'll answer the questions and then show some code.
  • I could try the enable pin and see what happens.
  • I'm using a Mega
  • I am using sparckfun's big easy drive
  • Nemas 23
  • 12V 5amp power supply for the motors, lights and board
  • xBee radios to communicate with each platform from a Pi
  • In terms of position and keeping track, when the power is shut off the weight of the platform will turn the winding drums until the cables are stretched, in other words it reaches it's "home" position. After that I keep track of the positioning with the AccelStepper.h library.


The code for the motors looks something like this:

Code: [Select]
//Steppers
#include <AccelStepper.h>

int motorSpeed = 15000; //maximum steps per second (about 3rps / at 16 microsteps)
int motorAccel = 3000; //steps/second/second to accelerate default 80000
int maxHeight=7000;
int stepperHome=500;

//Dance movement
#define DANCE          24
float dance1=1000;
float dance2=1000;
float dance3=1000;
int randRange=5000;

void setup(){
  Serial.begin(9600);
  initializeMotors();//This initializes the Motors.
}

void loop(){
  for (int i=0;i<DANCE;i++){                       //this will create a random dance with 24 different movements
    setMoveTo(dance1, dance2, dance3);
    runMotor();
    dance1=(random(stepperHome,randRange));
    dance2=(random(stepperHome,randRange));
    dance3=(random(stepperHome,randRange));
  }
  zero();//return to home position
}

void zero(){
  setMoveTo(stepperHome, stepperHome, stepperHome);
  runMotor();
}

void initializeMotors(){
  stepper1.setMaxSpeed(motorSpeed);
  stepper2.setMaxSpeed(motorSpeed);
  stepper3.setMaxSpeed(motorSpeed);

  stepper1.setSpeed(motorSpeed);
  stepper2.setSpeed(motorSpeed);
  stepper3.setSpeed(motorSpeed);

  stepper1.setAcceleration(motorAccel);
  stepper2.setAcceleration(motorAccel);
  stepper3.setAcceleration(motorAccel);
}

void setMoveTo(int step1, int step2, int step3) {
  stepper1.moveTo(step1);
  stepper2.moveTo(step2);
  stepper3.moveTo(step3);
}





Robin2

That is not a complete code. Please post the whole thing.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

smorale1

hmmm... It won't let me post the entire thing, it exceeds more than 9000 characters.

smorale1

It does look like the enable pin might work

"ENABLE: This input is pulled down on the board with a 20K Ohm resistor. You can
leave it disconnected, or you can drive it from your microcontroller. When low, the driver
chip is enabled and the motor is energized. When high, the driver chip is still enabled, but
all of the final motor drive circuits are disabled and so no current will flow to the motor. "

http://www.schmalzhaus.com/BigEasyDriver/BigEasyDriver_UserManal.pdf

Robin2

hmmm... It won't let me post the entire thing, it exceeds more than 9000 characters.
You can add it as an attachment.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up