<p>A number of options exist, but keep in mind that cost will be a limiting factor.</p>

<p><em>(Small sidenote: cost depends on persective, financial cost does not equal mental cost. The tradeoff between buy or make depends also on your willingness to persist when things don't work right away.)</em></p>

<p><strong>Before you start:</strong> make sure that your printer has enough space to accomodate bigger motors.</p>

<p><strong>So, what options are there?</strong> </p>

<ol>
<li><p>Change your current configuration. If you are losing steps, it could very well be that it can be fixed in firmware.</p>

<ul>
<li>Pro: No budget and nothing to lose.</li>
<li>Con: No shiny closed loop system. (Is that bad though?) Possibly need to configure and compile your own firmware.</li>
</ul></li>
<li><p>MacGyver / DIY solution based on low lever components</p>

<ul>
<li>Pro: Probably as cheap as you'll get depending on how you choose your components. Might be an interesting learning experience, not to mention the satisfaction afterwards. This could be the smallest build size you'll see in all the options.</li>
<li>Con: You'll need a decent amount of engineering and debugging. Might be tricky to mount the encoders. </li>
</ul></li>
<li><p>Same as 1, but now consider using of the shelf stepper motors <a href="https://www.omc-stepperonline.com/stepper-motor-w-encoder?mfp=161-motor-nema-size[Nema%2017]" rel="nofollow noreferrer">with integrated encoders</a>.</p>

<ul>
<li>Pro: Most robust option on a budget in my opinion due to the single mechanical piece (motor + encoder).</li>
<li>Con: Integrated encoders have a considerable cost and are large compared to their vanila versions.</li>
</ul></li>
<li><p>Go for <a href="https://www.omc-stepperonline.com/closed-loop-stepper-kit" rel="nofollow noreferrer">off the shelf motor+encoder and drivers</a>.</p>

<ul>
<li>Pro: No need to worry about driver configurations too much. Just plug in the numbers or set the dip switches. Very conveinient solution. Pretty much plug and play.</li>
<li>Con: This will already be challenging on a budget. Making a wrong mix and match might lead to unpredictable results such as drives going in overcurrent. (Which, believe me, is very frustrating for your application!)</li>
</ul></li>
<li><p>If we are allowed to consider servo motors: <a href="https://www.teknic.com/products/clearpath-brushless-dc-servo-motors/clearpath-sd-stepper-replacement/" rel="nofollow noreferrer">ClearPath-SD series</a> (Or any alternative for that matter!) <em>I'm just including this for completeness.</em></p>

<ul>
<li>Pro: Performance wise a clear winner on pretty much any relevant level.</li>
<li>Con: You'll need a big budget!</li>
</ul></li>
</ol>

<p><strong>Bottomline</strong>: You'll probably want to give the first option a go before spending money. Next stop, you might want to take the second option (you already did research on different specific low level components), and if you have time to spare I'd go with that as well. If you are also on a budget timewise, I'd definively suggest to take the third option with existing driver boards.</p>

<p>The other options are more cost heavy and become real options in produciton environments, where downtime is also costsing money.</p>

<p>As to the microcontroller, take whatever you have available. Just know that more computational power will allow you to output steps faster and will allow for smoother movements. Lot's to talk about there as well!</p>

CC BY-SA 4.0
2020-02-27T10:36:58.847Z
2020-02-27T10:36:58.847Z
dex
<p>So, I am one of those who has implemented this on my big scale heavily modified cr-10 S5. </p>

<p>Why?</p>

<p>Well with bigger prints, the risk of crashing into itself because of a small blob is very real. Possibly ruining a 100$ worth of filament and missing deadlines. (We are using this professionally.) Blobs will happen, especially if you run low cost filaments and PETG, which is the only sane option for functional bigger prints from a cost perspective. We are using the BTT system S42B on all axis and it works well. A blob is now just a small distraction which can be polished away but the remaining print is still dimensionally correct.</p>

<p>However, it is not a trivial task to actually implement. To make this work one needs a printer main board allowing for external stepper drivers, like SKR E3 DIP,SKR V1.4,SKR V1.4 Turbo and so on. Also there one needs to tune the PID:s for the system in use which is not super simple.</p>

<p>If you are truly an expert and do big prints, I really think this is a must have upgrade. On the other hand if one are only printing smaller parts on a hobby scale this will not be a worth while upgrade. I am not talking about the money involved, the pcbs are just 14$/pcs but the work needed with new cabling pid-tuning marlin-digging and so on. For us it is just amazing to not have 30% failures any more, du to the inevitable blobs sometimes appearing in bigger prints.</p>

CC BY-SA 4.0
2020-06-12T12:31:47.743Z
I don't see the relevance for the question asked
FarO
CC BY-SA 4.0
2022-03-07T22:18:26.963Z
100 $filament was about 4 to 5 kilos of normal priced PLA or ABS in 2020.
Trish
CC BY-SA 4.0
2020-06-12T10:43:48.030Z
2020-06-12T10:43:48.030Z
Cadson Mikael
<p>I've implemented a closed-loop system about 25 years ago on an 8 x 32 erosion table scanning it at one cm resolution using laser triangulation. It took 120 hours to scan the surface. Most of the time was spent waiting seven seconds for the system to stop shaking. I put shaft encoders on the X, Y, &amp; Z shafts, not the stepper motors. I wanted to sure I got the movement of the camera.</p>
<p>In the end, I settled on moving to a goal with a 1/10 mm tolerance and added any error into the move to the next goal. There was a sphere of confusion of the location of the camera of more than 2/10 mm. Moving back and forth to make up for a missed step at the cost of nearly 10 seconds a move could add days to a run. We were well past the end of the table's life.</p>

CC BY-SA 4.0
2021-07-15T07:27:45.830Z
It doesn't look like an answer to the question asked
FarO
CC BY-SA 4.0
2021-07-15T04:20:00.400Z
2021-07-15T04:20:00.400Z
Gordon Couger
<p>It has been 25 or 30 years since I did my first closed-loop system. I was driving a syringe pump from a printer port on a MS-Dos PC that ran hot had to disable the timer interrupts to make the deadlines amount moving the plunger, updating the floppy drive reading and computing the new position, getting the time, and fixing up the timer.</p>
<p>I found moving to a goal with a tolerance of 1 or 2 stepper motor steps was on the money over 95% of the time and I made deadlines over 90% of the time. Any error was made up in the next move. I used the same scheme on an 8 x 32 foot structured light scanning table.  I am pretty sure I saw memory errors from cosmic rays on this one. It took 500 hours to scan that with no parity check on the RAM. It had some wooden structures that changed size over time. I could track the movement with the error files from the shaft encoders.</p>
<p>On the x y scanning table, the wait time was7 seconds after a move before the camera stopped asking enough to capture an image. We elected to fix up the position in software and accumulate the errors in the next move in order to be able to finish the project.</p>

CC BY-SA 4.0
2022-03-07T09:32:33.200Z
Hello Gordon, welcome to 3DPrinting.SE! Although the answer is quite extensive, how does it help the OP in the decission to build from scratch is worth it or not. Could you please explain this with reference to your example by an [edit]? Thanks!
0scar
CC BY-SA 4.0
2022-03-07T06:29:59.297Z
2022-03-07T06:29:59.297Z
Gordon Couger
<p>I am thinking to use closed-loop stepper motors to prevent step loss and make the machine more accurate. What options (preferably low cost) are there for:</p>

<p><code>stepper motor + driver + encoder + microcontoller</code></p>

<p>Is building it from scratch worth it? E.g. Arduino Mega 2560 + RAMPS 1.4/1.5/1.6 + stepper motors (e.g. NEMA17) + drivers (e.g. A4988, DRV8825) + encoders (e.g. AS5047P, AS5047D, AS5048A, TLE5012B) + microcontrollers (e.g. STM32).</p>

CC BY-SA 4.0
2020-02-27T09:54:16.650Z
The RAMPS setup is completely outdated anyway.

BTT offers a complete setup for closed loop steppers: https://de.aliexpress.com/i/33000419800.html

However, I think the benefits lie more with CNCs. If you lose steps - even if they're corrected soon after - you'll still have artifacts in the print from the other axes that kept moving.
Just use drivers that make losing steps a lot less likely in the first place, e.g. TMC5160s, and make sure you mechanics work well.
towe
<stepper><stepper-driver><motor><arduino><ramps>
Closed-loop stepper motors
kuzand
# Closed-loop stepper motors

(Asked by: username_0 on 2020-02-27)

I am thinking to use closed-loop stepper motors to prevent step loss and make the machine more accurate. What options (preferably low cost) are there for:

`stepper motor + driver + encoder + microcontoller`

Is building it from scratch worth it? E.g. Arduino Mega 2560 + RAMPS 1.4/1.5/1.6 + stepper motors (e.g. NEMA17) + drivers (e.g. A4988, DRV8825) + encoders (e.g. AS5047P, AS5047D, AS5048A, TLE5012B) + microcontrollers (e.g. STM32).

**Tags:** stepper, stepper-driver, motor, arduino, ramps
> **Comments:**
> **username_1**: The RAMPS setup is completely outdated anyway.  BTT offers a complete setup for closed loop steppers: https://de.aliexpress.com/i/33000419800.html  However, I think the benefits lie more with CNCs. If you lose steps - even if they're corrected soon after - you'll still have artifacts in the print from the other axes that kept moving. Just use drivers that make losing steps a lot less likely in the first place, e.g. TMC5160s, and make sure you mechanics work well.  

---

## 4 answers

### Answer by username_2 on 2020-02-27. Score: 2 | Accepted answer

A number of options exist, but keep in mind that cost will be a limiting factor.

*(Small sidenote: cost depends on persective, financial cost does not equal mental cost. The tradeoff between buy or make depends also on your willingness to persist when things don't work right away.)*

**Before you start:** make sure that your printer has enough space to accomodate bigger motors.

**So, what options are there?**

1. Change your current configuration. If you are losing steps, it could very well be that it can be fixed in firmware.

   * Pro: No budget and nothing to lose.
   * Con: No shiny closed loop system. (Is that bad though?) Possibly need to configure and compile your own firmware.
2. MacGyver / DIY solution based on low lever components

   * Pro: Probably as cheap as you'll get depending on how you choose your components. Might be an interesting learning experience, not to mention the satisfaction afterwards. This could be the smallest build size you'll see in all the options.
   * Con: You'll need a decent amount of engineering and debugging. Might be tricky to mount the encoders.
3. Same as 1, but now consider using of the shelf stepper motors [with integrated encoders](https://www.omc-stepperonline.com/stepper-motor-w-encoder?mfp=161-motor-nema-size[Nema%2017]).

   * Pro: Most robust option on a budget in my opinion due to the single mechanical piece (motor + encoder).
   * Con: Integrated encoders have a considerable cost and are large compared to their vanila versions.
4. Go for [off the shelf motor+encoder and drivers](https://www.omc-stepperonline.com/closed-loop-stepper-kit).

   * Pro: No need to worry about driver configurations too much. Just plug in the numbers or set the dip switches. Very conveinient solution. Pretty much plug and play.
   * Con: This will already be challenging on a budget. Making a wrong mix and match might lead to unpredictable results such as drives going in overcurrent. (Which, believe me, is very frustrating for your application!)
5. If we are allowed to consider servo motors: [ClearPath-SD series](https://www.teknic.com/products/clearpath-brushless-dc-servo-motors/clearpath-sd-stepper-replacement/) (Or any alternative for that matter!) *I'm just including this for completeness.*

   * Pro: Performance wise a clear winner on pretty much any relevant level.
   * Con: You'll need a big budget!

**Bottomline**: You'll probably want to give the first option a go before spending money. Next stop, you might want to take the second option (you already did research on different specific low level components), and if you have time to spare I'd go with that as well. If you are also on a budget timewise, I'd definively suggest to take the third option with existing driver boards.

The other options are more cost heavy and become real options in produciton environments, where downtime is also costsing money.

As to the microcontroller, take whatever you have available. Just know that more computational power will allow you to output steps faster and will allow for smoother movements. Lot's to talk about there as well!


---

### Answer by username_3 on 2020-06-12. Score: 0

So, I am one of those who has implemented this on my big scale heavily modified cr-10 S5.

Why?

Well with bigger prints, the risk of crashing into itself because of a small blob is very real. Possibly ruining a 100$ worth of filament and missing deadlines. (We are using this professionally.) Blobs will happen, especially if you run low cost filaments and PETG, which is the only sane option for functional bigger prints from a cost perspective. We are using the BTT system S42B on all axis and it works well. A blob is now just a small distraction which can be polished away but the remaining print is still dimensionally correct.

However, it is not a trivial task to actually implement. To make this work one needs a printer main board allowing for external stepper drivers, like SKR E3 DIP,SKR V1.4,SKR V1.4 Turbo and so on. Also there one needs to tune the PID:s for the system in use which is not super simple.

If you are truly an expert and do big prints, I really think this is a must have upgrade. On the other hand if one are only printing smaller parts on a hobby scale this will not be a worth while upgrade. I am not talking about the money involved, the pcbs are just 14$/pcs but the work needed with new cabling pid-tuning marlin-digging and so on. For us it is just amazing to not have 30% failures any more, du to the inevitable blobs sometimes appearing in bigger prints.

> **Comments:**
> **username_4**: I don't see the relevance for the question asked  
> **username_5**: 100 $filament was about 4 to 5 kilos of normal priced PLA or ABS in 2020.  

---

### Answer by username_6 on 2021-07-15. Score: 0

I've implemented a closed-loop system about 25 years ago on an 8 x 32 erosion table scanning it at one cm resolution using laser triangulation. It took 120 hours to scan the surface. Most of the time was spent waiting seven seconds for the system to stop shaking. I put shaft encoders on the X, Y, & Z shafts, not the stepper motors. I wanted to sure I got the movement of the camera.

In the end, I settled on moving to a goal with a 1/10 mm tolerance and added any error into the move to the next goal. There was a sphere of confusion of the location of the camera of more than 2/10 mm. Moving back and forth to make up for a missed step at the cost of nearly 10 seconds a move could add days to a run. We were well past the end of the table's life.

> **Comments:**
> **username_4**: It doesn't look like an answer to the question asked  

---

### Answer by username_6 on 2022-03-07. Score: 0

It has been 25 or 30 years since I did my first closed-loop system. I was driving a syringe pump from a printer port on a MS-Dos PC that ran hot had to disable the timer interrupts to make the deadlines amount moving the plunger, updating the floppy drive reading and computing the new position, getting the time, and fixing up the timer.

I found moving to a goal with a tolerance of 1 or 2 stepper motor steps was on the money over 95% of the time and I made deadlines over 90% of the time. Any error was made up in the next move. I used the same scheme on an 8 x 32 foot structured light scanning table. I am pretty sure I saw memory errors from cosmic rays on this one. It took 500 hours to scan that with no parity check on the RAM. It had some wooden structures that changed size over time. I could track the movement with the error files from the shaft encoders.

On the x y scanning table, the wait time was7 seconds after a move before the camera stopped asking enough to capture an image. We elected to fix up the position in software and accumulate the errors in the next move in order to be able to finish the project.

> **Comments:**
> **username_7**: Hello Gordon, welcome to 3DPrinting.SE! Although the answer is quite extensive, how does it help the OP in the decission to build from scratch is worth it or not. Could you please explain this with reference to your example by an [edit]? Thanks!  

---

