HOWTO Configure Z axis sensorless homing in homey.g file?
-
First of all, I have complicated the sensorless homing file of both X and Y axis. Fortunately, they all work. However, when I configure the Z axis homing file the same way that I configured the XY axis, it can't get the signal that the current of motors have changed when Z-axis arrived at the boundary.
I would appreciate your help very much.
The following is my config.g file and homez.g file;
By the way, my control board is duet2 wifi ,rrf 3.3;config.g ;Axis Limit M208 X-126:125 Y-92.3:50 Z125:-1 U-200:200 V-12000:12000 ; Centre of the rotating bed is set to origin 0,0 M564 H0 ; allow unhomed movement ; Endstops for each Axis M574 X1 S3 ; Set endstops controlled by motor load detection M574 Y1 S3 ; Set endstops controlled by motor load detection M574 Z2 S4 ; configure sensorless endstop for high end on Z (Detected by two motors) ; Stallgaurd Sensitivy M915 X S3 F0 H400 R1 ; Set X axis Sensitivity M915 Y S3 F0 H400 R1 ; Set y axis Sensitivity M915 Z S3 F0 H400 R1 ; Set z axis Sensitivity ; homeZ.g ; 用于归零Z轴 ; M400 ; Wait for current moves to finish M913 X50 Y50:50 ; drop motor current to 50% M400 G91 ; relative positioning G1 H2 Y100 F10000 ; move away Y axis G1 H1 Z110 F12000 ; move quickly to Z axis endstop and stop there (first pass) G1 H2 Z-5 F12000 ; go back 5 mm G1 H2 Z-115 F6000 ; move Z axis to the mid G90 ; absolute positioning M400 M913 X100 Y100:100 ; return current to 100% M400
-
@NO1NOKAO what type of Z axis do you have? If it's driven by a leadscrew then it won't be easy to get sensorless homing working, because of the force multiplication provided by the leadscrew.
However, I note that you have used M913 to drop the Z and Y motor currents in homez.g, whereas for sensorless homing of the Z axis you need to drop the Z motor current. Likewise when you use M913 to restore the motor current later on.
-
@dc42 It's really driven by a leadscrew. I'm developing a five-axis dispensing machine based on Prusa i3 just like FreddieHong did. And I have dropped the Z motor current to 35%,but luck didn't appear. Just like what you said the force provided by leadscrew makes it difficult to get sensorless homing.
-
Can you post your full config.g and homing files?
-
@Phaedrux
config.g file;Duet WiFi(固件版本3.3)的配置文件 ; 用于启动时由固件执行 ; ; 由RepRapFirmware配置工具生成 版本V3.3.10 时间 Tue Nov 01 2022 15:02:12 GMT+0800 (中国标准时间) ; General preferences G90 ; Send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Y" ; Set machine name M669 K0 X1:0:0:0:0 Y0:-1:0:0:0 Z0:0:1:0:0 U0:0:0:1:0 V0:0:0:0:1;Kinematics Profile for 5-axis (cartesian) ; 网络 M551 P"123456" ; set password M552 S1 ; Enable network M586 P0 S1 ; Enable HTTP M586 P1 S0 ; Disable FTP M586 P2 S0 ; Disable Telnet M587 S"A204_printer_04" P"junhua.zhao.04" ;Set the Wi-Fi account and password ; Drive Mappings M569 P0 S1 ; Drive 0 goes backward: X Axis M569 P1 S1 ;Drive 1 goes backwards: Y Axis M569 P2 S1 ; Drive 2 goes backwards: Z Axis M569 P3 S1 ;Drive 3 goes forwards: U轴 M569 P4 S1 ; Drive 4 goes forwards: V轴 M584 X0 Y1 Z2 U3 V4 ; My Driver Mapping ;Microstepping M350 X16 Y16 Z16 U16 V16 I1 ; Configure microstepping with interpolation M92 X100.00 Y100.00 Z400.00 U26.667 V35.556 ; Set steps per mm and steps per degree ;Speed M566 X480.00 Y480.00 Z24.00 E270.00 U480.00 V480.00 P1 ; Set maximum instantaneous speed changes (mm/min) M203 X12000.00 Y12000.00 Z750.00 E1500.00 U5000.00 V12000.00 ; Set maximum speeds (mm/min) M201 X1000.00 Y1000.00 Z1000.00 E1000.00 U1000.00 V1000.00 ; Set accelerations (mm/s^2) M906 X620.00 Y620.00 Z560.00 E700.00 U1300.00 V1300.00 I10 ; Set motor currents (mA) and motor idle factor in percent M84 S30 ; Set idle timeout ; Axis Limit M208 X-125:126 Y-92.3:50 Z125:-1 U-200:200 V-12000:12000 ; Centre of the rotating bed is set to origin 0,0 M564 H0; ;allow unhomed movement ; Endstops for each Axis M574 X1 S3 ;Set endstops controlled by motor load detection M574 Y1 S3 ;Set endstops controlled by motor load detection M574 Z2 S4 ;configure sensorless endstop for high end on Z (Detected by two motors) ; Stallgaurd Sensitivy M915 X S3 F0 H400 R1 ; Set X axis Sensitivity M915 Y S3 F0 H400 R1 ; Set y axis Sensitivity M915 Z S3 F0 H400 R1 ;Set z axis Sensitivity ; Z-Probe (manual) M558 P0 H15 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed ; Heatbed Heaters and Thermistor Bed M140 H-1 ;Disable heated bed ;Tool M950 P0 C"Fan0" Q250 ; creat tool P0
homz.g file
; homeZ.g ; ; 由RepRapFirmware配置工具生成 版本V3.3.10 时间 Tue Nov 01 2022 15:02:12 GMT+0800 (中国标准时间) M400 ; Wait for current moves to finish M913 Z50:50 ; drop motor current to 50% M400 G91 ; relative positioning G1 H1 Z110 F12000 ; move quickly to Z axis endstop and stop there (first pass) G1 H2 Z-5 F12000 ; go back a few mm G1 H2 Z-115 F6000 ; move Z axis to the mid G90 ; absolute positioning M400 M913 Z100:100 ; return current to 100% M400
-
How many Z motors do you have?
Your M574 command is using Z2 S4, for multiple motors, and your M913 command in your homing file has Z50:50 for two motors but your M584 command in the config.g file indicates you only have a single Z motor defined.
The Z moves in your homing file have speeds far beyond the Z axis speed limits you have set in M203 in config.g as well.
-
@NO1NOKAO I don't think your current setting for Z is correct, you have:
M913 Z50:50 ; drop motor current to 50%
But from the docs for M913: https://docs.duet3d.com/en/User_manual/Reference/Gcodes#m913-set-motor-percentage-of-normal-current
"Example: If you have two motors on your Z axis, physically connected to Z and E0 stepper drivers, configured with M584 Z2:3, set M913 Z50, not M913 Z50:50" -
@gloomyandy Thanks for your help, both of the Z motors are wired to Drive2 as shown below.
And does that mean that I also need to rewrite the Z50:50 into Z50? -
This post is deleted! -
@Phaedrux
I have two Z motors, and both of them are connected to Drive2.
Does that mean the command M584 X0 Y1 Z2 U3 V4 is wrong?And what do I need to change?
For the Z axis driven by leadscrew, what's the best speed for it?12000 or just lower than 1000?
And I‘m grateful for your help. -
If both motors are wired to the same driver they are in effect just a single motor and this will make the stall detection even less likely to work.
If you have a free driver available you should move one of the Z motors to that driver, then you can likely get stall detection homing working as you have configured, but since you have a U and V axis I don't think that's an option for you.
Are endstops not an option?
-
@Phaedrux Thanks buddy, I also have a duex5 panel and I also think endstop is a more convenient option. But if I choose endstop, I need to redesign the structure. So,I'll make a try first to wire the motors to different drivers and if plan A fails, the endstop will be the last way.
-
If you have a duex, then you have some extra drivers to use, so you may be able to get stall detection working. I would suggest keeping the Z axis on the mainboard and moving perhaps the U and V to the Duex.
This would also let you use automatic tilt correction.
https://docs.duet3d.com/en/User_manual/Connecting_hardware/Z_probe_auto_levelling
-
@Phaedrux I have tried to wire Z motors to different drivers(2 and 3), unfortunatly, the Z sensorless homing seems still failed. The following is my config.g file and homez.g file. If nothing is wrong, it is definitly the right time to take the endstop in consideration.
My config.g file
;Duet WiFi(固件版本3.3)的配置文件 ; General preferences G90 ; Send absolute coordinates... M83 ; ...but relative extruder moves M550 P"Y" ; Set machine name M669 K0 X1:0:0:0:0 Y0:-1:0:0:0 Z0:0:1:0:0 U0:0:0:1:0 V0:0:0:0:1;Kinematics Profile for 5-axis (cartesian) ; network M551 P"123456" ; set password M552 S1 ; Enable network M586 P0 S1 ; Enable HTTP M586 P1 S0 ; Disable FTP M586 P2 S0 ; Disable Telnet M587 S"A204_printer_04" P"junhua.zhao.04" ;Set the Wi-Fi account and password ; Drive Mappings M569 P0 S1 ; Drive 0 goes forwards: X Axis M569 P1 S1 ; Drive 1 goes forwards: Y Axis M569 P2 S1 ; Drive 2 goes forwards: Z1 motor M569 P3 S1 ; Drive 3 goes forwards: Z2 motor M569 P4 S1 ; Drive 4 goes forwards: U Axis M569 P5 S0 ; Drive 5 goes backwards: V Axis M584 X0 Y1 Z2:3 U4 V5 ; My Driver Mapping ;Microstepping M350 X16 Y16 Z16 U16 V16 I1 ; Configure microstepping with interpolation M92 X100.00 Y100.00 Z400.00 U26.667 V35.556 ; Set steps per mm and steps per degree ;Speed M566 X480.00 Y480.00 Z24.00 U480.00 V480.00 P1 ; Set maximum instantaneous speed changes (mm/min) M203 X12000.00 Y12000.00 Z750.00 U5000.00 V12000.00 ; Set maximum speeds (mm/min) M201 X1000.00 Y1000.00 Z1000.00 U1000.00 V1000.00 ; Set accelerations (mm/s^2) M906 X620.00 Y620.00 Z560.00 U1300.00 V1300.00 I10 ; Set motor currents (mA) and motor idle factor in percent M84 S30 ; Set idle timeout ; Axis Limit M208 X-125:126 Y-92.3:50 Z125:-1 U-200:200 V-12000:12000 ; Centre of the rotating bed is set to origin 0,0 M564 H0; ;allow unhomed movement ; Endstops for each Axis M574 X1 S3 ;Set endstops controlled by motor load detection M574 Y1 S3 ;Set endstops controlled by motor load detection M574 Z2 S4 ;configure sensorless endstop for high end on Z (Detected by two motors) ; Stallgaurd Sensitivy M915 X S3 F0 H400 R1 ; Set X axis Sensitivity M915 Y S3 F0 H400 R1 ; Set y axis Sensitivity M915 Z S3 F0 H400 R1 ; Set z axis Sensitivity ; Z-Probe (manual) M558 P0 H15 F120 T6000 ; disable Z probe but set dive height, probe speed and travel speed ; Heatbed Heaters and Thermistor Bed M140 H-1 ; Disable heated bed ; Tool M950 P0 C"Fan0" Q250 ; creat tool P0
My homez.g file
; homeZ.g ; 用于归零Z轴 ; ; 由RepRapFirmware配置工具生成 版本V3.3.10 时间 Tue Nov 01 2022 15:02:12 GMT+0800 (中国标准时间) M400 ; Wait for current moves to finish M913 Z50 ; drop motor current to 50% M400 G91 ; relative positioning ;G1 H2 Y100 F10000 ; lift Y away G1 H1 Z110 F700 ; move quickly to Z axis endstop and stop there (first pass) G1 H2 Z-5 F700 ; go back a few mm G1 H2 Z-115 F700 ; move Z axis to the mid G90 ; absolute positioning M400 M913 Z100:100 ; return current to 100% M400
-
@NO1NOKAO said in HOWTO Configure Z axis sensorless homing in homey.g file?:
M208 X-125:126 Y-92.3:50 Z125:-1 U-200:200 V-12000:12000
Your minimum and maximum for the Z axis seem backwards in this command.
@NO1NOKAO said in HOWTO Configure Z axis sensorless homing in homey.g file?:
G1 H1 Z110 F700
How fast can you reliably move the Z axis before it stalls on it's own?
@NO1NOKAO said in HOWTO Configure Z axis sensorless homing in homey.g file?:
M913 Z50
How low can you set the Z current before the Z axis just stalls on it's own?
Try and find the minimum current and maximum speed you can move Z at, and then try and use the stall detection homing again.
-
@Phaedrux It worked , I droped the current to 30% and increased the speed to 1000 and the feedback surprised me a lot. It's so kind of you to offer me so much valuable advice.
-
-