Moving nozzle up down



  • Hi.
    For some unknown reason, i can not move nozzle head up or down, when i run it as script or over some external SW. Funny part is that i can move it normally when i press on Z icons ( head movement part )

    This does not work :
    G28
    G1 X100 Y30 F15000
    ;---------------------------
    G1 Z-15 P60 F6000
    G4 P150
    G1 Z15 P60 F6000
    ;--------------------------
    G1 X0 Y0 F15000
    ////////////////////////////////////////////////////////////////
    but this works OK:
    G28
    G1 X100 Y30 F15000
    ;---------------------------
    M120
    G91
    G1 Z-15 F6000
    M121
    G4 P150
    M120
    G91
    G1 Z15 F6000
    M121
    ;---------------------------
    G1 X0 Y0 F15000

    ?
    I know that second option is not right approach i just write it for test purposes.
    A.



  • The gcode in the first part is telling the nozzle to move to Z-15 as an absolute position, ie 15mm below the bed, which it can't do!

    The G91 command in the second part tells the printer to use relative movements, ie move -15mm from this point. This may still be an illegal move, but if the nozzle is at or above Z15 after homing (G28), it would be fine. You should switch back to absolute movements at the end, with G90.

    Not sure why you need the M120 (push) and M121 (pop) commands.

    Ian



  • The gcode in the first part is telling the nozzle to move to Z-15 as an absolute position, ie 15mm below the bed, which it can't do!
    *** Hmmm, maybe we didnt understand us correctly. Nozzle working hight is cca 8 cm above conveyor track and if i enter Z-15 top of the nozzle should be lowered few mm above track. If i enter Z15, arm are lifted up.....

    This is working
    G28
    G1 X100 Y30 F15000
    ;---------------------------
    G1 Z-25 P60 F15000
    ;--------------------------
    G4 P150
    M106 S255
    G4 P150
    M106 S0
    ;-------------------------
    G1 Z25 F15000
    ;--------------------------
    G1 X0 Y0 F15000

    but last command is not executed ( arms are not moved to X0 Y0 ).
    David has suggested / explained this, but it looks like i can not implemented it.

    Not sure why you need the M120 (push) and M121 (pop) commands.
    *** i dont need them at all but without them last command is not executed.

    A.



  • @Arnix_2

    Are those commands with Z25 and Z-25 supposed to be relative moves? The values suggest they are.

    If you are in relative mode then the G1 X0 Y0 is working as expected.

    Frederick



  • Are those commands with Z25 and Z-25 supposed to be relative moves? The values suggest they are.
    *** I understand that this last command is not executed because i entered 91, which triggers relative movement so X and Y is will be processed on the same way but i dont know how to make this otherwise.

    So, what would you suggest to make simple pickup routine like:

    • locate object on some position --> X100 Y30
    • move down/up
    • move to some predefined position --> X250 Y10
    • repeat

    When i was using stepper motors this pickup part was working OK..

    A.



  • Hi,

    Well just proceed any relative move by a G91 and any absolute move by a G90.

    You can switch back and forth from relative to absolute anytime you need to.

    Frederick



  • OK. This is working as i need to..
    I will test this with external program but as far as i can remeber i did not put extra G90 commands into code...
    Anyhow, thank you !

    Btw. If you have time/wish please look at my other post regarding nozzle positioning:
    https://forum.duet3d.com/topic/12566/nozzle-positoning-problems

    Working solution for test up / down movement:

    G28
    G1 X100 Y60 F15000
    ;---------------------------
    G91
    G1 Z-25 F6000
    ;--------------------------
    G4 P150
    M106 S255
    G4 P150
    M106 S0
    ;-------------------------
    G91
    G1 Z25 F6000
    ;--------------------------
    G90
    G1 X0 Y0 F15000



  • This post is deleted!

  • administrators

    @Arnix_2 said in Moving nozzle up down:

    This does not work :
    G28
    G1 X100 Y30 F15000
    ;---------------------------
    G1 Z-15 P60 F6000
    G4 P150
    G1 Z15 P60 F6000
    ;--------------------------
    G1 X0 Y0 F15000

    Bear in mind that your M108 M208 Z limits also affect whether Z moves will be accepted.



  • @Arnix_2

    There is nothing wrong with extra G90/G91 commands but remember that once you change mode (absolute/relative) it stays in that mode until something else changes it.

    So in this case that second G91 is not strictly needed but it doesn't hurt.

    Now backing up to the G28. Since this is going to invoke your homeall file you may not be sure what mode (absolute/relative) is active when G28 completes. So it would be safest to add a G90 command before the G1 command.

    Glad to hear you got it working.

    Frederick


  • administrators

    @fcwilt said in Moving nozzle up down:

    Now backing up to the G28. Since this is going to invoke your homeall file you may not be sure what mode (absolute/relative) is active when G28 completes. So it would be safest to add a G90 command before the G1 command.

    Not necessary, because whenever a macro file executes (including a homing file), the G90/G91 state is pushed and popped around the call to the macro file.



  • @dc42 said in Moving nozzle up down:

    Not necessary, because whenever a macro file executes (including a homing file), the G90/G91 state is pushed and popped around the call to the macro file.

    I had forgotten that. Thanks.

    Even with that fact we don't know what state exists before the G28.

    Frederick



  • @dc42 said in Moving nozzle up down:

    Bear in mind that your M108 Z limits also affect whether Z moves will be accepted.

    Do you mean M208?

    Frederick


  • administrators

    @fcwilt said in Moving nozzle up down:

    @dc42 said in Moving nozzle up down:

    Bear in mind that your M108 Z limits also affect whether Z moves will be accepted.

    Do you mean M208?

    Frederick

    Yes!


Log in to reply