Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ESP8266 (Wemos D1) in combination with stepper motor driver tmc2310, heat problem and force hold problem. #102

Open
eleminer opened this issue May 2, 2022 · 1 comment

Comments

@eleminer
Copy link

eleminer commented May 2, 2022

Hello all,
I've been trying to connect a stepper motor driver to a Nema 17 and a Wemos D1 (ESP8266) for several days now.
I now have a sketch where the motor turns and is also very very quiet. (not audible).
The motor draws 400mA at 12V and gets very very warm.
Can anyone help me with this? Why does the motor get so warm?
On my 3D printer, for example, it stays completely cold. :/

#define EN_PIN    13
#define DIR_PIN   0
#define STEP_PIN  2
#define CS_PIN    5
#define MOSI_PIN  12
#define MISO_PIN 4
#define SCK_PIN  14

bool dir = true;

#include <TMC2130Stepper.h>
TMC2130Stepper driver = TMC2130Stepper(EN_PIN, DIR_PIN, STEP_PIN, CS_PIN, MOSI_PIN, MISO_PIN, SCK_PIN);

void setup() {
  Serial.begin(9600);
  while (!Serial);
  Serial.println("Start...");
  driver.begin(); 			// Initiate pins and registeries
  driver.rms_current(300); 	// Set stepper current to 600mA. The command is the same as command TMC2130.setCurrent(600, 0.11, 0.5);
  driver.stealthChop(1); 	// Enable extremely quiet stepping
  driver.microsteps(32);
  driver.chopper_mode(1);
  driver.random_off_time(1);


  digitalWrite(EN_PIN, LOW);

  Serial.print("DRV_STATUS=0b");
  Serial.println(driver.DRV_STATUS(), BIN);
}

void loop() {
  digitalWrite(STEP_PIN, HIGH);
  delayMicroseconds(150);
  digitalWrite(STEP_PIN, LOW);
  delayMicroseconds(150);
  uint32_t ms = millis();
  static uint32_t last_time = 0;
  if ((ms - last_time) > 10000) {
    if (dir) {
      Serial.println("Dir -> 0");
      driver.shaft_dir(0);
    } else {
      Serial.println("Dir -> 1");
      driver.shaft_dir(1);
    }
    dir = !dir;
    last_time = ms;
  }
}
@eleminer
Copy link
Author

eleminer commented May 2, 2022

I use this stepper motor.
https://www.pollin.de/productdownloads/D310453D.PDF

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant