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

[{'answer_id': 12088, 'author': 'dex', 'author_id': 19305, 'author_profile': 'https://3dprinting.stackexchange.com/users/19305', 'pm_score': 3, 'selected': True, 'text': '<p>A number of options exist, but keep in mind that cost will be a limiting factor.</p>\n\n<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>\n\n<p><strong>Before you start:</strong> make sure that your printer has enough space to accomodate bigger motors.</p>\n\n<p><strong>So, what options are there?</strong> </p>\n\n<ol>\n<li><p>Change your current configuration. If you are losing steps, it could very well be that it can be fixed in firmware.</p>\n\n<ul>\n<li>Pro: No budget and nothing to lose.</li>\n<li>Con: No shiny closed loop system. (Is that bad though?) Possibly need to configure and compile your own firmware.</li>\n</ul></li>\n<li><p>MacGyver / DIY solution based on low lever components</p>\n\n<ul>\n<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>\n<li>Con: You\'ll need a decent amount of engineering and debugging. Might be tricky to mount the encoders. </li>\n</ul></li>\n<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>\n\n<ul>\n<li>Pro: Most robust option on a budget in my opinion due to the single mechanical piece (motor + encoder).</li>\n<li>Con: Integrated encoders have a considerable cost and are large compared to their vanila versions.</li>\n</ul></li>\n<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>\n\n<ul>\n<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>\n<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>\n</ul></li>\n<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>\n\n<ul>\n<li>Pro: Performance wise a clear winner on pretty much any relevant level.</li>\n<li>Con: You\'ll need a big budget!</li>\n</ul></li>\n</ol>\n\n<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>\n\n<p>The other options are more cost heavy and become real options in produciton environments, where downtime is also costsing money.</p>\n\n<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>\n'}, {'answer_id': 13862, 'author': 'Cadson Mikael', 'author_id': 21552, 'author_profile': 'https://3dprinting.stackexchange.com/users/21552', 'pm_score': 0, 'selected': False, 'text': '<p>So, I am one of those who has implemented this on my big scale heavily modified cr-10 S5. </p>\n\n<p>Why?</p>\n\n<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>\n\n<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>\n\n<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>\n'}, {'answer_id': 16734, 'author': 'Gordon Couger', 'author_id': 29345, 'author_profile': 'https://3dprinting.stackexchange.com/users/29345', 'pm_score': 0, 'selected': False, 'text': "<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>\n<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>\n"}, {'answer_id': 19061, 'author': 'Gordon Couger', 'author_id': 29345, 'author_profile': 'https://3dprinting.stackexchange.com/users/29345', 'pm_score': 0, 'selected': False, 'text': '<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>\n<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>\n<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>\n'}]
['https://3dprinting.stackexchange.com/questions/12087', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/20227/']