76

Re: Firmware Z wobble compensation

nickythegreek wrote:

teal, you should put your rocker up on thingiverse (tagged solidoodle) with a link to the wiki page.  That way if people are not part of this forum, they can still find the solution there.  And that way others can add it to their collections or remix it to fit different laser pointers.  Then we can link the thingiverse inside the wiki.

Okay, I've added the object to thingiverse ( http://www.thingiverse.com/thing:53958 ) and edited the wiki to point to the new link.  I've also made some minor edits that I think make a few potential points of confusion a little bit clearer. I hope you all agree.

77

Re: Firmware Z wobble compensation

Are we entirely WRONG about the causes of wobble?

After re-reading the reprap magazine post, I finally understand what the author is trying to say.  My solidoodle firmware is set to 2268 steps/mm for z-axis motion, which corresponds to 2268*1.411 = 3200 steps per rotation of the z-axis threaded rod.  The article implies that stepper motors are only accurate for 200 steps per rotation, and that there are 16 microsteps between each full step.  The problem is that stepper motors are non-linear when microstepping, so ideally you only want the stepper motor to move in 1/200th-revolution increments.

The calculations in the article seem to be a bit off.  It seems like you'd want your layer heights to be .1058,  .1976, and .3034 instead of .1, .2, and .3, respectively, and that this should eliminate wobble.  I don't have access to my sd right now, so can somebody verify this?

If this is true, this can have strong implications for firmware wobble compensation, since our current solution might only work for positioning that is a multiple of .1mm.  Instead, we'd want to base any compensation of raw motor micro-step (step%16) instead.

78

Re: Firmware Z wobble compensation

Again, if the stepper motors were accurate at 200 steps per rotation, the rounding error should still be (maximum) 1.41/200 = 0.007mm, one and a half orders of magnitude less than the minumum layer height.

Anyway I usually print at .28 (~=1.41/5), I started in the hope to minimize this quantization error, but never saw any difference, until the wobbling compensation. And, as you remarked before, we wouldn't see a wobbling that has the same period as the rod.

79

Re: Firmware Z wobble compensation

Rincewind wrote:

Again, if the stepper motors were accurate at 200 steps per rotation, the rounding error should still be (maximum) 1.41/200 = 0.007mm, one and a half orders of magnitude less than the minumum layer height.

Anyway I usually print at .28 (~=1.41/5), I started in the hope to minimize this quantization error, but never saw any difference, until the wobbling compensation. And, as you remarked before, we wouldn't see a wobbling that has the same period as the rod.

Yeah, I've been going back and forth in my mind about it this morning since I can't actually print anything at the moment to test.  But you're right that since we have an imperial threaded rod, we've in fact guaranteed that any roundoff-based wobble (if real) *cannot* have the exact same pitch as our lead screw. 

I did some calculations in excel to find out how the microstepped value (e.g. z-step % 16) varied with .1mm layer position.  The function is not quite periodic since there is roundoff in calculating the z-step value, but I got an interesting saw curve with a period of about .6mm, nowhere near our thread pitch wobble of 1.411mm (graph attached) that everybody is seeing.

Post's attachments

Screen Shot 2013-02-25 at 3.00.11 PM.png
Screen Shot 2013-02-25 at 3.00.11 PM.png 36.92 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

80

Re: Firmware Z wobble compensation

I'll cross-post this to the Taxonomy of Z axis artifacts and then I think we might continue the discussion there.

The quantization error would not be seen as a wobble, but rather as spikes when the rounding goes to the next integer number. And we don't really care (banding-wise) if the layer height is really accurate, as long as it is the same as the layer before.

Following is a plot of actual layer height vs layer position (for 0.1mm layers) due to rounding errors, in blue considering (ideal) microsteps and in red considering only full steps.

As you see, in the worst case we have spikes every .6mm and the maximum difference is .007mm, which is not the sinusoidal banding that we usually see. In the (ideal) microstep case, things go much better.

Post's attachments

layerHeight.png
layerHeight.png 8.89 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

81

Re: Firmware Z wobble compensation

Rince, can you update the parent post to let people know that the downloadable zip firmware is for SD2 users only and that SD3 users will need to do the manual include process. Would hate for someone to make that mistake.

82

Re: Firmware Z wobble compensation

nickythegreek wrote:

Rince, can you update the parent post to let people know that the downloadable zip firmware is for SD2 users only and that SD3 users will need to do the manual include process. Would hate for someone to make that mistake.

Nicky,  Just an FYI....

I upgraded my SD3 with new code and only manually changed the Max X and Max Y in the code and have not had any issues yet.

83

Re: Firmware Z wobble compensation

Admins, if you are reading this, can we make this thread sticky? It seems that it's being referenced quite a few times now. Thanks

84

Re: Firmware Z wobble compensation

I have been trying this and it seemed to work at first but not so much anymore. I took three different measurements with tealvince's laser level and I get three slightly different results. Is my Z rod too bent for this to work?

