Quantcast
Channel: Arduino Forum - Latest topics
Viewing all articles
Browse latest Browse all 15454

TMC2209 stepper motor

$
0
0

Hello guys,

I am trying to control a stepper motor on my Controllino Maxi using the tmc2209 driver by Trinamic. I am trying to control a bipolar stepper, only on the dir and step pins, so I don't want to use the UART connection. I can't get the motor to move, I have looked at a lot of examples for the wiring but nothing happens, mabe somebody can check my wiring?
tmc 2209: https://cdn-reichelt.de/documents/datenblatt/A200/TMC2209_DATASHEET_V105.pdf
stepper: QSH4218-35-026 https://cdn-reichelt.de/documents/datenblatt/C300/QSH4218_manual.pdf

Here is my wiring:
Notiz 27.02.2024.pdf (182,0 KB)

Here is the code I am using just to get it to run:

 *   Basic example code for controlling a stepper without library
 *      
 *   by Dejan, https://howtomechatronics.com
 */

// defines pins
#define stepPin 5
#define dirPin 6 
 
void setup() {
  // Sets the two pins as Outputs
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
}
void loop() {
  digitalWrite(dirPin,HIGH); // Enables the motor to move in a particular direction
  // Makes 200 pulses for making one full cycle rotation
  for(int x = 0; x < 800; x++) {
    digitalWrite(stepPin,HIGH); 
    delayMicroseconds(700);    // by changing this time delay between the steps we can change the rotation speed
    digitalWrite(stepPin,LOW); 
    delayMicroseconds(700); 
  }
  delay(1000); // One second delay
  
  digitalWrite(dirPin,LOW); //Changes the rotations direction
  // Makes 400 pulses for making two full cycle rotation
  for(int x = 0; x < 1600; x++) {
    digitalWrite(stepPin,HIGH);
    delayMicroseconds(500);
    digitalWrite(stepPin,LOW);
    delayMicroseconds(500);
  }
  delay(1000);
}

pins 5 and 6 are D2 and D3 on the Controllino Maxi

3 posts - 2 participants

Read full topic


Viewing all articles
Browse latest Browse all 15454

Trending Articles