Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    How to use Mid Position Switch to home

    Scheduled Pinned Locked Moved
    General Discussion
    3
    4
    170
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Skyhawk757undefined
      Skyhawk757
      last edited by

      I am using a Duet 3 Mini+ with the latest software (3.5.4) with a pick and place machine. I don't want to move the head of the pick and place machine until the two pickup heads are in their middle position. (One head goes up when the other goes down using one z-axis stepper motor).

      My hardware has a switch that transitions from closed to open at about the midpoint. This works.

      I am very new to Gcode, reprap, duet, etc.

      I tried using a conditional to move the z-axis in the direction toward the middle, but nothing happens. It also seems that having the z endstop triggered may cause a problem.

      How do I configure my homez.g and config.g to make this work? Is is possibe?

      I also noticed that homing will cause the x axis to home first, then the Y, and finally the Z. I need the z to home first, and they it is safe to move the x and y for homing.

      Thanks
      Greg

      infiniteloopundefined engikeneerundefined Skyhawk757undefined 3 Replies Last reply Reply Quote 0
      • infiniteloopundefined
        infiniteloop @Skyhawk757
        last edited by

        @Skyhawk757

        I () noticed that homing will cause the x axis to home first, then the Y, and finally the Z.

        That’s what most homing templates do, but you are free to home the axes in whatever order you need.

        My hardware has a switch that transitions from closed to open at about the midpoint. This works.

        Maybe, but prior to home an axis, you don’t know where to find the center - chances are that the head smashes into a hard limit, e.g. a gantry, an extrusion or similar fixed mechanical parts. Having an end switch leaves you with just two options: either the switch is active, meaning that the head is already in a known position, or the head must be moved towards the switch (I.e. into a known direction) until it is triggered. Note that these switches can be (and are often) placed outside the working area, they are only needed during initialisation.

        In fact, homing is a two-step process: First, move all axes towards a known position (typically: towards an endstop). Using this known position, you then establish a coordinate system for the axes to operate within. The origin of the coordinate system is completely independent of the endstops, for my printer, the X/Y origin is at the center of the bed, so that I can operate on all four quadrants.

        As an option, you can fine-tune an axis - for a 3D printer, this typically means to adjust the Z-height by probing the print bed. PnP machines may be different, but you can adapt this probing to your specific needs.

        1 Reply Last reply Reply Quote 0
        • engikeneerundefined
          engikeneer @Skyhawk757
          last edited by

          @Skyhawk757 do you mean that your switch is open in the bottom half of the axis, and closed in the top half? (Or vice versa)

          In that case, I think you can do what you want, but will need to redefine your endstops in your conditional between active high and active low, as well as the direction in which to travel for the homing move. Use a standard homing move, then G92 Z___ to set the z height to whatever the switchover height is.

          The endstops look for the state, not a state change, so if you set them as active high, and the switch is already open, then it will think it has hit the 'endstop' and so stop and mark the axis homed which is not what you want in this case.

          As @infiniteloop says, this methodology is a little non-standard and does carry some risks, but I think you should be able to work it.

          If you have specific questions on the implementation, then probably best to post what you've got. I'll admit my knowledge of conditional gcode is a little lacking, but I'm sure someone else would be able to help.

          E3D TC with D3Mini and Toolboards.
          Home-built CoreXY, Duet Wifi, Chimera direct drive, 2x BMG, 300x300x300 build volume
          i3 clone with a bunch of mods

          1 Reply Last reply Reply Quote 0
          • Skyhawk757undefined
            Skyhawk757 @Skyhawk757
            last edited by

            @Skyhawk757

            Thanks. I did figure out a way to do it. I used a conditional (while) and that checked that status of my mid-point homing switch. If triggered, it moved 1 mm at a time in the direction towards the middle.

            Following this I used a G0 command with the option (if forget what that option was called) that moves until the limit switch is triggered.

            This results in the axis only moving toward center (with a little overshoot).

            I am impressed with the Reprap gcode. Good job! Great flexibility!

            Thanks
            Greg

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Unless otherwise noted, all forum content is licensed under CC-BY-SA