85

Re: Firmware Z wobble compensation

FatalDischarge wrote:

I have been trying this and it seemed to work at first but not so much anymore. I took three different measurements with tealvince's laser level and I get three slightly different results. Is my Z rod too bent for this to work?

For software compensation to work, the measurements have to be repeatable.  If you're getting variability then I'm guessing something has loosened up in your setup.  If you have an anti-backlash solution, try tightening it up or adding a spring.  If you don't have one, you probably need one.

86

Re: Firmware Z wobble compensation

I tried tightening the anti-backlash nut. That didn't help. Does this have anything to do with it?

22:57:19.322 : ZWobble Amp (A) 0.00 phase (P) 0.00 period (W) 1.41 puls 4.45 Warning! Inconsistent parameters!

87

Re: Firmware Z wobble compensation

Don't you hate it when you type an error code into Google and it seems that you are THE ONLY one with this specific issue and the only link it suggests for you, is a link right back to here? hmm

88

Re: Firmware Z wobble compensation

When are you getting this error?  If it's when you're entering in data points, what is the file/commands you are sending?

Normally, you should get a plot of the data points you've entered.  It looks like you don't have any.  Are you sure all the letters are capitalized?  It should look like this:

M97 A0
M96
M97 W1.411 P0
M97 Z0.0 L0
M97 Z0.1 L17
M97 Z0.2 L36
M97 Z0.3 L55
M97 Z0.4 L76
M97 Z0.5 L96
M97 Z0.6 L115
M97 Z0.7 L134
M97 Z0.8 L151
M97 Z0.9 L166
M97 Z1.0 L182
M97 Z1.1 L195
M97 Z1.2 L210
M97 Z1.3 L224
M97 Z1.4 L240

89

Re: Firmware Z wobble compensation

FatalDischarge wrote:

I tried tightening the anti-backlash nut. That didn't help. Does this have anything to do with it?

22:57:19.322 : ZWobble Amp (A) 0.00 phase (P) 0.00 period (W) 1.41 puls 4.45 Warning! Inconsistent parameters!

Sorry for the brevity, but i'm on the go. Tealvince is right. I just want to specify that this error just means that you haven't entered a valid set of parameters. And indeed the amplitude is zero, so no correction is applied. You would get the same warning if the amplitude was too big with respect to the period.

90 (edited by FatalDischarge 2013-04-25 18:30:21)

Re: Firmware Z wobble compensation

This is what my code looks like:

M97 A0    ; turn off any previous wobble compensation
M96        ; print settings
M97 W1.411 P0    ; set period to 1/18th inch
M97 Z0.0 L0        ; enter deflection measurements in last column
M97 Z0.1 L9
M97 Z0.2 L20
M97 Z0.3 L32
M97 Z0.4 L44
M97 Z0.5 L56
M97 Z0.6 L68
M97 Z0.7 L80
M97 Z0.8 L91
M97 Z0.9 L100
M97 Z1.0 L109
M97 Z1.1 L118
M97 Z1.2 L125
M97 Z1.3 L134
M97 Z1.4 L144
M96    ; print compensation curve

Do I need to edit out the comments? Is that all?
EDIT: No, that's not all.

91 (edited by FatalDischarge 2013-04-25 18:55:49)

Re: Firmware Z wobble compensation

Here is the full output:

12:32:08.219 : ZWobble Amp (A) 0.00 phase (P) 0.00 period (W) 1.41 puls 4.45 Warning! Inconsistent parameters!
12:32:08.318 : Printjob finished at 4/25/2013 12:32 PM
12:32:08.318 : Printing Time:0s
12:32:08.318 : Lines Send:19
12:32:08.371 : Custom wobble function phase (P) 0.00 period (W) 1.41 puls 4.45
12:32:08.371 : Rod: 0.00 Act: 0.00                      +
12:32:08.371 : Rod: 0.10 Act: 0.07               +
12:32:08.371 : Rod: 0.20 Act: 0.16              +
12:32:08.371 : Rod: 0.30 Act: 0.28                  +
12:32:08.371 : Rod: 0.40 Act: 0.40                      +
12:32:08.371 : Rod: 0.50 Act: 0.51                        +
12:32:08.371 : Rod: 0.60 Act: 0.65                               +
12:32:08.371 : Rod: 0.70 Act: 0.76                                  +
12:32:08.371 : Rod: 0.80 Act: 0.88                                     +
12:32:08.371 : Rod: 0.90 Act: 0.96                                  +
12:32:08.371 : Rod: 1.00 Act: 1.06                                 +
12:32:08.371 : Rod: 1.10 Act: 1.15                               +
12:32:08.371 : Rod: 1.20 Act: 1.24                             +
12:32:08.371 : Rod: 1.30 Act: 1.32                         +
12:32:08.371 : Rod: 1.40 Act: 1.40                      +
12:32:08.371 : Rod: 1.41 Act: 1.41                      +

