The rotary encoder is the most expensive part of the automatic magnetic loop tuner. It’s a little more expensive than the Teensy 3.2. Those of Bourns cost around 23,21 euro VAT excl. for the 64 ppr version without an incorporated push button. 64 ppr is the lowest resolution you should look for. If you go lower than 64 ppr you’ll have to turn around the encoder many times before you get to the desired stepper position for the right capacity.
You could always look for rotary encoders with a higher resolution. In the software, you can define how many pulses need to pass before the stepper motor makes a micro-step.
// File: ML.h
// Definitions for Rotary Encoder and Pushbuttons
#define ENC_MENURESDIVIDE 8 // Encoder resolution reduction when in Menu;
#define ENC_TUNERESDIVIDE 1 // Encoder resolution reduction when turning;
The ENC_MENURESDIVIDE variable is used to limit the scrolling speed in the menus. When using a 128 ppr encoder, use 16, with a 64 ppr encoder choose 8.
The ENC_TUNERESDIVIDE variable is used to determine the stepper motor response. When using a 128 ppr encoder use 2, with a 64 ppr encoder use 1.
This translates into the following: one full (360°) turn of the rotary encoder results in 8 menu steps or 64 micro-steps.
On AliExpress you can find 400 ppr rotary encoders for less than 10 euro. Since we know our math, we only need to changes the ENC_MENURESDIVIDE and ENC_TUNERESDIVIDE variables to respectively 50 and 6 (or 7), to use this cheaper alternative. These 400 ppr rotary encoders are a lot bigger than the 64 ppr Bourns rotary encoders. Functionally they will do just fine, but you need to take into account the extra space that the rotary encoder will occupy in your project box.