Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request - Adjust layer heights based on Z step quanta #1827

Closed
Lodran opened this issue Mar 12, 2014 · 36 comments
Closed

Feature request - Adjust layer heights based on Z step quanta #1827

Lodran opened this issue Mar 12, 2014 · 36 comments
Labels
Done This issue is implemented and considered complete. Feature request This is an idea for a new feature in Slic3r
Milestone

Comments

@Lodran
Copy link

Lodran commented Mar 12, 2014

In order to avoid banding in prints (particularly on printers like Up! which have belt driven Z), its necessary to adjust the layer height so that it aligns to the printer's Z axis step resolution.

If slic3r knew what the Z step resolution was, it could automatically adjust layer heights or flow rates to match the printer's characteristics.

@alranel
Copy link
Member

alranel commented Mar 16, 2014

I agree with that.

@whosawhatsis
Copy link

When doing this, you want to make sure that your layer height is a multiple of the full-step distance, so that inaccuracies of microstepping can't cause banding (there pictures and illustrations of what this looks like in my article here: https://www.evernote.com/shard/s211/sh/701c36c4-ddd5-4669-a482-953d8924c71d/1ef992988295487c98c268dcdd2d687e). Of course, a belt driven axis might not have enough full-steps per mm. The full step length on my bots with a 1mm Z screw pitch is 5 microns, but for a belt-driven axis it is likely to be 160 microns or more, so there are far fewer options unless microstep values are chosen. The TR8_8(2P) threaded rods that RobotDigg and OpenBuilds are selling give a full-step length between these, at 40 microns. This is all assuming 1.8-degree steppers are used. It should certainly *strongly_ prefer to use multiples of the full-step length if possible, then half-step, etc.

@alranel
Copy link
Member

alranel commented Mar 17, 2014

Uhm @whosawhatsis, in that case is it enough to just rotate by multiples of a full step, even if the positions themselves are offset from the full step positions? In that case, user could just input the number of full steps/mm instead of microsteps/mm, and no special logic would be required on Slic3r's side.

@whosawhatsis
Copy link

Yes, I suppose it could be handled by instructing the user to use their full-step length (or their steps/mm setting divided by microstepping ratio), unless their full-step length is too large. Seems like it would be easier to program the logic than explain it to people (I get blue in the face attempting to do so on a semi-regular basis).

@nophead
Copy link

nophead commented Mar 17, 2014

For best accuracy you want to move in steps of four times the full step.
That is when the phase pattern gets back to the same state so if, for
example, one coil is stronger than the other the position will still be
consistent.

On 17 March 2014 09:24, whosawhatsis notifications@github.com wrote:

Yes, I suppose it could be handled by instructing the user to use their
full-step length (or their steps/mm setting divided by microstepping
ratio), unless their full-step length is too large. Seems like it would be
easier to program the logic than explain it to people (I get blue in the
face attempting to do so on a semi-regular basis).

Reply to this email directly or view it on GitHubhttps://github.com//issues/1827#issuecomment-37796761
.

@whosawhatsis
Copy link

@nophead if a "step" is the distance from when phase A is energized and phase B is off to where phase A is off and phase B is energized (or from where both are energized equally to the next point where both are energized equally, but one has the reversed its polarity), then only the "full step" and "half step" positions are accurate. That would mean that there are only two consistent points, not four, unless I'm misunderstanding something.

But you can't rely on having a consistent step every half-step because you don't know which microstep you are on at any given moment. If you know that you are on the full-step position, you know that the half-step position is 1/400 of a rotation away, but if you're in the 1/8 step position, the 5/8 step position will not be exactly 1/400 step away. Since you can only know whether you're on one of the full-step or half-step positions or not (because you are always on one of the two) when you're in half-step mode, you can't use a half step as a reliable unit of measurement when you're using a greater number of microsteps/step, so all that you can know is that the positions one full step away in either direction will be 1/200 of a rotation away.

@whosawhatsis
Copy link

@nophead Oh, I understand what you're saying now. Yes, if you don't assume that the two phases are of equal strength, then you need to go in multiples of four full steps (I thought you were referring to quarter steps), not just one. If the phases of your motor can be safely assumed to be of equal strength, then what I said above is true.

@nophead
Copy link

nophead commented Mar 17, 2014

Not only the balance of the motor but also the driver. With 0.05R sense
resistors the track resistance becomes significant and there are some
stepsticks around with 0R sense resistors.

On 17 March 2014 09:58, whosawhatsis notifications@github.com wrote:

@nophead https://github.com/nophead Oh, I understand what you're saying
now. Yes, if you don't assume that the two phases are of equal strength,
then you need to go in multiples of four full steps (I thought you were
referring to quarter steps), not just one. If the phases of your motor can
be safely assumed to be of equal strength, then what I said above is true.

Reply to this email directly or view it on GitHubhttps://github.com//issues/1827#issuecomment-37799263
.

@Lodran
Copy link
Author

Lodran commented Mar 17, 2014

@nophead The step quanta should be user adjustable. If you're talking about a screw drive, then 4x the step height would be quite reasonable - If you're talking about a belt drive, then 4x the step height would most likely be > than your layer height.

@bstott
Copy link

bstott commented Mar 17, 2014

Say Men,

A question about belt resolution just to make it clear in my mind. The belt resolution would be dependent on the two pulley diameters and then exactly what the motor can attain Right?

Meaning - resolution is fully dependent on the ratio of the two pulleys. ???

@Lodran
Copy link
Author

Lodran commented Mar 17, 2014

@alexrj The printer i'm working with has a step quanta of .08mm, so my current solution is to set my layer height to .24mm (rather than the .25mm I usually would use). It's great for print quality, but kinda sucks from a precision standpoint, since my models are all designed in millimeters. This would pretty much be the same as having slic3r compensate by adjusting the layer height to fit the step quanta.

Ideally, I'd like slic3r to compensate the flow rate instead of the layer height, as this could produce better precision in the height of the object. However, since the printer would be microstepping it might not be possible to correctly predict the flow compensation needed.

@whosawhatsis
Copy link

@bstott the steps/mm of a belt driven axis depends on the effective circumference of the motor pulley (the diameter of the idler pulley has no effect, as long as it is properly aligned so that belt tension is constant). By "effective circumference", I mean the number of teeth on the pulley multiplied by the pitch of the belt.

@Lodran
Copy link
Author

Lodran commented Mar 17, 2014

@alexrj Perhaps this is more of a user interface feature than a slicing feature - a means of directing the user to layer heights that are a good match to their printer.

@bstott
Copy link

bstott commented Mar 18, 2014

@whosa...

OK --- Idler - right --- no effect. Diameter/circumference of the drive pulley at the top of the teeth would be the effective distance moved in relation to the motor step movements. And what determines resolution. Teeth numbers determine Circumference by geometry. So - simple calcs will use teeth but are effectively --- resolution directly related to the circumference of the drive pulley. Smaller pulley (less teeth) = higher resolutions.

@bstott
Copy link

bstott commented Mar 18, 2014

I forgot to give the clue to my questions ----- Teeth are irrelevant to the motor belt build and print resolution but, diameter of the drive pulley is not.

Based on the above premise: We can build our own drive pulley to resolve the resolution we prefer from the motors. Design your pulley by determining the ideal diameter then, how many teeth you wish to have in contact at all times with the belt. Properly space your teeth. If the pulley can accommodate a full compliment integer number of teeth then either arrange full circumference or omit to maintain your ideal number of teeth and belt contact. Assure the teeth spacing is such as to mesh with the particular belt you are using. You will then control with micro precision your machine resolutions.

Did I miss a glaring mistake in thought?

@Lodran
Copy link
Author

Lodran commented Mar 18, 2014

@bstott see http://calculator.josefprusa.cz

You can get micro precision of the sort you're thinking of with cable (i.e. spectra-line) based movements, where there are no restrictions on pulley circumference, but with belt drives, your choices for pulley circumference are an integral multiple of the belt's tooth spacing.

@bstott
Copy link

bstott commented Mar 18, 2014

@Lodran

