Close



Results 1 to 10 of 55

Threaded View

  1. #11
    Staff Engineer printbus's Avatar
    Join Date
    May 2014
    Location
    Highlands Ranch, Colorado USA
    Posts
    1,437
    Add printbus on Thingiverse
    TESTING Z AXIS TRAVEL WITH GCODE

    I'm posting Z axis testing separately since I want to make a point with it. Here's some gcode to start with -

    PREFACE: Gcode provided below always starts by homing Z as a safe thing to do, and this adds a delay to every test while it completes. There'd be other ways to go about this, by manually raising the X-carriage to some height and then running the test. I went with the safe route.

    Code:
    ; gcode for testing the Z axis
    G0 F120 ;prepare for a safe homing rate of 2mm/sec
    M201 Z5 ;prepare for a safe homing acceleration 
    G28 Z  ; home Z to initialize it
    M201 Z1 ; this overrides the DEFAULT_MAX_ACCELERATION for Z
    G0 F120  ; set travel rate to be used in mm per minute
    G0 Z20   ; move to Z = 20 mm
    G0 Z10   ; move to Z = 10 mm
    G0 Z20
    G0 Z10
    This starts by homing the Z axis with a known safe Z axis feed rate and the MakerFarm default for the Z term in DEFAULT_MAX_ACCELERATION. After homing, the X-carriage is raised to 20mm, using a real slow acceleration value. The X-carriage is then moved between 20mm and 10mm heights a few times.

    Prior experimenting with various homing feedrates had indicated I could get resonations caused by certain Z travel rates, just like I had experienced on the X axis. This gcode starts with the slow acceleration rate of 1 mm/sec per second in order to listen for them. Sure enough, adjustment of the Z motor stepper driver while the carriage was moving up and down eliminated the resonation sound here too. I later measured the current limit adjustment on the Z stepper driver set to 0.125v.

    The G0 F120 feed rate is as fast as we can go with firmware built to a DEFAULT_MAX_FEEDRATE of 2 mm/sec for Z. If you want to test faster than that, you have to either upload revised firmware or change Vmax Z from the LCD Control | Motion menu. The gcode starts with homing performed at a proven speed so that any issues you have later with motor skips won't occur in a subsequent Z home. It's important to understand that settings loaded into the printer by one gcode file will remain in effect until changed by another, or changed by reset, etc.

    Now it's time to fiddle with acceleration. With the gcode as provided, we see how the Z axis slowly accelerates and decelerates for our 10mm travels. Observe the MakerFarm default for Z acceleration of 5 mm/sec per second. Go higher. Try 10. 50. 100. 500. Do you observe any negative effects of a high acceleration setting?

    Results with long-distance travels on Z are of marginal value since real prints won't involve those kinds of moves. Here's some different gcode -

    Code:
    ; gcode for testing rapid back and forth movements on the Z axis
    G0 F120 ;prepare for a safe homing rate of 2mm/sec
    M201 Z5 ;prepare for a safe homing acceleration 
    G28 Z  ; home Z to initialize it
    M201 Z5 ; this overrides the DEFAULT_MAX_ACCELERATION for Z
    G0 F120  ; set travel rate to be used in mm per minute
    G0 Z20   ; move to Z = 20 mm
    G0 Z19.8   ; move to Z = 19.8 mm
    G0 Z20
    G0 Z19.8
    G0 Z20
    G0 Z19.8
    G0 Z20
    G0 Z19.8
    This performs a Z home and raises the carriage to 20 mm as before. Then the carriage is rapidly moved up and down 0.2mm, the same distance for a typical layer height shift. The gcode sets the acceleration to the MakerFarm default of 5 mm/sec per second. Note how a 0.2mm change in height is 1/4-turn on the Z rods. This makes sense since the M5 rods have a full-turn pitch of 0.8mm, so 0.2mm in height would be one fourth of that. Now try higher values for the acceleration term. It's hard to tell if the motor really finishes the quarter turn with higher acceleration rates like 100 or 500 mm/sec per second. Maybe those values are fine, but 50 mm/sec per second definitely looks promising, even at this fast zig-zag height adjustment.

    Why would this be important? After all, a print only involves a certain number of layer shifts and speeding them up will only save some number of seconds over the print. Well, increasing the Z acceleration term would also speed up incremental height adjustments for spiral contours and printing with auto-bed-leveling, and especially speed up prints if you're lifting Z on each retraction.

    In a subsequent post, I'm also going to be suggesting there's an advantage to having all the terms in the DEFAULT_MAX_ACCELERATION about the same. This is a key reason why I'm looking for an acceptable Z axis acceleration value higher than the MakerFarm default of 5 mm/sec per second. Our printers aren't a delta where the suspended hot end could bounce around on a fast move. The 0.8mm pitch Z rods are going to inherently provide some limit in how fast we can try to raise the i3v X-carriage. The aluminum v-rails provide a movement with minimal slop, compared to round rods and notorious linear bearings used on common prusas. IMO, we can accommodate some serious increase in the Z axis acceleration setting on the i3v.

    But first, I feel the need for some gcode to test the extruder with.

    HOMEWORK AND INDEPENDENT STUDY
    Revise the second block of gcode so that the travels continue in the same direction (20.2, 20.4, 20.6, etc.). IDK, it's just something to do.

    Then add something like a 200 mSec delay between moves by adding a G4 P200 dwell command between each of the multiple G0 commands. This allows you to better see each of the height adjustments. Experiment with the acceleration term again. Does a value of 500 mm/sec per second seem to work OK? Keep that in mind for later.

    FOLLOWUP COMMENT: Keep in mind that the mass of the x-carriage makes it harder for the Z motors to increase the Z-axis than to lower it.
    Last edited by printbus; 04-14-2016 at 11:55 AM. Reason: typos in the code block comments

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •