Standart RPM Values of a Motor

image

is getting 2000 rpm values from this motor normal?

From the motor, or the output shaft?

Likely possible. If the motor turns red the RPM is likely much higher.

output shaft

Hi,
This may help.

Only 250rpm at the gearbox output shaft.

What is the project that needs 2000rpm motor?

Tom... :grinning: :+1: :coffee: :australia:

i dont need it. its the reading of my lm393 speedometer :frowning:

here is my code:

#include <SoftwareSerial.h>
#include<Servo.h>
#include "TimerOne.h"

SoftwareSerial bt_iletisim(9, 8);

float sure = 0, distance = 0;


int pin1 = 4;
int pin2 = 5;
int pin3 = 6;
int pin4 = 7;

const byte MOTOR1 = 2; 
const byte MOTOR2 = 3;  

volatile float rotation1 = 0;
volatile float rotation2 = 0;
volatile unsigned int counter1 = 0;
volatile unsigned int counter2 = 0;

float diskslots = 20.00;

void ISR_count1()
{
  counter1++; 
}
void ISR_count2()
{
  counter2++;
}

void ISR_timerone()
{
  Timer1.detachInterrupt();
  rotation1 = (counter1 / diskslots) * 60; // calculate RPM for Motor 1
  counter1 = 0;  //  reset counter to zero
  rotation2 = (counter2 / diskslots) * 60;  // calculate RPM for Motor 2
  counter2 = 0;  //  reset counter to zero
  Timer1.attachInterrupt( ISR_timerone );  // Enable the timer
}

void setup() {
  pinMode(pin1, OUTPUT);
  pinMode(pin2, OUTPUT);
  pinMode(pin3, OUTPUT);
  pinMode(pin4, OUTPUT);
  Timer1.initialize(); // set timer for 1sec
  attachInterrupt(digitalPinToInterrupt (MOTOR1), ISR_count1, RISING);
  attachInterrupt(digitalPinToInterrupt (MOTOR2), ISR_count2, RISING);
  Timer1.attachInterrupt( ISR_timerone );
  Serial.begin(9600);
  bt_iletisim.begin(9600);

}
void sol() {
  digitalWrite(pin1, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
  delay(1000);
  digitalWrite(pin1, LOW);
  digitalWrite(pin4, LOW);
}
void sag() {
  digitalWrite(pin2, HIGH);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin1, LOW);
  digitalWrite(pin4, LOW);
  delay(1000);
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, LOW);
}
void geri() {
  digitalWrite(pin2, HIGH);
  digitalWrite(pin4, HIGH);
  digitalWrite(pin1, LOW);
  digitalWrite(pin3, LOW);
  delay(1000);
  digitalWrite(pin2, LOW);
  digitalWrite(pin4, LOW);
}
void ileri() {
  digitalWrite(pin1, HIGH);
  digitalWrite(pin2, LOW);
  digitalWrite(pin3, HIGH);
  digitalWrite(pin4, LOW);
  delay(1000);
  digitalWrite(pin1, LOW);
  digitalWrite(pin3, LOW);
}
void loop() {
  if (bt_iletisim.available())
  {
    char data = bt_iletisim.read();
    String stringOne = String(data);
    switch (data) {
      case 'w':
        Serial.print(data);
        ileri();
        break;
      case 's':
        Serial.print(data);
        geri();
        break;
      case 'a':
        Serial.print(data);
        sol();
        break;
      case 'd':
        Serial.print(data);
        sag();
        break;
      case 'q':
        Serial.print(data);

        break;
      default:
        break;
    }
  }
  ileri();
  Serial.print(rotation1);
  Serial.print(" ");
  Serial.print(rotation2);
  Serial.print("\n");
}

Hi,
I think a picture(s) of your project and a circuit diagram would help.

Thanks.. Tom... :grinning: :+1: :coffee: :australia:


thats how i place the encoder. i cant find software for diagram sorry :frowning:

Hi;

Draw it with pen(cil) and paper and post an image.

What are pin1, pin2, pin3, pin4 in your code, where do they go?
What motor controller have you got?

Thanks.. Tom... :grinning: :+1: :coffee: :australia: