Sensorless homing of X and Y not working



  • I am building my AM8 printer, and i have the moving parts running reasonably smoothly now. However, I cannot seem to home Y or X. When i select Home X or Home Y it will move some random small amount and then decide that it is homed. I used the configurator to build my setup, but I can seem to find a sample of a working config files so i can compare and figure out what i have done wrong. I will be homing Z with David's IR sensor, if that matters. I am uploading my config.zip so you all can critique my settings.

    Please pick it apart and tell me what i can do to improve. If someone has a working set of files for an AM8/generic prusa i3 style machine I would like to see it for comparison (and maybe a bit of copy/paste =))

    [0_1545193217112_config.zip](Uploading 100%)0_1545193304115_config.g
    3_1545193338387_homez.g 2_1545193338387_homey.g 1_1545193338387_homex.g 0_1545193338386_homeall.g



  • It sounds like the trigger sensitivity is too high or acceleration is too high causing a false positive.



  • Right. I see those hints, but how do I format that command? Where should it be? In the Homex macro? in the homeall macro? Im lost. I had just gotten a handle on Marlin, so I am new to this.



  • Well start here if you haven't seen it already

    https://duet3d.dozuki.com/Wiki/Stall_detection_and_sensorless_homing

    The sensitivity setting should probably go into the config.g but really it can go anywhere it makes sense to configure it. You could even have different sensitivity settings for x and y if you put the commands in your homex and homey macros.

    You can set your acceleration values to be lower in the homing macros and then put them back to normal at the end.

    Reprapfirmware is a bit different than Marlin and takes some getting used to buy once you get the hang of it you'll enjoy the flexibility.

    Sensorless homing is probably one of the trickiest things to tune and get working well and there's no guarantee that your motors will even work well with it.



  • I set the M915 in Config G , and i am messing about with detection threshold values. Currently at +45 How can I tell if my motors cant support this? Admittedly, they are el-cheapos. But no detection value is making a difference. I lowered my accel on X and Y to 200, but that also does not to appear to make much difference beyond a visibly slower movement.



  • Update. This evening I discovered that my firmware was at 1.19 So I updated it to the most recent, which looks to be 2.0

    Now sensorless homing still does not work, the Axis moves farther but hits the end and just makes the bad noise where the motor is skipping steps. And, i can no longer move my axes at all because they are not homed.

    This may actually be progress. At least the X and Y move all the way to their minimum points now. It just does not detect the stall.

    I really need help with this. Does anyone have an example Cartesian setup that is using sensorless homing?



  • Are you reducing motor current for the homing moves? Can you post what you actually have setup right now? Your previously posted files don't actually have any of the stall guard configuration in them.



  • Also you may be able to find other people's implementations by search the forums. There have been a few posted.



  • Sure. Maybe i uploaded the wrong files. Or maybe I am doing this totally wrong.

    ; Configuration file for Duet WiFi (firmware version 1.21)
    ; executed by the firmware on start-up
    ;
    ; generated by RepRapFirmware Configuration Tool v2 on Wed Dec 19 2018 18:09:53 GMT-0600 (Central Standard Time)

    ; General preferences
    G90 ; Send absolute coordinates...
    M83 ; ...but relative extruder moves

    ; Network
    M550 P"AM8" ; Set machine name
    M552 S1 ; Enable network
    M587 S"Awesome Sauce!" P"1q2w3e4r" I10.0.42.195 J10.0.42.1 K255.255.255.0 ; Configure access point and IP addresses. You can delete this line once connected
    M586 P0 S1 ; Enable HTTP
    M586 P1 S0 ; Disable FTP
    M586 P2 S0 ; Disable Telnet

    ; Drives
    M569 P0 S1 ; Drive 0 goes forwards
    M569 P1 S1 ; Drive 1 goes forwards
    M569 P2 S0 ; Drive 2 goes backwards
    M569 P3 S1 ; Drive 3 goes forwards
    M350 X128 Y128 Z128 E16 I0 ; Configure microstepping without interpolation
    M92 X640.00 Y640.00 Z3200.00 E458.00 ; Set steps per mm
    M566 X900.00 Y900.00 Z12.00 E120.00 ; Set maximum instantaneous speed changes (mm/min)
    M203 X12000.00 Y12000.00 Z1200.00 E3000.00 ; Set maximum speeds (mm/min)
    M201 X1000.00 Y1000.00 Z100.00 E5000.00 ; Set accelerations (mm/s^2)
    M906 X855.00 Y855.00 Z855.00 E855.00 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 X230 Y230 Z250 S0 ; Set axis maxima

    ; Endstops
    M574 X1 Y1 S3 ; Set endstops controlled by motor load detection
    M915 X Y S20 H200 ; Configure motor stall detect Sn detection threshold, Hnminimum speed

    ; Z-Probe
    M574 Z1 S2 ; Set endstops controlled by probe
    M558 P1 H5 F120 T6000 ; Set Z probe type to unmodulated and the dive height + speeds
    G31 P500 X0 Y0 Z2.5 ; Set Z probe trigger value, offset and trigger height
    M557 X25:190 Y25:190 S20 ; Define mesh grid

    ; Heaters
    M305 P0 T100000 B3988 R4700 ; Set thermistor + ADC parameters for heater 0
    M143 H0 S120 ; Set temperature limit for heater 0 to 120C
    M305 P1 T100000 B3988 R4700 ; Set thermistor + ADC parameters for heater 1
    M143 H1 S280 ; Set temperature limit for heater 1 to 280C

    ; Fans
    M106 P0 S0.3 I0 F500 H-1 ; Set fan 0 value, PWM signal inversion and frequency. Thermostatic control is turned off
    M106 P1 S1 I0 F500 H1 T45 ; Set fan 1 value, PWM signal inversion and frequency. Thermostatic control is turned on
    M106 P2 S1 I0 F500 H1 T45 ; Set fan 2 value, PWM signal inversion and frequency. Thermostatic control is turned on

    ; Tools
    M563 P0 D0 H1 ; Define tool 0
    G10 P0 X0 Y0 Z0 ; Set tool 0 axis offsets
    G10 P0 R0 S0 ; Set initial tool 0 active and standby temperatures to 0C

    ; Automatic saving after power loss is not enabled

    ; Custom settings are not configured

    ; Miscellaneous
    T0 ; Select first tool



  • Software Information
    Firmware Name: RepRapFirmware for Duet 2 WiFi/Ethernet
    Firmware Electronics: Duet WiFi 1.02 or later
    Firmware Version: 2.02RC6(RTOS) (2018-12-15b2)
    WiFi Server Version: 1.19
    Web Interface Version: 1.19



  • And here is the Homey.g file. I am not messing much with Homex, i figure once homey works then x will easy


    G91 ; relative positioning
    M906 X200 Y200 ; set motor currents low
    M915 P0:1 S0 R0 ; configure stall detection
    G1 Z5 F6000 S2 ; lift Z relative to current position
    G1 S1 Y-235 F1800 ; move quickly to Y axis endstop and stop there (first pass)
    G1 Y5 F6000 ; go back a few mm
    G1 S1 Y-235 F360 ; move slowly to Y axis endstop once more (second pass)
    G1 Z-5 F6000 S2 ; lower Z again
    G90 ; absolute positioning



  • @jkaechler said in Sensorless homing of X and Y not working:

    Software Information
    Firmware Name: RepRapFirmware for Duet 2 WiFi/Ethernet
    Firmware Electronics: Duet WiFi 1.02 or later
    Firmware Version: 2.02RC6(RTOS) (2018-12-15b2)
    WiFi Server Version: 1.19
    Web Interface Version: 1.19

    Don't forget to update your wifi server and DWC files as well.



  • https://forum.duet3d.com/search?term=stall detection&in=titlesposts

    If you can't find someone elses implementation to start from you'll have to do some testing for variations of speed, motor current, acceleration, and sensitivity. It's tricky to get right. I wish it was easier, but that's just the electromechanics of it.

    If you have a couple end stop switches handy....



  • Well, my design does not readily have a place to mount an endstop in Y, and my Anet A8 (training wheels printer) has stopped playing nicely. If I cant work this out, my backup option is to hot glue an endstop in place long enough to print a proper bracket on the frame of the new AM8. For Y. I think my X carriage has a place for an endstop.



  • So, I do have a couple extra endstops on hand. I will hook them up, and come back to this problem later on. I can get all my other issues worked out and get actual printing going on. I will start another thread on that issue. (hint Fan0 always on)


  • administrators

    @jkaechler said in Sensorless homing of X and Y not working:

    And here is the Homey.g file. I am not messing much with Homex, i figure once homey works then x will easy


    G91 ; relative positioning
    M906 X200 Y200 ; set motor currents low
    M915 P0:1 S0 R0 ; configure stall detection
    G1 Z5 F6000 S2 ; lift Z relative to current position
    G1 S1 Y-235 F1800 ; move quickly to Y axis endstop and stop there (first pass)
    G1 Y5 F6000 ; go back a few mm
    G1 S1 Y-235 F360 ; move slowly to Y axis endstop once more (second pass)
    G1 Z-5 F6000 S2 ; lower Z again
    G90 ; absolute positioning

    What happens now when you try to home Y?

    • If the motor doesn't move at all, the current may be too low. Btw we normally use M400 followed by M913 to reduce motor current temporarily instead of M906, that way the M906 setting only needs to be in one place.
    • If the motor moves a tiny bit and stops, either the stall detection S parameter is set too low (values less than 1 are unusual), or the acceleration is too high for the current you have set.
    • If the motor moves to the endstop and doesn't stop, first of all send M574 without parameters to check that it is still set to stall detection endstops. Then check by calculation that your homing speed is high enough for stall detection to be enabled (F1800 might be OK, F360 is almost certainly too low). Finally, try negative values of S in the M915 command.

    HTH David



  • @JKaechler try M201 X500 Y500. If homing works this way, then you need to set that on homing and create a macro to restore accelerations to their initial values (1000 in your case).

    Here's my homex.g (Y is analogous).

    M400					; make sure everything has stopped before we make changes
    M915 P0:1 S3 F0 R0			; configure stall detection
    M574 X1 Y1 S3				; set endstops to use motor stall
    M913 X50 Y50				; reduce motor current to 50% to prevent belts slipping
    M201 X500				; reduce acceleration to avoid false triggering
    G91					; use relative positioning
    					; X or Y is homed at this point, now home the other axis
    G1 S1 X-325 F4000		      	; move towards axis minimum 
    G1 X5                      		; move away from home
    M400                  			; make sure everything has stopped before we reset the motor currents
    M913 X100 Y100 				; motor currents back to 100%
    G90                   			; back to absolute positioning
    M574 X1 Y1 S1
    M98 Pset_accel.g			; restore acceleration values
    

    set_accel.g restores the acceleration values and has the following contents:

    M201 X2000 Y2000 Z100 E9000		; Accelerations (mm/s^2)
    

Log in to reply