MeAuriga Crash and Reboot when MeStepper and MeDCMotor are working


#1

Hi everyone,

I’m currently working on a project in which i connected a MeDCMotor that works while a MeStepper motor is moving the dc motor.

It happens that when the dc motor is switched off, the stepper is working correctly.

But when the dc motor and the stepper motor are running at the same time, the behaviour is unexpected: sometimes the stepper motor seems broken, sometimes my MeAuriga crashes and reboot continuously.

Can anyone help me to address this strange behaviour?

Thanks,

Diego


#2

Can you post your code?


#3

Hi @chuckmcknight, in my code I’m using the steppers from the XY Plotter but instead of a pencil or a laser I’m using a pump connected via a Me Dual DC Motor Driver.

Here is my code:

#include "MeAuriga.h"

MeDCMotor pump2(PORT_4);

MeLimitSwitch x_limitSwitchMin(PORT_7, SLOT1);
MeLimitSwitch x_limitSwitchMax(PORT_7, SLOT2); 

MeLimitSwitch y_limitSwitchMin(PORT_8, SLOT1); 
MeLimitSwitch y_limitSwitchMax(PORT_8, SLOT2); 

MeLimitSwitch y_limitSwitchMinScaffale(PORT_9, SLOT1); 
MeLimitSwitch y_limitSwitchMaxScaffale(PORT_9, SLOT2); 

===================

pump2.run(255);

while
(
  !x_limitSwitchMax.touched() &&
  !(y_limitSwitchMax.touched() || y_limitSwitchMaxScaffale.touched())
) {

  /*
      MOVE UP
  */

  while (!y_limitSwitchMax.touched() && !y_limitSwitchMaxScaffale.touched()) {

    checkYLimitSwitchMax();

  }

  /*
      MOVE RIGHT
  */

  int initialPosition = x_stepper.currentPosition();

  while (!x_limitSwitchMax.touched() && x_stepper.currentPosition() != (initialPosition - 400)) {

checkXLimitSwitchMax(initialPosition);

  }


  /*
      MOVE DOWN
  */

  while (!y_limitSwitchMin.touched() && !y_limitSwitchMinScaffale.touched()) {

    checkYLimitSwitchMin();
  }

  /*
      MOVE RIGHT
  */

  initialPosition = x_stepper.currentPosition();

  while (!x_limitSwitchMax.touched() && x_stepper.currentPosition() != (initialPosition - 400)) {

    checkXLimitSwitchMax(initialPosition);

  }

}

pump2.stop(); 

==================

void checkYLimitSwitchMax() {

  //Serial.println("checkYLimitSwitchMax");

  if ((!y_limitSwitchMax.touched() && !y_limitSwitchMaxScaffale.touched())) {
moveUpStepper();
  }
}

void moveUpStepper() {

  stopXStepper();
  restoreYStepper();

  y_stepper.move(-10);
  y_stepper.run();

  checkYLimitSwitchMax();
}

void checkYLimitSwitchMin() {

  if (!y_limitSwitchMin.touched() && !y_limitSwitchMinScaffale.touched()) {
moveDownStepper();
  }
}

void moveDownStepper() {

  stopXStepper();
  restoreYStepper();

  y_stepper.move(10);
  y_stepper.run();
  checkYLimitSwitchMin();
}

void checkXLimitSwitchMax(int initialPosition) {

  if (!x_limitSwitchMax.touched() && x_stepper.currentPosition() != (initialPosition - 400)) {
moveRightStepper(initialPosition);
  }
}

void moveRightStepper(int initialPosition) {

  restoreXStepper();
  stopYStepper();

  x_stepper.move(-10);
  x_stepper.run();
  checkXLimitSwitchMax(initialPosition);
}

If launched, the y_stepper motor stops while moving, it makes a strage noise (like if there’s an obstacle and can’t go on) and the board crashes and reboots.
If you comment the pump2.run() method, everything works fine.

The MeAuriga is connected to current via Wall Adapter 12V 3A (http://amzn.eu/iLlSa0j) .

Please let me know,

Diego


#4

Could it be possible that the DCMotor and the StepperMotor are draining too much current causing the reboot of the board?


#5

That’s an excellent point to investigate. A brownout condition will make the board reboot. I’m assuming that you are using fully charged batteries?


#6