Subsection11.5.3Part 3: From a Pulse Train to a Number
You now have a pulse train on the screen and a number for how many pulses arrive in a second. To convert this to a speed we need to know how many slots are cut in the slotted wheel on your motor.
Take the pulse rate you measured at the fastest motor speed and convert it to revolutions per minute, using your own slot count. Is the answer plausible for the motor you just watched?
Can you tell which way the shaft is turning from this signal alone? If you can, say how; if you cannot, say what would have to be different about the sensor.
Whatever the technology behind it (mechanical, optical or magnetic), a sensor like this one gives us a pulse train, and we have to turn that pulse train into a position or a velocity. The expression is the one from the reading, Figureย 11.4.3, and both numbers going into it are now yours.
\(PPS\) is the count of pulses in one second, \(N\) the number of slots you counted. Divide by \(N\) for revolutions, multiply by 60 for a rate per minute.
Regardless of the technology (mechanical, optical or magnetic), a sensor like this one gives us a pulse train, and we have to turn that pulse train into position or velocity information.
PPS is the count of pulses in one second, and \(N\) is the number of slots you counted. Divide by \(N\) to get revolutions, multiply by 60 to get a rate per minute.
Count one edge per slot: the rising edge or the falling edge, not both. Counting both doubles the pulse count, and then the formula needs \(2N\) in place of \(N\text{.}\)
Each pulse is one slot going past, so each pulse is \(\Delta\theta = 2\pi/N\) radians of shaft rotation, or \(360/N\) degrees, or \(1/N\) of a revolution.
So \(\text{pulse count} \times \Delta\theta\) is how far the shaft has turned since you started counting, its position, relative to wherever it was then, because nothing here records where that was.
Divide that by the time you counted over and you have its speed instead. Note the word average: this says nothing about what the shaft did inside the interval, and a shorter interval buys detail at the cost of resolution.
The same count read as an angle: each pulse is \(\Delta\theta = 2\pi / N\) radians of shaft rotation, or \(360/N\) degrees, or \(1/N\) of a revolution.
So \(\text{pulse count} \times \Delta\theta\) is how far the shaft has turned since we started counting, its position, relative to wherever it was then.
Divide that by the time we counted over and we have its average speed instead, the rpm we just worked out, in different units. Note the word average: this measurement says nothing about what happened inside the interval.
One thing this signal does not carry at all is direction. Every slot looks like every other slot, and it looks the same whichever way the wheel is turning, so the sign on the rpm your program displays in Lab 6 cannot come from the measurement. It has to come from the mode your program most recently commanded. That sign is therefore only right if the motor is doing what it was told: a motor that has stalled, or one that a hand is turning backwards, would still be shown with the sign the program asked for. Getting direction out of the measurement itself takes a second sensor a quarter of a cycle away from the first, which is a quadrature encoder (Subsectionย 11.6.5).
A quadrature encoder uses two sensors offset so that one pulse train leads the other by a quarter of a cycle. Which one leads tells you the direction, and an up-down counter then gives position and speed together.