Ahhh - you almost got my point. But ---- there are no restrictions with teeth in my example. You use the teeth only to stop belt slip. --- If you remember - We can design and print our parts and as such ---- pulley circumference is our choice and the number of teeth are ours to calculate to fit. Same resolutions as ---- cable. No limits. Just a little more work. ;-)

@Lodran
Copy link
Author

Lodran commented Mar 18, 2014

@bstott Tooth spacing is controlled by your belt choice, not by the design of your pulley.

@bstott
Copy link

bstott commented Mar 18, 2014

True and Not true. Only true to have the pulley mesh - but you do not require teeth on a pulley to mesh with every tooth that is in the circumference of the belt. You are only required to have the same multiple of spacing on the pulley as you do the belt. That is the idea.

Example: Pulley interfaces with the belt every third or fourth tooth rather than every tooth. Maybe a belt has 20 teeth in the circumference and on the pulley only four with space of five in between. The objective would be to maybe have three belt teeth engaged at one time on the pulley.

@whosawhatsis
Copy link

@bstott why would you not want to engage every tooth you can? This makes no sense.

The purpose of teeth on the pulley meshing with those on the belt is not just to prevent slipping. It also acts as a self-correcting mechanism. Even if the diameter of the pulley is slightly off of the nominal value for the belt pitch and tooth count (within tolerances determined by the tooth profile), the belt will slip on the pulley to keep all of the teeth engaged with the pulley. Because of this, you can use the same pulleys with GT2 (2mm pitch) and MXL (2.03mm pitch) and the effective diameter of the drive gear will be different even though the pulley's actual diameter remains constant.

@bstott
Copy link

bstott commented Mar 18, 2014

@whosawhatsis
For our use the teeth stop the belt slipping. It is not required to use all the teeth for self-correcting. Self correcting (backlash?) and slipping are not defeated from what I proposed. All the available individual teeth around the circumference of the belt are not required to mesh to perform the function of movement. They are there for our use - as we use them - as a convenience. The original belt/pulley design is for an entirely different purpose requiring higher loads. How we implement is our choice. We are not restricted to use all teeth. Our uses hardly stress the belts. They are not under a tremendous amount of stress. The belts were originally designed for a different purpose. Thank you for trying to see the idea I am putting forth. We are using the belts to move a small item under some pressure/tension. Not a lot. The point was that you do have a very fine resolution obtainable through an almost unrestricted and unlimited circumference range. There will not be slippage because you have several of many teeth engaged. Having several teeth engaged at all times will stop a backlash.

With the two different belt pitches you note - they are not a perfect mesh and then would not be used as designed thus are not generally interchangeable but, may be close enough to likely work in nearly any application. The two belt designs may not fully seat properly on different tooth profiles. So slippage/backlash will occur as the belts are pressed to match an different profile. This is OK in a 'So What' use but, not if you need the precision, timing, and consistent power transfer. (Theoretical.)

My thoughts were to eliminate one's restrictions to print resolutions allowed by the screw and open the choice for resolution through printing of various configured pulleys. Pulleys could then be easily swapped to attain a wide variety of print resolutions. You would not be restricted by the manufacturer of the screw hardware.

Related note - We could use V-belt. No teeth. But, here design, manufacture, build, setup and other variables add to complexity of their use with our printers. That is why I suggest using a few less teeth....

@bstott
Copy link

bstott commented Mar 18, 2014

@Lodran :-) Belt tooth spacing... Only if you are designing belts. How you use the available teeth on the belt is your choice by how you design your pulley. ---- I am telling you that we can design and print our own pulleys. :-P

@Lodran
Copy link
Author

Lodran commented Mar 18, 2014

@bstott this is hardly the right forum to be discussing this in.

@whosawhatsis
Copy link

We don't have any appreciable slip problems due to constant resistance (friction, weight, though there might be weight issues for belt-driven Z), but we do need high rates of acceleration, which are even more likely to cause slippage as we are fighting inertia. The positive interlock is important for this reason, and I still don't understand what benefit you hope to gain from using using only some of the teeth. A toothless belt, like the designs using spectra line, would have a resolution that can be tuned more finely, but they make it MORE difficult to calibrate the printer to that resolution because you have to finely measure the effective circumference rather than deriving it from mathematical principles, and you're sure to end up with a number that will result in more rounding errors than just using a 2mm-pitch belt.