This is what happens when I run just the code and at the beginning of every print.

92

Re: Firmware Z wobble compensation

If I send just M96 I get the parameters warning.

93

Re: Firmware Z wobble compensation

Unless I'm missing something, I also got that error when working with a 'zeroed' calibration... I think it even still turns up. But I just ignored it, followed the calibration steps, and I can see there is a noticeable difference on print quality.

Have you tried just moving on with the calibration steps and ignoring what I believe is merly a warning due to the 'zeroed' state of the paramters when first executing the M96.. the second M<96 produces the + graph you have presented.

I think you can basically ignore the error and proceed - thats certainly all I do smile

94

Re: Firmware Z wobble compensation

adrian wrote:

Unless I'm missing something, I also got that error when working with a 'zeroed' calibration... I think it even still turns up. But I just ignored it, followed the calibration steps, and I can see there is a noticeable difference on print quality.

Have you tried just moving on with the calibration steps and ignoring what I believe is merly a warning due to the 'zeroed' state of the paramters when first executing the M96.. the second M<96 produces the + graph you have presented.

I think you can basically ignore the error and proceed - thats certainly all I do smile

Yes.  That's precisely what's happening.  I didn't realize this is what you were describing.  The first M96 is just meant verify that all previous calibration values are removed before adding new ones, while the second is the "after".

95

Re: Firmware Z wobble compensation

When I try to compile the Marlin sketch after making these changes, I get the following error message in the Arduino software...

ZWobble.cpp: In member function 'long int ZWobble::InsertCorrection(float)':
ZWobble.cpp:382: error: 'copy_position' was not declared in this scope
ZWobble.cpp:442: error: 'set_position' was not declared in this scope

Is that a problem?

96

Re: Firmware Z wobble compensation

wilheldp wrote:

When I try to compile the Marlin sketch after making these changes, I get the following error message in the Arduino software...

ZWobble.cpp: In member function 'long int ZWobble::InsertCorrection(float)':
ZWobble.cpp:382: error: 'copy_position' was not declared in this scope
ZWobble.cpp:442: error: 'set_position' was not declared in this scope

Is that a problem?

Uhm, yes it's a problem, and it should not happen. Did you insert the modifications manually into an original Marlin? I strongly suggest using Lawsy's fork that already contains the z wobble compensation mod.

Technically, those functions were implemented in Neil Martin's hysteresis fix, which was eventually removed from Lawsy's and never made into the official branch. The code that is in Lawsy's repo now doesn't depend on them anymore.

If you would like to insert the correction manually, I suggest you anyway take ZWobble.h and ZWobble.cpp from Lawsy's github.

97

Re: Firmware Z wobble compensation

Rincewind wrote:

Uhm, yes it's a problem, and it should not happen. Did you insert the modifications manually into an original Marlin? I strongly suggest using Lawsy's fork that already contains the z wobble compensation mod.

Technically, those functions were implemented in Neil Martin's hysteresis fix, which was eventually removed from Lawsy's and never made into the official branch. The code that is in Lawsy's repo now doesn't depend on them anymore.

If you would like to insert the correction manually, I suggest you anyway take ZWobble.h and ZWobble.cpp from Lawsy's github.

I got the latest SD3 firmware from SD's website, and inserted the changes manually.  I didn't want to revert back to a previous firmware version because I could fix z-wobble, but maybe break something else.  I got the .h and .cpp files from Lawsy's GitHub and followed the step-by-step directions in this thread.  The only thing I can think of is that the copy_position and new_position variables are no longer used by planner.h.

Does Lawsy's fork use all of the current firmware features for the SD3?

98 (edited by adrian 2013-04-27 15:55:57)

Re: Firmware Z wobble compensation

wilheldp wrote:

Does Lawsy's fork use all of the current firmware features for the SD3?

Yes. The only delta is in relation to some size settings and home switches that are superfluous. If anything, lawsys is the more 'up to date' feature wise (its where SD got their latest firmware from wink )

You will just need to make sure you set the define in Configuration.h for the solidoodle3 not 2; that takes care of the rest config wise.

99

Re: Firmware Z wobble compensation

Got a link to the latest version?  Are there instructions on what to set in the configuration file? 

I'm only hesitant about this because the printer is working decent already (I just want it to be great), so I don't want to break anything that already works.

100

Re: Firmware Z wobble compensation

I did a partial overhaul, Spring Cleaning if you will, and my problem seems to be gone. It turns out the issues I was having were unrelated to the wobble compensation. I hadn't noticed it before but my hotend was a bit loose in the MK4 extruder. I think that was the main problem.
I think overheating electronics contributed to my problems as well so I soldered the necessary pins for a fan and now I feel good. Thank you to tealvince, Rincewind, and all who help solve the wobble issue. smile