Calibration of the Z wobble

From SoliWiki
Jump to: navigation, search

In order to reduce/eliminate the banding, a custom firmware patch can be used to compensate for the Z wobble. It is important to notice that this fix is best applied after the other sources of banding have been removed.

The "geometrical" assumption behind this firmware mod is that mechanical imperfections have introduced a periodic error curve to the real linear trajectory of the bed. This curve is often sinusoidal. This would be the case if the rod section was elliptical instead of round. In practice, the rod would not be perfectly aligned with the axis of the nut. However, even if the mechanical problem was more complex than that, any periodic banding would still have a main component that can be described as sinusoidal: thus applying the sinusoidal fix would fix the first harmonics of the banding, leaving only higher spatial frequencies, which would be less evident given the finite layer thickness. If the sinusoidal correction is not sufficient, and a method for accurately measuring bed position is available, the firmware can also compensate for arbitrary periodic functions superimposed to the ideal linear movement, leading to near-perfect compensation for any banding that is periodic in nature.


[edit] Uploading the modified firmware

This modification is part of the latest (lawsy's) firmware. This is, however, not the firmware that is shipped with the Solidoodle at present. Follow the Updating Solidoodle Firmware page to upgrade to the latest version.

[edit] Firmware features

This firmware compensates for uneven layer height generated by a wobble of the Z axis that makes the translation rod movement->bed (extruder) movement nonlinear. Instead of assuming Zactual (the Z coordinate that you get in the bed) == Zrod (the Z coordinate that you multiply by the step size to control the motor), the function assumes that Zaxtual = Zrod + Fn(Zrod), and Fn(Zrod) = A*sin(w*Zrod + phase) for sinusoidal correction. Since the user wants to specify Zactual, we need to invert the formula to obtain Zrod, which is the value that will serve as the input of the motor. An alternate compensation method loosens the assumption of sinusoidal error and allows the direct measurement of the Zactual, still in the assumption that the imperfection is periodical. The period of the imperfection should correspond to the pitch of the lead screw (1.411 mm in the case of the Solidoodle)

The firmware accepts two new M-codes for control: M96 (which reports the current status) and M97 (which sets the parameters).

[edit] Experimentally-obtained sinusoidal correction

Before a print, set the parameters Amplitude, Period and Phase of the sinusoid function using the M97 code like this:

M97 A<Amplitude_in_mm> W<period_in_mm> P<phase_in_degrees>

This code can be inserted at the beginning of the GCode of the print you are about to do, or can be sent manually (eg from RepetierHost, in the tab "manual control", you can send your own gcode instructions to the printer)

A good value for the period is the thread step of the Z rod (in the Solidoodle2 it is 1.41) The other two parameters need to be determined experimentally (Amplitude will be <0.1 typically) by printing various cubes at with different values of phase between 0 and 360 and various amplitudes between 0 and 0.1

A good experimental setup is to set the compensation period in Pronterface so that the compensation slowly drifts out of phase instead of matching the 18tpi thread pitch. For instance, while printing a 2" object, the compensation should normally repeat 18*2=36 times. If you set the period to 1.451mm instead of 1.411mm, however, then it will repeat only 35 times and progressively get out of phase until it is out of phase one full cycle (-360 degrees) at the top of the object.

After printing, identify the layer height at which the compensation seems to be in phase (i.e. looks the best). Calculate the phase value:

theta = <distance_of_best_layer_from_the_top> * 360 / total_height

and "theta" should be your optimal Phase correction value. You can then experiment to find the optimal Amplitude value.

[edit] Measured arbitrary periodic correction

This method needs a dial indicator or a laser pointer with a "rocker" (see this thingiverse object, picture)
Laser rocker.jpg

It is more general since it can compensate for any periodic error even more complex than a simple sinusoidal.

  • Print the laser rocker, making any modifications necessary to fit your laser pointer, or mount the dial indicator on the extruder head.
  • Home the print head and fit the rocker on the bed with a laser pointer aimed at a sheet of paper taped to a wall about 10-20 ft away. Rest the point of the rocker near the rear edge of the bed and hook its far end underneath the closest x-axis rod.
  • Send the following codes to home the print head, clear any previous compensation, and move down one full rotation of the z-axis threaded rod (1.411mm):
M97 A0
G1 Z1.411
  • To avoid any backlash, start measurements from this location (one revolution away from home) instead of at zero. First undo any backlash by manually stepping the bed up (head down) a few .1mm steps and then back down (head up) the same number of steps.
  • Mark the laser point (base point), or zero the dial indicator, then make an additional 14 marks, continuing to move the bed down (head up) .1mm between each mark.
  • Measure the distance (in mm or any unit) to each of the 14 marks from the initial point.
  • For convenience, copy the following gcode into a text file entering the 14 numbers into the indicated spaces:
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 L<distance between 1st and base point>
M97 Z0.2 L<distance between 2nd and base point>
M97 Z0.3 L<distance between 3rd and base point>
M97 Z0.4 L<distance between 4th and base point>
M97 Z0.5 L<distance between 5th and base point>
M97 Z0.6 L<distance between 6th and base point>
M97 Z0.7 L<distance between 7th and base point>
M97 Z0.8 L<distance between 8th and base point>
M97 Z0.9 L<distance between 9th and base point>
M97 Z1.0 L<distance between 10th and base point>
M97 Z1.1 L<distance between 11th and base point>
M97 Z1.2 L<distance between 12th and base point>
M97 Z1.3 L<distance between 13th and base point>
M97 Z1.4 L<distance between 14th and base point>
M96	; print compensation curve
  • To send the compensation values to the printer, just load the gcode file above and "print" it. The M96 command at the bottom should print the defined curve, which will typically take the form of a sinusoidal-like wave. As these settings are not persistent (i.e. will be lost when the Solidoodle USB cable is unplugged) you should do this at the start of each session or may wish to add it to your slicing app's starting gcode.
  • (optional) use the laser rocker again with compensation enabled to verify that bed movements are now equally spaced.

If recalibration is ever necessary in the future (if printer is jostled or the stop screw changed), restart at step 3.

Personal tools