@bstott
Copy link

bstott commented Mar 19, 2014

@ whosa... Take your focus off the belt. I told you the pulley is what you design and build. Anyway, I was told that I've taken discussion off topic - even though it is related to Z resolution.... I'll stop. bye.

@whosawhatsis
Copy link

@bstott What you seem not to be understanding is that a toothed pulley, even if it only has one tooth, has to have an effective circumference that is an integral multiple of the belt pitch. If it isn't, the melt will slip when the pulley tooth meets the belt tooth, causing the position of the axis to jump. On a belt with smaller teeth spaced further apart, you might be able to have the belt teeth mesh with every second or third pulley tooth, but that would mathematically be no different from having a belt with 2x or 3x the pitch.

@bstott
Copy link

bstott commented Mar 19, 2014

What you don't seem to understand --- My idea is accurate. What you are thinking is too micro. Do not design belts - look at the geometry. You have a belt with teeth to grip it. Now, create something to grab it but, change the diameter/circumference. What do you do? You move the teeth of the pulley to match and grab the teeth. You have full control of this.... Pitch changes with circumference to match how many teeth you grab. Yes, it does have to be multiples of what the belt is designed to. Not a deterrent to ability to do but, a design constraint which does not hinder your choice of circumference.

I too have had years of advanced math (Not used here.), engineering course work to degree, design, blue prints, career taking design to big production, production to customer in several big industries. This is not hard. It is simple. What you are not seeing is that the belt wraps around something. Ignore the design methodology as a constraint on your ability to do. The idea is not to follow to design like belts but, use what exists. That is how the FDM 3D printers took hot glue gun and 2D printer to industry revolution. You control the pulley and to a micron level. Just as the idler can be of any diameter. Draw it. It is simple.

Weird example: You pull on rope in tug-o-war. The rope (belt) has knots (teeth). You are not restricted to which knots you pull (teeth) on nor how far you extend your arms (pulley circumference). In this case you can only grab two teeth (knots). Yet you control the resolution (how far you pull your opponent.)

Cheers. I've nothing more to add to this good discussion. This wasn't for me to learn here. I was sharing what was a realization. --- Oh, whatsa... looking forward to your SD solution (there I learn) ... That will be fun to see you succeed there. bye, for now.

@whosawhatsis
Copy link

If all you're suggesting is designing a pulley to be procedurally generated based on a desired diameter/circumference, with a script choosing the closest integer for the number of teeth that fit the circumference, I did that over 2 years ago for the Reprap Wallace. I still don't see what benefit you intend to gain from leaving out some of the teeth on the pulley. The OpenSCAD script I wrote for Wallace finds the number of teeth that will fit around the desired circumference, rounds it to the nearest integer and adjusts the diameter accordingly, then places that number of teeth around the pulley.

@jeder73
Copy link

jeder73 commented Mar 20, 2014

Hi folks!
I followed this thread with some interest.
There was a comment, which treats this topic as "off topic".
OK, the actual topic is a discussion for a 3d printer hardware topic , but...

In my opinion, the software Slic3r is a real software for real machines.
And real machines consist of hardware. I think the most features of Slic3r were resulted from the motivation of hardware topics. That's the way maker work and that's the way their tools work!
We want to realize things and realized things are hardware...

...enough philosophy...

I want to "contribute" a minor bit to this discussion...

There exists an effect, which was not mentioned before here.
It is called "polygon effect".

This effect occurs, if you have a chain, like a bike's chain.
If you use a belt, you normally let this belt not "sit" only on its teeths, you try to guide it between, because there you can maintain the circular shape and load the belt only tangential.
The teeths of the belt are not designed to withdraw some pressure. Of cource they have been some kind of hardened to reduce the abrasion in the inner side corners, but that is not because they are loaded with radial force.
It was already mentioned, we are not loading much forces to the belt, this is correct.
But because of this relatively minor load in relation to the maximum pulling force of most of the used belts it is also a minor ratio in relation to the mass of the belt.
And the mass of the belt is a measure for the oszillation or resonance.
If you let the belt "sit" on its teeths, perhaps you will not gain much more abrasion, but with belt tension you will generate a polygon around the pulley.
And then you will get the polygon-effect.

