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

    Double motor axis homing question

    Scheduled Pinned Locked Moved Solved
    Tuning and tweaking
    6
    13
    505
    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.
    • JuLundefined
      JuL
      last edited by

      Hi, I'm configuring a duet 3 6hc with raspi4 as my cnc controller.
      The cnc is cartesian with 1 X, 2 Y and 1 Z.
      Everything seams good but I think I forgot something in my config or/and home y file.
      Actually, I can home all together or individually.
      My question is about homing procedure.
      I've got switch with active high for each motor, when homing if a switch or his wire is broken, the machine think it's at endstop and then revese for doing second pass, wich is normal. But what about my double Y, the motor with switch broken stop and wait for the second switch to be eaten. How can I tell the duet to travel to the next switch within 20mm max, is there a way to do that?

      config.g

      ; Display initial welcome message
      ;M291 P"Please go to <a href=""https://www.duet3d.com/StartHere"" target=""_blank"">this</a> page for further instructions on how to set it up." R"Welcome to your new Duet 3!" S1 T0
      
      ; Configuration file for Duet 3 MB 6HC (firmware version 3.3)
      ; executed by the firmware on start-up
      ;
      ; generated by RepRapFirmware Configuration Tool v3.3.16 on Fri May 19 2023 16:27:45 GMT+0200 (Central European Summer Time)
      
      ; General preferences
      G90                               ; send absolute coordinates...
      M550 P"cnc"                       ; set printer name
      
      ; Drives
      M569 P0.0 S1                      ; physical drive 0.0 goes forwards
      M569 P0.1 S1                      ; physical drive 0.1 goes forwards
      M569 P0.2 S1                      ; physical drive 0.2 goes forwards
      M569 P0.3 S1                      ; physical drive 0.3 goes forwards
      M584 X0.0 Y0.1:0.2 Z0.3           ; set drive mapping
      M350 X16 Y16 Z16 I1               ; configure microstepping with interpolation
      M92 X400.00 Y400.00 Z400.00       ; set steps per mm
      M566 X900.00 Y900.00 Z60.00       ; set maximum instantaneous speed changes (mm/min)
      M203 X6000.00 Y6000.00 Z180.00    ; set maximum speeds (mm/min)
      M201 X500.00 Y500.00 Z20.00       ; set accelerations (mm/s^2)
      M906 X800 Y800 Z800 I30           ; set motor currents (mA) and motor idle factor in per cent
      M84 S30                           ; Set idle timeout
      
      ; Axis Limits
      M208 X0 Y0 Z0 S1                  ; set axis minima
      M208 X500 Y1000 Z100 S0           ; set axis maxima
      
      ; Endstops
      M574 X1 S1 P"io0.in"              ; configure switch-type (e.g. microswitch) endstop for low end on X via pin io0.in
      M574 Y1 S1 P"io1.in+io2.in"       ; configure switch-type (e.g. microswitch) endstop for low end on Y via pin io1.in and pin io2.in
      M574 Z2 S1 P"io3.in"              ; configure switch-type (e.g. microswitch) endstop for high end on Z via pin io3.in
      
      ; Z-Probe
      M558 P5 C"^!io4.in" F120:20       ; set Z probe type to switch and the dive height + speeds
      ;G31 P500 X0 Y0 Z0                ; set Z probe trigger value, offset and trigger height
      ;M557 X15:215 Y15:195 S20         ; define mesh grid
      
      ; Heaters
      
      ; Fans
      M950 F1 C"!out6" Q250             ; create fan 0 on pin out6 and set its frequency
      M106 P1 S0.8 H-1 c"IN fan"        ; set fan 0 value. Thermostatic control is turned off
      M950 F2 C"!out5" Q250             ; create fan 1 on pin out5 and set its frequency
      M106 P2 S1 H-1 C"RASPI fan"       ; set fan 1 value. Thermostatic control is turned off
      M950 F3 C"!out4" Q250             ; create fan 2 on pin out4 and set its frequency
      M106 P3 S0.8 H-1 C"OUT fan"       ; set fan 2 value. Thermostatic control is turned off
      
      ; Tools
      M950 R0 C"out9" L0:24000          ; set spindle on out 9 with pwm 0 t 24000
      M563 P0 S"Broche" R0              ; define tool 0 as broche from spindle 0
      M453                              ; CNC mode
      G10 P0 X0 Y0 Z0                   ; set tool 0 axis offsets
      
      ; Custom settings are not defined
      
      ; Miscellaneous
      T0                                ; select first tool
      

      homey.g

      ; homey.g
      ; called to home the Y axis
      ;
      ; generated by RepRapFirmware Configuration Tool v3.3.16 on Fri May 19 2023 16:27:45 GMT+0200 (Central European Summer Time)
      G91               ; relative positioning
      G1 H1 Y-1005 F900 ; move quickly to Y axis endstop and stop there (first pass)
      G1 H2 Y5 F100     ; go back a few mm
      G1 H1 Y-10 F100   ; move slowly to Y axis endstop once more (second pass)
      G90               ; absolute positioning
      G92 Y0            ; set Y position to axis minimum (you may want to adjust this)
      
      

      Please, don't hesitate if my poor english is misunderstood 😉

      Phaedruxundefined 1 Reply Last reply Reply Quote 0
      • JuLundefined JuL marked this topic as a question
      • Phaedruxundefined
        Phaedrux Moderator @JuL
        last edited by

        The endstop move will be as long as you tell it to be. Best to have a functional endstop setup in the first place.

        Z-Bot CoreXY Build | Thingiverse Profile

        1 Reply Last reply Reply Quote 0
        • JuLundefined
          JuL
          last edited by

          OK. Maybe I should post a request on firmware github. In my opinion, it's a real issue with 2 motors axis.

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

            @JuL You could probably do this with conditional Gcode, for example:

            • check before homing if either endstop switch is triggered, but not both or neither
              • if so try homing the axis but only 20mm.
              • If that doesn't succeed, notify the operator.
            • Otherwise, home normally.

            Would that work?

            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

            1 Reply Last reply Reply Quote 0
            • JuLundefined
              JuL
              last edited by

              I should give it à try. Thx

              1 Reply Last reply Reply Quote 0
              • JuLundefined
                JuL
                last edited by

                So I manage to check with conditionnal and it works. But, there is a major issue in firmware I discovered during my test. Its a critical safety bug in my opinion. Firmware check during homing move if sensor is hit, but doesn't care if not. If you don't hit sensor, the move continue to distance you specify, stop and do the second pass as well without controlling after complete distance. Ok, I can test it with conditionnal, but I really don't understand this kind of homing procedure inside a so good board.

                droftartsundefined dc42undefined 2 Replies Last reply Reply Quote 0
                • droftartsundefined
                  droftarts administrators @JuL
                  last edited by

                  @JuL Your homing move should be longer than your axis, that way it should always hit and endstop. If it doesn't hit, it just goes as far as you tell it. If it hasn't hit an endstop, I don't think the axis is marked as homed. How is this a critical safety bug?

                  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

                  JuLundefined 1 Reply Last reply Reply Quote 0
                  • JuLundefined
                    JuL @droftarts
                    last edited by

                    @droftarts said in Double motor axis homing question:

                    I don't think the axis is marked as homed.

                    Here is the problem, it's homed. I'tried again with my Z axis (1 motor, short stroke), the same

                    deckingmanundefined 1 Reply Last reply Reply Quote 0
                    • deckingmanundefined
                      deckingman @JuL
                      last edited by

                      @JuL I'm not sure that I understand what you say is happening. At the start of any homing move, the first thing that happens is that the axis is flagged as not homed. Then when the homing move proceeds, the axis will remain flagged as not homed until the end stop triggers. As soon as the end stop triggers, the axis will be marked as homed but if the homing switch never triggers, then the axis will never be flagged as homed. That's what normally happens so can you explain in detail what you observe is happening in your case. Is it possible that you have a wiring issue such that you get false triggers from the end stop switch?

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

                      1 Reply Last reply Reply Quote 0
                      • gloomyandyundefined
                        gloomyandy
                        last edited by droftarts

                        I notice that you have G92 Y0 in your homey.g file, I think that this will set the axis as being homed (someone please confirm), which may be contributing to the problems you are seeing.

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

                          @gloomyandy said in Double motor axis homing question:

                          G92 Y0 in your homey.g file,

                          This will indeed force the position of the axis and mark it as homed.

                          Z-Bot CoreXY Build | Thingiverse Profile

                          1 Reply Last reply Reply Quote 0
                          • dc42undefined
                            dc42 administrators @JuL
                            last edited by

                            @JuL said in Double motor axis homing question:

                            So I manage to check with conditionnal and it works. But, there is a major issue in firmware I discovered during my test. Its a critical safety bug in my opinion. Firmware check during homing move if sensor is hit, but doesn't care if not. If you don't hit sensor, the move continue to distance you specify, stop and do the second pass as well without controlling after complete distance. Ok, I can test it with conditionnal, but I really don't understand this kind of homing procedure inside a so good board.

                            To avoid this:

                            1. Always use normally closed endstop switches. That way, if an endstop switch becomes disconnected, it will appear to be triggered to RRF.

                            2. Never use a G92 command to set the homed position in the homing files, because that will flag the axis as homed even if the endstop switch has not been triggered. Set the M208 limits correctly instead.

                            3. If you want to handle the case of the endstop switch becoming disconnected, read the state of the switch near the start of the corresponding homing file(s). If you find the switch is already triggered, use a suitable G1 H2 move to back off a few mm from the switch. If that fails to change the homing switch state to not triggered, report an error using M591 and abort the homing file.

                            Duet WiFi hardware designer and firmware engineer
                            Please do not ask me for Duet support via PM or email, use the forum
                            http://www.escher3d.com, https://miscsolutions.wordpress.com

                            1 Reply Last reply Reply Quote 0
                            • JuLundefined
                              JuL
                              last edited by

                              My bad, I didn't expect g92 set position AND flag as homed. Thx for pointing me my mistake

                              1 Reply Last reply Reply Quote 0
                              • Phaedruxundefined Phaedrux has marked this topic as solved
                              • First post
                                Last post
                              Unless otherwise noted, all forum content is licensed under CC-BY-SA