Hello!
i could need some insights on how to control my new stepper motor:
i got the 17HS15-1504S-X1 and the tmc2208.
Now i need the RPM of about 100.
For now i did most like this: Stepper Motor Driver TMC2208 - FabLab Kannai - Fab Academy 2022
But wasnt able to use the tmc-lib since i dont understand the sample of the imported lib completly and was scared of doing something wrong ![]()
Wiring like this
Right now im using this code for testing:
/*
SilentStepStick TMC2208/TMC2209 Example
Rsense: 0.11 Ohm
Other examples/libraries can be found here:
https://github.com/teemuatlut/TMCStepper
https://github.com/trinamic/TMC-API
https://github.com/manoukianv/TMC2208Pilot
Example source code free to use.
Further information: https://learn.watterott.com/license/
*/
// Note: You also have to connect GND, 5V/VIO and VM.
// A connection diagram can be found in the schematics.
#define EN_PIN 7 //enable (CFG6)
#define STEP_PIN 8 //step
#define DIR_PIN 9 //direction
void setup()
{
//set pin modes
pinMode(EN_PIN, OUTPUT);
digitalWrite(EN_PIN, HIGH); //deactivate driver (LOW active)
pinMode(DIR_PIN, OUTPUT);
digitalWrite(DIR_PIN, LOW); //LOW to CCW
//digitalWrite(DIR_PIN, HIGH); //HIGH to CW
pinMode(STEP_PIN, OUTPUT);
digitalWrite(STEP_PIN, LOW);
digitalWrite(EN_PIN, LOW); //activate driver
}
void loop()
{
//make steps
digitalWrite(STEP_PIN, HIGH);
delay(2);
digitalWrite(STEP_PIN, LOW);
delay(2);
}
But even with delay(1) its to slow. I thought it would mean 2ms per step, with 200 steps=> 400ms per full rotation. But it takes roughly 3seconds per full rotation. So this might be due to the step-length (e.g. full step, half, 1/4 ..).
But where do i control this - since it doesnt seem to be controlled via software.
Also: for the small stepper motor of the arduno starter kit i used the stepper.h -lib. With that i could set the speed to e.g 300 or something like this. Is it possible to use this lib while using the tmc or is it like "one or the other"?
Im sorry, its like there is SO MUCH knowledge online - but im confused by all the different aproaches, wiring, components..
