So I was thinking of using a closed-loop motor in my 3D printer for better accuracy and high-speed printing without losing steps. I have analyzed options available including just tweaking stepper current and firmware changes to prevent step losses but I want to find the best way to do it with encoders. The problem is I need a pretty high resolution for a 3d printer and usually, high-resolution servo motors use potentiometers that are limited and not suitable for a 3d printer. I am thinking of building my own closed-loop continuous rotation servo using stepper/DC motors and encoders but I can't find any high-resolution encoder at a reasonable price. So is there any way to somehow use low-resolution encoders (like 36 pulse every full turn) or is there any encoder type that I can use for better accuracy at a reasonable price other than optical ones? Also is there any other solution for closed-loop systems at a reasonable price?
Note that I am aware that I may need to modify firmware or write my own code for motors and program them from scratch.
Note: You might consider this question Closed-loop stepper motors a possible duplicate but I have read that and my main problem is not being able to find any cheap high-resolution encoder for this purpose.

Also for some reason, I can't use products like BTT S42B closed-loop stepper drives, my only option is to build them myself.
Is there any type of encoder with high resolution and cheap price for use in 3D printers? (I don't mean brand, I mean technology)

  • $\begingroup$ I am just asking for clarification: on one hand you say "I need a pretty high resolution for a 3d printer", and on the other you consider 36 "steps" per turn - while standard stepper motors make 200 steps (of 1.8 degree)? $\endgroup$ – octopus8 Mar 13 at 19:00
  • $\begingroup$ @octopus8 The problem is exactly this. The cheap encoder pulses every 10 degrees that is so low. I had an idea in my head like a 1:100 gear reduction and attaching encoder to gearbox input part so the resolution will be 0.1 degrees. I am asking for solutions to this problem, including other encoder types and possibly any similar solution $\endgroup$ – Mahan Lamee Mar 13 at 19:06
  • $\begingroup$ Gears will have backlash, unless you can measure it you won't be gaining anything. And ironically to measure gear backlash will require an encoder ha. A high resolution encoder is your only option tbh. $\endgroup$ – FourierFlux Mar 14 at 5:23
  • $\begingroup$ What about stepper motors with attached planetary gearbox, like 3:1? Do they also have a backlash? Or maybe it is not really important, because achieved increase of resolution is still better? $\endgroup$ – octopus8 Mar 14 at 14:55
  • $\begingroup$ If you're after accuracy, you're probably after quality as well. Since three to four axes need to work together in a printer, the delay of correcting a step will probably do more harm than good for print quality. I still believe that proper drivers (e.g TMC5160) with proper steppers are a much easier way to prevent lost steps. I've had my CoreXY Direct Drive X-Axis up to 1200 mm/s at 20k mm/s^2 without lost steps. $\endgroup$ – towe Mar 17 at 8:47

You can use a magnetic position encoder.

AS5048B High Resolution Position Sensor

14-bit rotary position sensor with digital angle (interface) and PWM output

14 bit means 16k steps/rotation. With a stepper which does 200 steps/rotation and 16x microstepping, you will need only 11 bit, so you have plenty of extra accuracy you can use to filter noise.

You may use AS5600 Positioning Sensor instead, which is 12 bits, since you don't need to track each microsteps in a closed loop, 4x is enough.

AS5600 in PWM mode does up to 920 Hz, AS5048 1 kHz. I'm not sure in I2C mode but surely more. Of course you have to take into account delay between measuring the position and transmission of the position.

  • $\begingroup$ Very interesting stuff. Would it just need to glue a flat magnet to the motor's shaft? --> found it. There are even links of recommended magnet suppliers. $\endgroup$ – octopus8 Mar 15 at 11:53
  • $\begingroup$ @octopus8 I bought both boards on Aliexpress and they come with a magnet already. I guess you just need to be careful with iron parts nearby, because if they are VERY close they may distort the field and cause nonlinearity issues. $\endgroup$ – FarO Mar 15 at 12:46
  • $\begingroup$ Thanks for your answer. So I can do up to 1/64 microsteeping if it has 16k PPR. Which means 2.5 microns resolution without any error. Will this make any change in print quality compared to normal printers without an encoder? $\endgroup$ – Mahan Lamee Mar 15 at 13:46
  • $\begingroup$ Also, I don't have much information on encoders. So is it better to use absolute or incremental for this purpose? $\endgroup$ – Mahan Lamee Mar 15 at 13:50
  • $\begingroup$ No I would not step up to 64X, it's mechanically pointless because nothing in the 3D printer is accurate enough for that. 16X is plenty. Also, I guess you have not much experience with experimental measurement, but if you measure 1 mm with a ruler which has 1 mm ticks, your uncertainty will be 100%. You want the measurement tool to be much more accurate than whatever you measure. Also, those encoders have uncertainties of at least 2 bits, so 16X is already the max you can use to get meaningful data. For the rest you have to look it up, I never used them personally (yet). $\endgroup$ – FarO Mar 15 at 14:10

The gearbox approach is solid, but it will be 100x slower, and you said you wanted speed.

  • $\begingroup$ It will be much slower, indeed. And probably less reliable. Trying to build reasonable speed of the whole reduction setup 100:1 it would mean rotating stepper motor by two orders of magnitude. So it will have much less torque, will be probably loosing steps, and may be even impossible to turn this fast. (Otherwise with 1:100 increase, but I won't consider the impact ;) ). Though, all this is just a remark, not a complete answer how to build a solution :( $\endgroup$ – octopus8 Mar 14 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.