Stepper Control

I am using a Arduino nano with TB6600 stepper driver and basic code like

// Define pin connections & motor's steps per revolution
const int dirPin = 2;
const int stepPin = 3;
const int stepsPerRevolution = 200;

void setup()
{
	// Declare pins as Outputs
	pinMode(stepPin, OUTPUT);
	pinMode(dirPin, OUTPUT);
}
void loop()
{
	// Set motor direction clockwise
	digitalWrite(dirPin, HIGH);

	// Spin motor slowly
	for(int x = 0; x < stepsPerRevolution; x++)
	{
		digitalWrite(stepPin, HIGH);
		delayMicroseconds(2000);
		digitalWrite(stepPin, LOW);
		delayMicroseconds(2000);
	}
	delay(1000); // Wait a second
	
	// Set motor direction counterclockwise
	digitalWrite(dirPin, LOW);

	// Spin motor quickly
	for(int x = 0; x < stepsPerRevolution; x++)
	{
		digitalWrite(stepPin, HIGH);
		delayMicroseconds(1000);
		digitalWrite(stepPin, LOW);
		delayMicroseconds(1000);
	}
	delay(1000); // Wait a second
}

And

// Include the AccelStepper Library
#include <AccelStepper.h>

// Define pin connections
const int dirPin = 2;
const int stepPin = 3;

// Define motor interface type
#define motorInterfaceType 1

// Creates an instance
AccelStepper myStepper(motorInterfaceType, stepPin, dirPin);

void setup() {
	// set the maximum speed, acceleration factor,
	// initial speed and the target position
	myStepper.setMaxSpeed(1000);
	myStepper.setAcceleration(50);
	myStepper.setSpeed(200);
	myStepper.moveTo(200);
}

void loop() {
	// Change direction once the motor reaches target position
	if (myStepper.distanceToGo() == 0) 
		myStepper.moveTo(-myStepper.currentPosition());

	// Move the motor one step
	myStepper.run();
}

but my issue is my motor is making too much noise and is vibrating i have try adjusting current,microsteping but nothing seem to working is there any solution i have try different motor it is only working smooth in expensive motor and driver but i need low cost parts.

If this is a newly wired motor circuit, you may have the wires connected incorrectly.

No i have check wiring many time it is correct

Do you have the drive's current limit set to suit your motor? How is your microsteps set? This should be 250 steps per second or 75 RPM, does it look close to that?

for(int x = 0; x < stepsPerRevolution; x++)
	{
		digitalWrite(stepPin, HIGH);
		delayMicroseconds(2000);
		digitalWrite(stepPin, LOW);
		delayMicroseconds(2000);
	}

i have try different micro step and yes i have set current that suits my motor when i increases microstep i am loosing torque

Please post info on your motor, datasheet if possible.

i am using sanyo daenki motor

https://products.sanyodenki.com/en/sanmotion/stepping/f2/SF2424-10B41/

Looks like a typical 1 Amp, 200 step, NEMA 17 motor. Make sure your drive is set for 1 Amp or less current and try X4 stepping (800 steps per rev) and make sure the motor is solidly mounted so it can't rattle around.
And post the driver info.

If you want the motor to be really silent take a TMC2209-stepper-driver.
TB6600 is super-low-cost and therefore rather low quality.

You can't have high performance in torque and silence for the cheapest price.

You will have to make compromises.

best regards Stefan

I've heard some bad stuff about those "too cheap" "TB6600" drives. Like fake Toshiba TB6600 chips, they were pretty popular once.

okay i will order one and try if i can get solutions