Keyboard Shortcuts
Likes
Search
Re: Spindle Encoders
开云体育Hi Ralph, I haven’t written any quadrature code yet other than an encoder as an MPG and it was 16 lines per rev. ?My ELS used a 1PPR sensor and calculated the RPM from the time between pulses.? This included debouncing which helps get rid of electrical interference. ? Here’s the software version for the MPG.?? Happens inside the 20kHz interrupt routine for the manual MPG counting pulses.? Each pulse becomes a motion command so if it’s set for 0.001” then each tick moves the carriage 0.001”.? It can also be set to day 0.020” per tick for example.? The distance is based on the stepper motor steps per lead screw rev and lead screw pitch.?? ? ??? /* What would change with a dedicated counter like inside a PIC32 or some other version is on each 50uS tick the counter register is read and the value added to a running total.? And based on the 50uS tick the velocity is now calculated way more often and adjustments to tracking speed could be made. ? The nice thing about the hardware counters is the ability handle very high resolution encoders.? So a 2500 line encoder like on my AC Servos is 10,000 pulses per second in quadrature mode.? Now imagine the spindle is turning 6,000 RPM which is 100 revs per second.? ?That’s 10ms for one revolution.? With 10,000 pulses per rev every 10ms we get 1 million pulses per second (assuming I’ve done the math right).? ? One doesn’t really that many lines for spindle.? The only goal, which LinuxCNC does well with a 60 slot encoder on my mill, is to be able to thread.? Or in the case of my mill it power taps 4-40 screw holes without problems.? ? ? ? From: [email protected] [mailto:[email protected]] On Behalf Of Ralph Hulslander
Sent: September 1, 2024 5:49 PM To: [email protected] Subject: Re: [digitalhobbyist] Spindle Encoders ? John, have you shared the code to read the encoder? ? Ralph ? On Sun, Aug 25, 2024 at 2:35?PM John Dammeyer via <johnd=[email protected]> wrote:
|