Question

In: Electrical Engineering

witches »   HW-20: Arduino - Motor Speed.problem Arduino - Measuring Motor Speed Arduino sketch with...

witches »


 


HW-20: Arduino - Motor Speed.problem


Arduino - Measuring Motor Speed

Arduino sketch with corresponding line numbers per coding line.
Match line # 1 through #17 with the corresponding instruction purpose.
_____________________________________________________________________

1.   int count = 0;
     float f = 0;
     float PPR = 500;
     float RPM= 0;

2.   void setup()
3.      pinMode(2,INPUT);
4.      attachInterrupt(0,freq,RISING);
5.      Serial.begin(9600);

6.    void loop()
      {
7.      count=0;
8.      delay(100);
9.      f=10*count;
10.    RPM=f/PPR;
11.    Serial.print(count);
12.    Serial.print(" Pulses/100ms");
13.    Serial.print("\t");
14.    Serial.print(f);
15.    Serial.println(" Hz");
       }

16.   void freq()
        { 
17.      count=count++; 
        }

 1 2 3 4 5  Establish inputs and outputs 
 1 2 3 4 5  Declare Variables 
 1 2 3 4 5  Establish output communications with the monitor 
 1 2 3 4 5  Declare digital input pin 
 1 2 3 4 5  Establish interrupt digital input pin, name and mode 
 Tries 0/2
 6 7 8 9 10  Establish initial count value within the running program loop 
 6 7 8 9 10  Infinite loop - running program 
 6 7 8 9 10  Calculate revolutions per minute 
 6 7 8 9 10  Calculate freqency 
 6 7 8 9 10  Delay 100 ms while counting interrupt pulses 
 Tries 0/2
 11 12 13 14 15  Print text "Pulses/100ms" to monitor 
 11 12 13 14 15  Print count value to monitor 
 11 12 13 14 15  Print text " Hz" to monitor then line feed 
 11 12 13 14 15  Print frequency value to monitor 
 11 12 13 14 15  Print tab spacing to monitor 
 Tries 0/2
 16 17  Interrupt subroutine 
 16 17  Add one to the count which is accumulating the number of pulses in 100ms 
 Tries 0/2

Solutions

Expert Solution

1.  int count = 0;
     float f = 0;
     float PPR = 500;
     float RPM= 0; // Declare Variables

2.   void setup() // Establish output communications with the monitor
3.   pinMode(2,INPUT); // Establish inputs and outputs
4.   attachInterrupt(0,freq,RISING); // Establish interrupt digital input pin, name and mode
Tries 0/2
5.    Serial.begin(9600); // Declare digital input pin

6.    void loop() // Infinite loop - running program
      {
7.    count=0; // Establish initial count value within the running program loop
8.    delay(100); // Delay 100 ms while counting interrupt pulses
Tries 0/2
9.      f=10*count; // Calculate freqency
10.    RPM=f/PPR; // Calculate revolutions per minute
11.    Serial.print(count); // Print count value to monitor
12.    Serial.print(" Pulses/100ms"); // Print text "Pulses/100ms" to monitor
13.    Serial.print("\t"); // Print tab spacing to monitor
Tries 0/2

14.    Serial.print(f); // Print frequency value to monitor
15.    Serial.println(" Hz"); // Print text " Hz" to monitor then line feed
       }

16.   void freq() // Interrupt subroutine
        {
17.      count=count++; // Add one to the count which is accumulating the number of pulses in 100ms
Tries 0/2
        }


Related Solutions

HW Measuring Total Output & Income                                    &nbsp
HW Measuring Total Output & Income                                     A                                              B           GDP ($millions)                       1000000          1050400          250000            288000 population (millions)                20                    20.2                 50                    60 GDP/pop ($thousands)          50,000__          52,000__          5,000 __          4,800 __ Economy A is a developed economy while B is a developing economy. Both are observed above at two points in time.                                                                1)Which economy is bigger? A 2)Which economy grew? (both, neither, A, B) Both 3)Which economy added more output?  4)Which economy had greater percentage growth? 5)Which has more people? B 6)Which population grew? (both, neither, A, B) Both grew but B grew more (50...
I need simulation on protues of speed control of unipolar stepper motor using uno arduino. Must...
I need simulation on protues of speed control of unipolar stepper motor using uno arduino. Must using protues..
A test of agility involves measuring the motor skills from young adults. 20 randomly selected 20-30...
A test of agility involves measuring the motor skills from young adults. 20 randomly selected 20-30 year old subjects take the test and produce a mean score of 41.0 with a standard deviation of 3.7. At the 0.01 level of significance, test the claim that the true mean score for all young adults is equal to 36.0. Ho: H1: test statistic: critical value: P value: conclusion:
How to "Measuring the Speed of Neural Transmission”?
How to "Measuring the Speed of Neural Transmission”?
Add to this arduino sketch such that you can add three externally-connected LEDs to your circuit...
Add to this arduino sketch such that you can add three externally-connected LEDs to your circuit board. Modify this code such that the first LED turns on if the ADC output value is between 0 and 340, the second LED turns on if the ADC output value is between 341 and 680, and the third LED turns on if the ADC output value is above 680 int potpin=0;// initialize analog pin 0 int ledpin=13;// initialize digital pin 13 int val=0;//...
a. For an induction motor, differentiate between synchronous speed, rotor speed and slip speed. b. State...
a. For an induction motor, differentiate between synchronous speed, rotor speed and slip speed. b. State the two basic types of construction used for the rotors of induction motors. Which is the most rugged and explain why. c. Draw full equivalent circuit for one phase of an induction motor with all parameters labelled and named. d. Draw and explain power flow diagram of 3 phase induction motor. e. Mention four (4) components of induction machine. Explain briefly the function of...
If i want to design speed breakers using ultrasonics sensor for measuring speed of the car...
If i want to design speed breakers using ultrasonics sensor for measuring speed of the car and if the speed greater than or equal 25km /h trun the LED green and open the lock And if the speed more than 25km/h turn the LED red and close the lock using ardoino program
HW Problem 5: A 150 kW motor drives a hollow round shaft at 1,200 rpm. The...
HW Problem 5: A 150 kW motor drives a hollow round shaft at 1,200 rpm. The outer diameter of the shaft is 100-mm and the inner diameter is 0.95*outer diameter. It is made of AISI 1050 WQ&T at 425- deg C. (a) Look online or the book and explain briefly what “WQ&T” in the material designation stand for, and how it is different than OQ&T. Which is stronger at the specified temperature? (b) Determine the maximum torsional shear stress (Tau...
The principle of “Hall Effect” is used in measuring high direct currents. Sketch the schematic diagram...
The principle of “Hall Effect” is used in measuring high direct currents. Sketch the schematic diagram of Hall generator and explain how the working principle of high current measurement. In your explanation, write the mathematical equations related to the circuit ( if any).
A motor apply power 10-hp split-phase motor speed at 1700 rpm is used to drive a...
A motor apply power 10-hp split-phase motor speed at 1700 rpm is used to drive a rotary pump, which operates 24 hours per day. An engineer has specified a 7-in small sheave, an 10-in large sheave, and three C112 belts. The service factor of 1.2 was augmented by 0.1 because of the continuous-duty requirement. Analyze the drive and estimate the belt life in passes and hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT