S
S
Sencis2019-07-17 15:03:10
Arduino
Sencis, 2019-07-17 15:03:10

How to calculate engine rpm without interruption?

Using interrupts slows down the code a lot. during the passage of the hall sensor by the magnet, the interruption loops, the same thing happens when the magnet stops in front of the sensor. Is it even possible to roughly calculate the revolutions without interruption?

Answer the question

In order to leave comments, you need to log in

4 answer(s)
K
Kalombyr, 2019-07-17
@Userpc0101

Maybe then it is not necessary to calculate programmatically?
Zayuzat, for example, mikruhu from a real-time clock (for example, DS1372), where instead of quartz, use pulses from the Hall sensor.
Or take an analog Hall sensor and a circular magnet, then you can read the rotation speed with an analog input, and then translate it into the number of revolutions.

K
kalapanga, 2019-07-17
@kalapanga

1) If the use of interrupts "slows down the code", then you stuffed too much into the interrupt handler, perhaps something that just doesn't belong there. In your case, there should be one single operator for increasing some variable by one.
2) What does "interrupt loops" mean? Unclear.
3) If an interrupt is constantly called when the magnet stops in front of the sensor, then you may have configured the interrupt to be level, not change.
4) Would you give some characteristics of the motor. To assess what kind of speed the controller cannot handle.

A
Alexander Volkov, 2019-07-17
@a_volkov1987

If you have interruptions when the engine is stopped, then you need to either review the code or use an oscilloscope to go to the sensor output and see what it outputs in such a situation. If pulses come from it when the engine is stopped, either the sensor is faulty or you catch pickups, which may be the case if the sensor is not turned on correctly, for example.

S
Sencis, 2019-07-17
@Userpc0101

Found the solution here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question