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

    SZP for bed level in 3.6-RC1

    Scheduled Pinned Locked Moved Solved
    Firmware installation
    4
    29
    807
    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.
    • jltxundefined
      jltx
      last edited by

      I just rebuilt my printer with CAN using Roto Toolboard with SZP. Everything appears to be working correctly again, except for the bed level.

      this is a Voron trident with the microswitch bed probe for Z home and offset. What I changed in bed.g is right after the Z home, I move the coil just over the bed near the microswitch since I know approximately where that portion of the bed is located in height so known to be safe. I do a M558.1 calibration for the SZP probe.

      Then I go to probe the three bed points for leveling using the normal M558 commands using the SZP probe: M558 K1 H15:5 F1000 T15000
      The first point seems to probe ok but I think I'm just getting lucky that the bed is an equal height there. At the second probe point the bed is a little higher and the nozzle runs into the bed during the probe dive so I abort. I also notice that neither probe point seems to be honoring the H parameter because it looks like it's starting ~5mm high.

      What are good steps to debug. The M558.2 and M558.1 by themselves seem to do the right thing. Do I need more parameters for the M558 probe command?

      droftartsundefined 1 Reply Last reply Reply Quote 0
      • droftartsundefined
        droftarts administrators @jltx
        last edited by

        @jltx I've tested using H15:5 in 3.6.0-rc.1+2, and it works correctly, moving up 15mm before moving to the next probe point, while subsequent probes at the same point are done at 5mm. But I'm using a 'normal' probe rather than SZP. Could you test to see if this firmware version resolves the issue? Find it here: https://www.dropbox.com/scl/fo/y03luwmbypirbxncla3rk/AAJFLPFsVdFylemyhkXsAac?rlkey=7cq4svp4rzl2ztdffpzq2ghjk&dl=0

        Ian

        Bed-slinger - Mini5+ WiFi/1LC | RRP Fisher v1 - D2 WiFi | Polargraph - D2 WiFi | TronXY X5S - 6HC/Roto | CNC router - 6HC | Tractus3D T1250 - D2 Eth

        jltxundefined 1 Reply Last reply Reply Quote 0
        • jltxundefined
          jltx @droftarts
          last edited by

          @droftarts Yes, this same code (except the M558.1) was used when I had a P8 probe and it worked fine. When I switched to P11 is when it changed behavior.

          I don't think the dive height is the main problem though because the probe starts well above the trigger point. It just doesn't see it when lowering on the second probe point. Is there a way I can monitor the values live?

          I will try the firmware above if I can figure out how to install on my SBC+Mini5+RR. I also need to figure out why my DWC did not update with the rest of the firmware when I did M997 S2.

          jltxundefined 1 Reply Last reply Reply Quote 0
          • jltxundefined
            jltx @jltx
            last edited by

            @droftarts I can't get that firmware to load with my SBC. Maybe I'm doing it wrong. I don't see any sbc file. I may have to wait for official release to try.

            jltxundefined Phaedruxundefined 2 Replies Last reply Reply Quote 0
            • jltxundefined
              jltx @jltx
              last edited by

              I missed the note that said 15 is typical current. My M558.2 came up with 22. So I lowered it to 15 and I see some more normal behavior (I think). Is 99999 mean it has triggered or overflowed? The values rise as I get closer to the bed and then suddenly jump to 99999. The DWC status shows normal, yellow, then red during the probe dive. But it doesn't stop at red, it keeps going. The first probe point finally stops right before impacting the bed but had already jumped to 99999. The second probe point does similar but impacts the bed and I have to reset machine.

              1 Reply Last reply Reply Quote 0
              • Phaedruxundefined
                Phaedrux Moderator @jltx
                last edited by

                @jltx said in SZP for bed level in 3.6-RC1:

                @droftarts I can't get that firmware to load with my SBC. Maybe I'm doing it wrong. I don't see any sbc file. I may have to wait for official release to try.

                See here for updating your firmware with an SBC.

                https://docs.duet3d.com/User_manual/Machine_configuration/SBC_setup#update-firmware

                Z-Bot CoreXY Build | Thingiverse Profile

                jltxundefined 1 Reply Last reply Reply Quote 0
                • jltxundefined
                  jltx @Phaedrux
                  last edited by

                  @Phaedrux said in SZP for bed level in 3.6-RC1:

                  https://docs.duet3d.com/User_manual/Machine_configuration/SBC_setup#update-firmware

                  I know how to do that when the firmware is via a depot but this is from a dropbox so I assume there is a manual procedure. Do I need to sftp them over?

                  Phaedruxundefined 1 Reply Last reply Reply Quote 0
                  • jltxundefined
                    jltx
                    last edited by

                    so I played around with the drive current more. I cannot find a setting that works all the way from the bed to infinity. The best I can do, using 16, is get a non-99999 value from about 2mm over the bed to infinity. If I drop Z lower it jumps to 9999, but I can boost the current and get a good reading but then it instead jumps to 99999 at higher Z. It seems very finicky. This is all with a cold bed for now. I haven't tried heated.

                    1 Reply Last reply Reply Quote 0
                    • jltxundefined
                      jltx
                      last edited by

                      I did this repeatability test after running a M558.1:

                      G1 Z5 F3000
                      G30 K1 P0 Z-9999
                      G30 K1 P1 Z-9999
                      G30 K1 P2 Z-9999
                      G30 K1 P3 Z-9999
                      G30 K1 P4 Z-9999
                      G30 K1 P5 Z-9999
                      G30 K1 P6 Z-9999
                      G30 K1 P7 Z-9999
                      G30 K1 P8 Z-9999
                      G30 K1 P9 Z-9999 S-1
                      G1 Z5

                      and it works! The RMS error seems largish but it works.

                      So G30 works but M558 does not. Am I just missing a parameter?
                      M558 K1 H15:5 F1000 T15000

                      1 Reply Last reply Reply Quote 0
                      • Phaedruxundefined
                        Phaedrux Moderator @jltx
                        last edited by

                        @jltx said in SZP for bed level in 3.6-RC1:

                        @Phaedrux said in SZP for bed level in 3.6-RC1:

                        https://docs.duet3d.com/User_manual/Machine_configuration/SBC_setup#update-firmware

                        I know how to do that when the firmware is via a depot but this is from a dropbox so I assume there is a manual procedure. Do I need to sftp them over?

                        Are you already on the unstable branch? If so, you should be able to upload the bin file and send M997 to flash to it. See here for parameter details for M997 in SBC mode.

                        https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m997-perform-in-application-firmware-update

                        Z-Bot CoreXY Build | Thingiverse Profile

                        jltxundefined 1 Reply Last reply Reply Quote 0
                        • jltxundefined
                          jltx @Phaedrux
                          last edited by

                          @Phaedrux I must be reading that wrong because it looks like the P parameter only works in standalone mode. For SBC only a feed is supported, stable or unstable. That is how I got to 3.6-rc1. I can try it later today. I assume I have to do the CAN board separately.

                          Phaedruxundefined 1 Reply Last reply Reply Quote 0
                          • Phaedruxundefined
                            Phaedrux Moderator @jltx
                            last edited by

                            @jltx You can still send M997 S0 to flash the firmware if you've uploaded it. And you can use P to refer to the file name directly if it isn't the default.

                            Z-Bot CoreXY Build | Thingiverse Profile

                            jltxundefined 1 Reply Last reply Reply Quote 0
                            • jltxundefined
                              jltx @Phaedrux
                              last edited by

                              @Phaedrux be28b115-3792-41f1-bf47-31581ac82de0-image.png

                              1 Reply Last reply Reply Quote 0
                              • jltxundefined
                                jltx
                                last edited by

                                The dive height is still not correct. And the trigger does not appear to work. I can see it turn red on DWC but the Z keeps decreasing until it hits the bed and keeps going until I reset.

                                1 Reply Last reply Reply Quote 0
                                • jltxundefined
                                  jltx
                                  last edited by

                                  no, wait! it works. I had made an experimental edit (I was sure it wouldn't help) yesterday out of desperation. But then I forgot to revert it. I just did and now I can ABL again!

                                  I guess I need to tune the current more because I am getting bigger rms error than the threshold I am using for ABL.

                                  1 Reply Last reply Reply Quote 0
                                  • jltxundefined
                                    jltx
                                    last edited by

                                    spoke too soon. I ran it again and it made odd adjustments to the Z motors and then the head crashed into the bed pretty bad. I also noticed that it only does the first dive, not the second, e.g. 15 but not 5.

                                    
                                    ; Clear any bed transform
                                    M561
                                    
                                    ; Turn off noisy Extruder motor
                                    M84 E0
                                    
                                    
                                    ; Lower currents, speed & accel
                                    M98 P"/macros/print_scripts/setup_probing.g"
                                    
                                    ;if !move.axes[2].homed
                                      ; Home all axes
                                      G28
                                    
                                      G1 Y240 Z6      ; move coil over bed and higher than trigger point
                                      M558.1 K1 S1.5  ; calibrate height coeff
                                    
                                      ; Probe the bed at 3 points, x3 for more precision
                                      M558 K1 H15:5 F800 T15000; increase the depth range, gets the gantry mostly level immediately
                                      M98 P"/sys/bed_probe_points.g"
                                      M558 K1 H4:2 F400 T15000  ; reduce depth range, probe slower for better repeatability
                                      M98 P"/sys/bed_probe_points.g"
                                      ; last attempt will be auto-repeated
                                    
                                    
                                    M558 K1 H1 F60 T15000   ; reduce depth range, probe slower for better repeatability
                                    while move.calibration.initial.deviation > 0.01 ; 0.003
                                      if iterations > 3
                                        abort "Too many leveling attempts! Canceling print."
                                      M98 P"/sys/bed_probe_points.g"
                                      echo "Current deviation: " ^ move.calibration.initial.deviation ^ "mm"
                                    echo "Leveling complete"
                                    
                                    ;use mechanical instead? G30 S-2 ; Z=0
                                    
                                    ; Restore high currents, speed & accel
                                    M98 P"/macros/print_scripts/setup_printing.g"
                                    
                                    
                                    1 Reply Last reply Reply Quote 1
                                    • Phaedruxundefined Phaedrux marked this topic as a question
                                    • jltxundefined
                                      jltx
                                      last edited by

                                      I think the fundamental problem is there is no drive current for the SZP that covers the range necessary for bed leveling. If I dial in the drive current for near the bed then it is pre-triggered at the initial dive heights necessary for a possibly tilted bed (more than a few mm). Alternatively I can find a drive current that works at a higher height but then overflows before the trigger point near the bed.

                                      Here is the probe set up I am using to go with the bed.g posted above:

                                      ; Scanning Z probe
                                      M558 K1 P11 C"121.i2c.ldc1612" F36000 T36000    ; configure SZP as probe 1, type 11, on CAN address 120
                                      M308 A"SZP coil" S10 Y"thermistor" P"121.temp2" ; thermistor on SZP coil
                                      G31 K1 Z2 Y36                                   ; define probe 1 offsets and trigger height
                                      M558.2 K1 S16 R115897                         ; set drive current and reading offset
                                      
                                      

                                      Every day I run M558.2 K1 S-1 (for debug) and I get a different answer, 16, 22, 18. There is a span of about 5 around these that will work over some Z range and outside of that it is always overflowed. It's also hard to debug because in DWC the Z trigger is always red. sometimes that seems ok and other times it says it is pre-triggered.

                                      bc42576e-dea8-466d-b016-5fc6d7543e0d-image.png

                                      gloomyandyundefined 1 Reply Last reply Reply Quote 0
                                      • jltxundefined
                                        jltx
                                        last edited by

                                        I think my printer is monitoring this thread. So suddenly, without changes, the Z probe stopped being red.

                                        78f97e04-193b-490f-8ccb-997cccbd68f0-image.png

                                        So I tried again and now I get a completed ABL.

                                        However, it is not repeating any probes as requested, i.e. second dive at reduced height. Is that expected with SZP?

                                        1 Reply Last reply Reply Quote 0
                                        • jltxundefined
                                          jltx
                                          last edited by

                                          I hate to jinx it but it seems to be working now, repeatedly. I think the key was having the z value not red (whatever that indicates). I don't know what flipped it. I only made one change to protect against bad currents. Since I added this statement in bed.g everything started working and this statement has never triggered. But I wonder if somehow sampling the value cleared something and now it works (not red)?

                                           if sensors.probes[1].value[0] = 99999
                                              abort "wrong current"
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • jltxundefined jltx referenced this topic
                                          • gloomyandyundefined
                                            gloomyandy @jltx
                                            last edited by

                                            @jltx I'm glad you have it working. I was in the process of typing up the following reply. You may find some of it of use...

                                            What height from your nozzle (or other z=0 point) do you have the coil mounted? You may find that mounting it higher gives you a better working range. At the moment you are setting the trigger height to 2mm in your G31 command and are calibrating with M558.1 over a range of +/-1.5mm this means you will need the probe to provide valid readings with the nozzle 0.5mm above the bed and all points from there to above your dive height of 15mm. This may not be possible.

                                            You may be able to make it work by setting the trigger height to a higher point. I'd try increasing that to say 3 or 4mm. Try changing the G31 Z parameter to 4 and then re-run the coil drive calibration with the nozzle at Z=2.5, then check that you still get valid readings at z=17.5. If all of that looks ok, then rerun M558.1 which should now calibrate at a height of 4mm rather than 2mm.

                                            What amount of bed tilt are you looking to handle, so how far above/below Z=0 do you need to measure for a tilted bed? The szp is not really good at handling a wide range of heights when used in "scanning mode", probably only a range of a few millimetres.

                                            The probe will be triggered (red in DWC) if the coil is ever in a position in which it is closer to the bed than its height above the bed when you calibrated the threshold using M558.1. You have set your trigger height to be 2mm using G31 so the probe will show as triggered if the nozzle is below 2mm above the bed. It will also show red (and display 99999) if the coil is too high/low for the drive current you have set.

                                            To have the probe, probe multiple times you need to set the A parameter in M558 I can't see you doing that. You may also need to set the S parameter.

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