Robin2:
We need to see your program.
Also please post a link to the datasheet for your stepper motor.
The speed of a stepper motor is determined by the interval between step pulses. And if you want a high speed you need to accelerate the motor - just like any other motor, a stepper motor cannot change instantly from stationary to high speed.
In general a higher voltage power supply (within the limits acceptable to the driver) will be needed for higher speeds. The driver needs to be set to limit the current to whatever is appropriate for your motor.
...R
Stepper Motor Basics
Simple Stepper Code
also look up the AccelStepper library
Hi,
this is the code im using, it has nothing to indicate what speed it should rotate, it rotates the way it is with supply im providing it, but I consider it way too slow, which is why i'd like to increase it by even a bit. I must say that with A4988 it did spin much faster compared to TMC2209 on same settings, but I consider tmc2209 much higher quality and provides many more options, so I'd like to achieve higher speed through coding if possible. Also I am using arduino Nano

int DIR = 5; DIR PIN
int STEP = 6; //step pin
int Power_Relay = 3;
int SW_Sunpoint = 2;
int photo_res = A1;
int step_count = 0;
int check_s = 0;
bool poweron = 0;
int MODE = 0;
void setup() {
// put your setup code here, to run once:
pinMode(DIR, OUTPUT);
pinMode(Power_Relay, OUTPUT);
pinMode(STEP, OUTPUT);
pinMode(SW_Sunpoint, INPUT);
digitalWrite(DIR, HIGH);
Serial.begin(9600);
digitalWrite(Power_Relay, HIGH);
Serial.println("POWER OFF initially");
digitalWrite(STEP, LOW);
}
void loop() {
int brightness = analogRead(photo_res);;
Serial.println(brightness);
if (brightness > 395) {
MODE = 1;
Serial.println("DAY MODE");
}
else if (brightness < 350) {
MODE = 2;
Serial.println("NIGHT MODE");
}
else {
MODE = 0;
Serial.println("IN BETWEEN DAY & NIGHT");
}
if (MODE == 1) {
if (poweron == 0) {
Serial.println("Electricity ON");
digitalWrite(Power_Relay, LOW);
for (;;) {
Serial.println("Rotating");
digitalWrite(DIR, HIGH);
digitalWrite(STEP, HIGH);
delay(10);
digitalWrite(STEP, LOW);
delay(10);
check_s=1;
step_count++;
if (digitalRead(SW_Sunpoint)) {
poweron = 1;
digitalWrite(Power_Relay, HIGH);
Serial.println("Electricity OFF");
break;
}
}
}
else {
digitalWrite(Power_Relay, HIGH);
}
}
else if (MODE == 2 && check_s==1) {
Serial.println("Night Detected");
digitalWrite(Power_Relay, LOW);
Serial.println("Electricity ON");
while (step_count > 0) {
digitalWrite(DIR, LOW);
digitalWrite(STEP, HIGH);
delay(10);
digitalWrite(STEP, LOW);
delay(10);
step_count--;
}
check_s=0;
poweron = 0;
digitalWrite(Power_Relay, HIGH);
Serial.println("Electricity OFF");
//
}
else{
digitalWrite(Power_Relay, HIGH);
}
}



