The issue with normal screws going into a cylindrical hole is they will try to form a thread rather than cut one which has very tight tolerance for working well.
I have made a library which uses the calculations from above to calculate the required inner diameter for cutting a thread and then makes it bigger by a factor “splodge”. It has functions already calculated for M1, M1.2, M1.6, M2, M2.5, M3, M4, M5, M6, M8, M10, M12. Also for most smaller American UNC. There are also helper functions for calculating the tapping diameter for based on diameter and pitch, or based on UNC/UNF numbered or fractional sizes with specified TPI.
The library has a test object for M2, M2.5, M3, M4, M5 and M6 with 5 different splodge values (written on top):
I found our Prusa i3 was fine with splodge values of 1.5 - 2.5 for all screws, and .1 - .3 for M4 and above.
This object can be found in the Examples folder of the library, you can also right click this link and select “Save Link As” and save it as
TapTest.stl. It is worth noting that 0.3 worked for M2-M3 but the screw easily broke the thread once fully in and continued turning.
If anyone has time to print this object too that would be wonderful. It is slightly more work tapping it, I did the M4 and above using a power drill once I got the holes started by hand.