A short explain: Let us assume, that you have only a 6-teeths-pulley, then you generate a hexagon.
Then with 180 degrees aroound the pulley you can have 4 sides or only 3.
Then the pulley has to be longer or shorter. Of course this will not occur, instead of the other way around it will generate more or less tension direct proportional to the sinus/cosinus of the rotating angle.
This directly generates oscillation, which can get resonance depending on the "sleeping tension".

If you dont let the belt "sit" only on the triangular/trapezoid teeths, you can take also the space between every tooth and try to approach a nearly circular shape.

If you have much more load in relation to the mass of the belt, you will not have to consider any resonance and oscillation problems, because the resonance frequency value is much to high and the amplitude is much to less.

Of cource you can try to set the "sleeping tension" much more higher, but the heeling stepper axle, normally used, will not withdraw the needed radial force.

Please let me know, if there are some effects I did not consider!

@Lodran
Copy link
Author

Lodran commented Mar 20, 2014

@jeder73 the reason the discussion is off topic is because it is being recorded in Slic3r's github. Follow the github issue link, read it in context, and you'll understand why.

@jeder73
Copy link

jeder73 commented Mar 20, 2014

@Lodran: my understanding of this thread is the following: there is a feature request about slic3r knowing the z resolution for quantizing the layer height. The question is, if it also should know if there is a belt or a thread. If there is a belt here is the question if the three measures belt timing(tooth space), pulley teeth count and diameter are independent and therefore the new feature should handle all three or if is enough to handle only pulley teeth count and belt spacing...
The discussion about should clarify the motivation for handling all three.

Don't you think it is like that? Do you think it is just another discussion about hardware design?

@alranel
Copy link
Member

alranel commented Mar 14, 2017

I implemented this now.

@alranel alranel closed this as completed Mar 14, 2017
@alranel alranel added the Done This issue is implemented and considered complete. label Mar 14, 2017
@platsch
Copy link
Member

platsch commented Mar 21, 2017

@alexrj @lordofhyphens I just tested the feature implemented in 53fee67 and have two remarks:

  • what does this factor 4? is it motivated by @Lodran s comment? I think it leads to unpredictable behavior, e.g: if I use a z_steps_per_mm of 0.1 and a layer_height of 0.3, I would expect no correction since 0.3 is a multiple of 0.1, but Slic3r corrects the layer_height to 0.4...

  • I've never experienced serious microstepping problems so I'm not sure if it is an issue, but with your solution a first_layer_height or raft setting can lead to a situation where no layer is matched (e.g. a first_layer_height of 0.25 in my example would never meet the full step). The motor would be equally off of the full step for each layer, but is that the idea? Maybe doing a simple modulo after computing the layer height vector would be a better solution? Drawback is aliasing effects if a small error accumulates over a few layers until it causes a +- extra step.

@Lodran
Copy link
Author

Lodran commented Mar 22, 2017

@platsch

• the factor of 4 is a result of @nophead's input, early in the thread.

• It doesn't have to hit full steps. The goal here is repeatability - as long as the carriage moves exactly (quanta) mm each layer, that's what we're after.

@platsch
Copy link
Member

platsch commented Mar 22, 2017

@Lodran thx for the explanation, I overlooked @nophead's statement. Anyway, I still think it not transparent for the user and should be at least stated in the tooltip.

@nophead
Copy link

nophead commented Mar 22, 2017

On machines with lead screws you have plenty of excess Z resolution, so you can afford to throw a lot away for better accuracy by avoiding part step positions. On a machine with a belt driven Z axis you can't and ironically that is where errors in microstepping or coil asymmetries are likely to be noticeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done This issue is implemented and considered complete. Feature request This is an idea for a new feature in Slic3r
Projects
None yet
Development

No branches or pull requests

8 participants