Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

I used wantai Stepper motor(.9/step) in speedometer.but?

Status
Not open for further replies.

chamanali

Newbie level 4
Joined
Feb 14, 2014
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
68
but its not move continuously like other mechanical speedometer...its moves step by step like clock seconds needle...kidly tell me how i continous it ....someone help me by giving comments...programming????
 

Your stepper motor is working exactly as it's supposed, it moves in steps! If you want it to run faster, you'll have to give it a faster step rate. I'm not sure why you are comparing a step motor to a speedometer, though; they are two entirely different things.

What are you using to control the stepper?
 

A seconds needle performs 6° steps, you need quite a large needle to clearly perceive 0.9° steps. But even a 0.9° stepper might be controlled smoother by a micro-stepping driver.
 

Your stepper motor is working exactly as it's supposed, it moves in steps! If you want it to run faster, you'll have to give it a faster step rate. I'm not sure why you are comparing a step motor to a speedometer, though; they are two entirely different things.

What are you using to control the stepper?


I am using Proximity sensor for inputs and used stepper motor for output...i am using arduino and stepper motor driver sparkfun


Code C - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
int rpmcount = 0; 
int dirPin = 3;
int stepperPin = 4;
int a=0,b=0,c=0;
int rpm = 0; 
 
 
unsigned long lastmillis = 0; 
 
 
void setup(){ 
 Serial.begin(9600); 
 attachInterrupt(0, rpm_fan, FALLING);
  pinMode(dirPin, OUTPUT);
  pinMode(stepperPin, OUTPUT);
  Serial.begin(9600);
  
 } 
 void step(boolean dir,int steps){
  digitalWrite(dirPin,dir);
  delay(50);
  for(int i=0;i<steps;i++){
    digitalWrite(stepperPin, HIGH);
    delayMicroseconds(100);
    digitalWrite(stepperPin, LOW);
    delayMicroseconds(100);
  }
  
}
 
 
void loop(){ 
 
 if (millis() - lastmillis == 1000){ //Uptade every one second, this will be equal to reading frecuency (Hz).
 //step(true,2000);
 // delay(10);
 // step(false,2000);
 
 detachInterrupt(0);//Disable interrupt when calculating
 
 rpm = rpmcount * 60; // Convert frecuency to RPM, note: this works for one interruption per full rotation. For two interrups per full rotation use rpmcount * 30.
 
 Serial.print("RPM =\t"); //print the word "RPM" and tab.
 Serial.print(rpm); // print the rpm value.
 Serial.print("\t Hz=\t"); //print the word "Hz".
 Serial.println(rpmcount); //print revolutions per second or Hz. And print new line or enter.
 a=rpmcount;
 c=b-a;
 c=c*100;
 
 if(a!=b && b>a)
 {
   step(false,c);
  
 }
 if(a!=b && a>b)
 {
   step(true,c);
   
 }
 if(a==b && a==0 && b==0)
 {
 
 }
 if(a==b && a!=0 && b!=0)
 {
 
 }
 
b==a;
 
 rpmcount = 0; // Restart the RPM counter
 lastmillis = millis(); // Uptade lasmillis
 attachInterrupt(0, rpm_fan, FALLING); //enable interrupt
  }
 
 } 
 
 // this code will be executed every time the interrupt 0 (pin2) gets low.
 
 
void rpm_fan(){ 
  rpmcount++;
 
 }




this is programming
if stepper is not suitable then suggest me other siutable motor....

- - - Updated - - -

A seconds needle performs 6° steps, you need quite a large needle to clearly perceive 0.9° steps. But even a 0.9° stepper might be controlled smoother by a micro-stepping driver.

kindly tell me siutable motor for making Speedometer.. i want smooth motion....Servo motor is good for it??
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top