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

Z switch on expansion board, latency issue??

Scheduled Pinned Locked Moved
Firmware installation
5
23
943
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.
  • undefined
    deckingman @arhi
    last edited by 5 Jul 2020, 14:21

    @arhi said in Z switch on expansion board, latency issue??:

    That makes no sense 😞

    Glad you think so too.

    But still, even with 1ms delay at 600mm/min that's 0.01mm error, not 10mm

    So I doubt this has anything to do with bouncing of the contact 😞

    That's what I was thinking. Although according to some, I'm just an old fart so what do I do I know?

    It seems that during a G1 Z-nn move, if it doesn't detect the switch at the exact time that it opens, then it will never detect that the switch is open, no matter how long it remains in that state.

    Ian
    https://somei3deas.wordpress.com/
    https://www.youtube.com/@deckingman

    undefined 1 Reply Last reply 5 Jul 2020, 14:29 Reply Quote 0
    • undefined
      arhi @deckingman
      last edited by 5 Jul 2020, 14:29

      @deckingman said in Z switch on expansion board, latency issue??:

      That's what I was thinking. Although according to some, I'm just an old fart so what do I do I know?

      they call me the same although I think I'm a lot younger than you 😄

      It seems that during a G1 Z-nn move, if it doesn't detect the switch at the exact time that it opens, then it will never detect that the switch is open, no matter how long it remains in that state.

      The weird part is your XY works ok at higher speed. So questions arise

      • how are your XY and Z switched configured?
      • if you move your X to the same board where your Z is will it work?
      • if you move your Z switch to the same board where X/Y are will it work?

      And also one easy experiment

      1. run the Z home (from far away from bed)
      2. manually open the switch (press with something)

      do [2] at different speeds (I know you cannot measure speed your hand is opening it but..)

      when you open the switcch and it does not stop, release it to close and open again to see if it will detect it then

      1 Reply Last reply Reply Quote 0
      • ?
        A Former User @deckingman
        last edited by 5 Jul 2020, 14:57

        @deckingman said in Z switch on expansion board, latency issue??:

        LED across that Z switch

        it'll discharge any capacitance faster, but but without any rc filter it'll be negligible i recon (but I'm more comfortable with outsourcing my analouge electronics tbh)

        in any case its more likely to be related to the switch than the expansion board/can interface imho, and running the wires back to the main board was the simple test for that. but it won't be a apples to apples test with the additional wiring so idk. visualization would be awesome - can you do a high speed video of the z switch led?

        undefined 1 Reply Last reply 5 Jul 2020, 15:40 Reply Quote 0
        • undefined
          deckingman @A Former User
          last edited by deckingman 7 May 2020, 15:42 5 Jul 2020, 15:40

          @bearer said in Z switch on expansion board, latency issue??:

          visualization would be awesome - can you do a high speed video of the z switch led?

          This is the video that is embedded in the blog post I linked too. It's not high speed as such (50fps). This is homing at 300mm/min first pass, then backing off 5 mm and doing 60mm/min second pass. https://www.youtube.com/watch?v=NbgS-Kh53nQ

          It's a composition using PIP to start with, then separate clips.

          The video should work but I'm not sure what permissions I set up for it. If it doesn't, run it from the blog post.

          Edit. At 600mm/min for the first pass, the bed just keeps rising until it jams up against the carriage.

          Edit 2. Let me know if you can actually see any movement of the nozzle when the contact breaks - nobody has as yet. 🙂

          Ian
          https://somei3deas.wordpress.com/
          https://www.youtube.com/@deckingman

          ? 1 Reply Last reply 5 Jul 2020, 15:43 Reply Quote 0
          • ?
            A Former User @deckingman
            last edited by 5 Jul 2020, 15:43

            @deckingman said in Z switch on expansion board, latency issue??:

            50fps

            had a look, but thats probaly far too slow to be helpful - I was hoping you had some sort of camera with higher fps support, some do as mostly a gimmick but can be usefull when you don't need the resolution.

            undefined 1 Reply Last reply 5 Jul 2020, 15:48 Reply Quote 0
            • undefined
              arhi
              last edited by 5 Jul 2020, 15:48

              can't see anything move when it triggers

              bunch of modern mobile phones has the high fps capability (have not find use if it yet)

              btw when I was building my first printer long time ago I was checking out the CNC endstops and 99% of them are made so that whatever is moving can pass on and is not in any way blocked by the end switch... I was thinking about using similar switch like that for my XYZ to do a super fast move to a proximity switch and then go slowly to the actual endstop but gave up as the cubebot finally had to be destroyed .. might not be a bad thing to setup for your machine irrelevant to this bug

              1 Reply Last reply Reply Quote 0
              • undefined
                deckingman @A Former User
                last edited by 5 Jul 2020, 15:48

                @bearer I might be able to speed it "digitally" (or rather stretch that event so it spans a longer time frame), but natively it's still 50 fps. Not sure what you are hoping to see. When homing fails at 600mm/min (10mm/sec), the LED lights and stays lit while the Z motor grinds away at trying to bend my rails (I always reduce the motor currents for homing, so no physical damage occurs).

                Ian
                https://somei3deas.wordpress.com/
                https://www.youtube.com/@deckingman

                ? 1 Reply Last reply 5 Jul 2020, 15:51 Reply Quote 0
                • ?
                  A Former User @deckingman
                  last edited by A Former User 7 May 2020, 15:58 5 Jul 2020, 15:51

                  @deckingman said in Z switch on expansion board, latency issue??:

                  Not sure what you are hoping to see

                  (hoping to not see) multiple flashes; but you'd need actual higher frame rate for that; it was just a thought as its more common for cameras (and phones) to have high fps functions at the cost of resolution today. and maybe, just maybe it could catch electrical bounce if it was severe enough.

                  undefined 1 Reply Last reply 5 Jul 2020, 16:18 Reply Quote 0
                  • undefined
                    deckingman @A Former User
                    last edited by 5 Jul 2020, 16:18

                    @bearer ....and of course, that video was with the switch working normally. I just stepped through the video and a single flash last about 2 frames which I guess is the time it takes for the motor to stop, change direction and then move the bed away from the nozzle. But surely, even if there were multiple flashes, faster than 50 Hz, indicating some sort of bounce, wouldn't the firmware eventually catch on to the fact that the switch had triggered? David indicated that if there was bounce, then the update frequency might be reduced to 10s of ms. I could live with that. But I'd guess I've left it grinding away at the carriage, with the LED fully lit, for about 10 seconds before I hit emergency stop.

                    It just seems that the firmware is looking for a fast low-high transient (or high-low) and if it doesn't see that transient, then it doesn't stop the motor (regardless of the fact that the switch might have changed state while it wasn't looking). I'm just wondering if the firmware does something different for Z homing because that often uses a probe and it needs to be more precise than the other axes. That would explain why the other axes work fine at double the speed at which the Z axis fails.

                    Ian
                    https://somei3deas.wordpress.com/
                    https://www.youtube.com/@deckingman

                    1 Reply Last reply Reply Quote 0
                    • undefined
                      deckingman
                      last edited by deckingman 7 Jun 2020, 19:27 6 Jul 2020, 19:26

                      OK. So me being a (retired) mechanical engineer, I came up with a mostly mechanical solution. I made a pivoting arm with a micro switch at one end and a spring at the other. Like this

                      switch1.jpg

                      When the bed gets to within about 60mm of the nozzle, a plate on the bed hits the switch. Any further bed movement simply pushes the pivoting arm up against the spring.

                      Then I use a "Fast Jog Z" macro which will be the first part of my home Z. So basically, if the bed is >60 mm below the nozzle, the macro will jog it up 50mm at 900mm/min and repeat that fast(ish) 50mm move, until the switch triggers. After that, my normal "slow" (300mm/min) Z homing macro will complete as normal. 900mm/min is 3 times faster than I had before but (slightly less with the slow down between moves). I might push it up even more (although less than a minute for the full 750mm travel is reasonable).

                      The macro is detailed in this thread https://forum.duet3d.com/topic/17438/more-conditional-gcode-help-required-solved/6

                      Ian
                      https://somei3deas.wordpress.com/
                      https://www.youtube.com/@deckingman

                      1 Reply Last reply Reply Quote 1
                      • undefined
                        fcwilt
                        last edited by 6 Jul 2020, 19:48

                        My solution involved two "beam break" detectors space 30 mm apart mounted on the frame (near Z min) and a 30 mm tall "blade" mounted to the bed that broke the beams.

                        Fast movement until the lower beam was broken, slower movement until the upper beam was broken.

                        This was on v2 until the setting (being able to specify the input being used for the Z end stop) that allowed it to work was removed. I think that setting is back in v3.

                        Frederick

                        Printers: a small Utilmaker style, a small CoreXY and a E3D MS/TC setup. Various hotends. Using Duet 3 hardware running 3.4.6

                        1 Reply Last reply Reply Quote 0
                        22 out of 23
                        • First post
                          22/23
                          Last post
                        Unless otherwise noted, all forum content is licensed under CC-BY-SA