开云体育

ctrl + shift + ? for shortcuts
© 2025 开云体育

Spindle Encoders


 

开云体育

The Arduino based electronic gearing require a multi-line encoder on the spindle in order to apply an A/B fraction to create stepping pulses that track the encoder.? IIRC it has to be an 800 line encoder.

?

What encoders are people using?

?

Thanks

John D.


 

开云体育

Did some research.? Seems it’s 600 PPR and the encoder suggested doesn’t produce the Z index pulse which makes sense for just using encoder pulses to generate stepper motor pulses.

?

I found this one which can come in NPN, PNP and various supply voltages along with encoder resolutions and best of all the Index pulse.

?

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of John Dammeyer
Sent: August 25, 2024 10:50 AM
To: [email protected]
Subject: [digitalhobbyist] Spindle Encoders

?

The Arduino based electronic gearing require a multi-line encoder on the spindle in order to apply an A/B fraction to create stepping pulses that track the encoder.? IIRC it has to be an 800 line encoder.

?

What encoders are people using?

?

Thanks

John D.


 

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:

Did some research.? Seems it’s 600 PPR and the encoder suggested doesn’t produce the Z index pulse which makes sense for just using encoder pulses to generate stepper motor pulses.

?

I found this one which can come in NPN, PNP and various supply voltages along with encoder resolutions and best of all the Index pulse.

?

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of John Dammeyer
Sent: August 25, 2024 10:50 AM
To: [email protected]
Subject: [digitalhobbyist] Spindle Encoders

?

The Arduino based electronic gearing require a multi-line encoder on the spindle in order to apply an A/B fraction to create stepping pulses that track the encoder.? IIRC it has to be an 800 line encoder.

?

What encoders are people using?

?

Thanks

John D.


--
Clausing 8520, Craftsman 12x36 Lathe, 4x12 mini lathe, 14" Delta drill press, 40 watt laser, Consew brushless DC motors and a non working 3D printer


 

开云体育

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.??

?

??? /*
??????? Check Quadrature encoder knob.0
??? */

??? NewEnc
= ENCODER_PORT & ENCODER_MASK;
??? EncoderCounter
= 0;
???
if (NewEnc ^ OldEnc) { // Encoder value changed???
??????? switch(NewEnc) {
???????
case ENCODER_POS1 :?????????????? // 01
??????????? if (OldEnc == ENCODER_POS0)?? // 00
??????????????? EncoderCounter--;
???????????
else
????????????????EncoderCounter
++;
???????????
break;
???????
case ENCODER_POS3 :?????????????? // 11
??????????? if (OldEnc == ENCODER_POS1)?? // 01
??????????????? EncoderCounter--;
???????????
else
????????????????EncoderCounter
++;
???????????
break;
???????
case ENCODER_POS2 :?????????????? // 10
??????????? if (OldEnc == ENCODER_POS3)?? // 11
??????????????? EncoderCounter--;
???????????
else
????????????????EncoderCounter
++;
???????????
break;??????????????????????? // 00
??????? case ENCODER_POS0 :?????????????? // 10
??????????? if (OldEnc == ENCODER_POS2)
??????????????? EncoderCounter
--;
???????????
else
????????????????EncoderCounter
++;
???????????
break;
???????
};
??????? OldEnc
= NewEnc;
???????
// Allow MPG movement only when machine is in READY state.
??????? // We still allow the Encoder tracking because otherwise when we leave
????????// ready state, if the encoder was moved, it would generate a step.
??????? // Also, we now have the opportunity to use the encoder knob when the machine
????????// is in the IDLE state to use the encoder counts to scroll through menus etc.
??????? if (SystemState == MACHINE_READY)
????????????ZEncoderCounter
+= EncoderCounter;
???
}; // end if encoder value changed.

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:

Did some research.? Seems it’s 600 PPR and the encoder suggested doesn’t produce the Z index pulse which makes sense for just using encoder pulses to generate stepper motor pulses.

?

I found this one which can come in NPN, PNP and various supply voltages along with encoder resolutions and best of all the Index pulse.

?

?

?

From: [email protected] [mailto:[email protected]] On Behalf Of John Dammeyer
Sent: August 25, 2024 10:50 AM
To: [email protected]
Subject: [digitalhobbyist] Spindle Encoders

?

The Arduino based electronic gearing require a multi-line encoder on the spindle in order to apply an A/B fraction to create stepping pulses that track the encoder.? IIRC it has to be an 800 line encoder.

?

What encoders are people using?

?

Thanks

John D.


--
Clausing 8520, Craftsman 12x36 Lathe, 4x12 mini lathe, 14" Delta drill press, 40 watt laser, Consew brushless DC motors and a non working 3D printer