How can I count the encoder counts?

I am trying see if I can get this motor to work for the z axis that has a dual hall sensor encoder. I read here that it might be possible to read the encoder values so I can see if I am in the ball park with encoder counts per revolution. is this possible?

Looking at the Firmware code this morning, it doesn’t look like this has been make accessable. I will probably just modify code to add a new B-code to get these values. Should I make a PR if I do?

I can’t say I understand what you are doing, but I’d say do a PR if you can. If there is a standard to follow for B-codes (not familiar with them) then that would be preferred.

Would this be more useful in a separate program for exploring new motors? The program could let the user start the motor and count pulses until stopped. If the user watched the motor and stopped at, say 10 revolutions, you would have an approximation of pulses per rev. Count the milliseconds at the same time and get rpm as well. Use a sensor on the shaft to sense revolutions and gather counts at each revolution for averaging.
For the z-axis, you could explore using the settings for z travel per revolution and pulses per revolution. The defaults are 0.125 inches per revolution and 7560.0 pulses per revolution. Hook up the unknown motor and use the z-axis setting to go 0.125 inches and the motor will travel 7560 pulses and one revolution.