step motor - speed control

Hi,

I’m using “UNO + step motor 28byj-40”.

I want to know formula to control the speed.

#include <Stepper.h>
#define STEPS 100
Stepper stepper(STEPS, 8, 9, 10, 11);

void setup() {
    stepper.setSpeed(30);
}

void loop () {
    stepper.step(100);
}

What do you mean by 'formula'? You're setting the speed to 30 rpms in your example. If you want the stepper to move at a different speed, set the speed to a different value.

what the relationship is betwen 30 and 100, why do not you simply change the values randomly.

I tried to put other values to make the engine go faster (as a ventilator), but the values of 30 and 100 when altered, behave the way unexpected.

somebody? :(

what the relationship is betwen 30 and 100

There isn't one. 30 is the speed (number of complete revolutions in some given time) and 100 is the number of steps. They are not related at all.

why do not you simply change the values randomly.

Because presumably control, not randomness, is important.

I tried to put other values to make the engine go faster (as a ventilator), but the values of 30 and 100 when altered, behave the way unexpected.

How did they behave? Change one value at a time, and observe the effect. Don't try to change both.

Using a stepper to drive a fan is a misuse of that type of motor.