Sensorless and senseless
-
Let me start off by saying this whole Duet world is pretty new to me, but i'm pretty familiar with Marlin. I'm trying to get sensorless homing set up on a cartesian style printer that i've built. Below is what the configurator has given me. I'm basically just confused. I'll fully admit i ain't never been one for no book learnin'.
What's throwing me off is what each value represents. S= stall sensitivity? F= the grade i'll get on the quiz for this material?
If someone could boil it down and tell me what values i should be playing with and in what ballpark, it would be super appreciated. Thanks in advance
; homeall.g
; called to home all axes
;
; generated by RepRapFirmware Configuration Tool v2 on Mon Aug 26 2019 21:46:13 GMT-0400 (Eastern Daylight Time)
G91 ; relative positioning
G1 Z5 F6000 S2 ; lift Z relative to current position
G1 S1 X-305 Y-305 F1800 ; move quickly to X and Y axis endstops and stop there (first pass)
G1 X5 Y5 F6000 ; go back a few mm
G1 S1 X-305 Y-305 F360 ; move slowly to X and Y axis endstops once more (second pass)
G90 ; absolute positioning
G1 X5 Y5 F6000 ; go to first bed probe point and home Z
G30 ; home Z by probing the bed; Uncomment the following lines to lift Z after probing
;G91 ; relative positioning
;G1 S2 Z5 F100 ; lift Z relative to current position
;G90 ; absolute positioning -
Meaning and valid values of the various GCode parameters can be found in the comprehensive documentation at https://duet3d.dozuki.com/Wiki/Gcode
-
ok so that definitely does help me out, but for the commands, am i adding them to the homeall.g? replacing them? Does tuning stall detection require me to create a new .g? I'm really lost. It just seems like there's a lot of information on what things do but not how to link it all together. Or i'm just an idiot. my money is on the latter
-
Nope, you are not an idiot.
If you were you would not be here asking for help but would flail away for days and days hoping to stumble upon the answers to your questions.
This may help:
https://duet3d.dozuki.com/Wiki/Stall_detection_and_sensorless_homing
Frederick
-
First, you have to configure the "virtual endstops" to use the stall instead of physical switches. You do that putting this in your config.g:
; Endstops
M574 X1 Y1 S3 ; Set endstops to use sensorless motor load detection
M915 X Y E S3 F1 H200 R0 ; set stall motor sensitivity and actionsThis is enough for it just to work as if you had switches installed. Anytime the motors stall, the enstops will be triggered.
Now, when doing the homing, you must use the S1 paramenter (or the H1 parameter on FW 2.02 and later) in your G0/G1 commands so it respects endstops.
H1 terminate the move when the endstop switch is triggered and set the axis position to the axis limit defined by M208. On delta printers, H1 also selects individual motor mode as for H2. Normally used with relative motor coordinates (see G91).
For example, my homex.g is like this:
G91 ; relative positioning
G1 Z${Z_HOMING_LIFT} F$((Z_SPEEDS[MEDIUM]*60)) ; lift Z relative to current position
M98 P"0:/sys/m_set_homing_speeds.g" ; set lower speeds and accelerations
M913 X60 Y60 ; set X and Y motors to low current for homing
G1 S1 X-$((X_LIMITS[MAX]+100)) F$((XY_SPEEDS[HOMING]*60)) ; move quickly to X axis endstop and stop there (first pass)
G1 X5 F$((XY_SPEEDS[HOMING]*60)) ; go back a few mm
M913 X100 Y100 ; set X motor to 100% of the normal current
M98 P"0:/sys/m_set_normal_speeds.g" ; set normal speeds and accelerations
G90 ; absolute positioningDon't mind the variables inside the script, I have a pre-processor that replaces them before uploading to the duet by ftp. Pay attention to the logic and replace your values.
There are certain requirements you have to take care when using sensorless homing. For example, it will only sense when the motor is above certain speed, if too low, it won't detect. So do not home in very low speeds. Also, if you lower motor current to about 60% it will help the process, at full current it may bump too hard on the limits. I also decrease accelerations, speeds and jerk in those macros and restore them afterwards, I have seen better results with that.
-
@token47 said in Sensorless and senseless:
First, you have to configure the "virtual endstops" to use the stall instead of physical switches. You do that putting this in your config.g:
; Endstops
M574 X1 Y1 S3 ; Set endstops to use sensorless motor load detection
M915 X Y E S3 F1 H200 R0 ; set stall motor sensitivity and actionsThis is enough for it just to work as if you had switches installed. Anytime the motors stall, the enstops will be triggered.
Now, when doing the homing, you must use the S1 paramenter (or the H1 parameter on FW 2.02 and later) in your G0/G1 commands so it respects endstops.
H1 terminate the move when the endstop switch is triggered and set the axis position to the axis limit defined by M208. On delta printers, H1 also selects individual motor mode as for H2. Normally used with relative motor coordinates (see G91).
For example, my homex.g is like this:
G91 ; relative positioning
G1 Z${Z_HOMING_LIFT} F$((Z_SPEEDS[MEDIUM]*60)) ; lift Z relative to current position
M98 P"0:/sys/m_set_homing_speeds.g" ; set lower speeds and accelerations
M913 X60 Y60 ; set X and Y motors to low current for homing
G1 S1 X-$((X_LIMITS[MAX]+100)) F$((XY_SPEEDS[HOMING]*60)) ; move quickly to X axis endstop and stop there (first pass)
G1 X5 F$((XY_SPEEDS[HOMING]*60)) ; go back a few mm
M913 X100 Y100 ; set X motor to 100% of the normal current
M98 P"0:/sys/m_set_normal_speeds.g" ; set normal speeds and accelerations
G90 ; absolute positioningDon't mind the variables inside the script, I have a pre-processor that replaces them before uploading to the duet by ftp. Pay attention to the logic and replace your values.
There are certain requirements you have to take care when using sensorless homing. For example, it will only sense when the motor is above certain speed, if too low, it won't detect. So do not home in very low speeds. Also, if you lower motor current to about 60% it will help the process, at full current it may bump too hard on the limits. I also decrease accelerations, speeds and jerk in those macros and restore them afterwards, I have seen better results with that.
I REALLY appreciate that. I guess what i'm wondering is, how do i know what commands can go in what file. Like how do i know if i have to put the commands in the config or homeall or whatnot. Is there a list of what should go where?
-
@skivvy if its a command to setup the printer (such as what motors are what axis, types of endstops etc) then it goes in config.g If its an action you want the printer to take that is configurable, then it goes in the relevant system macro. so homing, pause, resume etc. most actions that are hard coded in other firmware are modifiable through the use of macros on the Duet.
For more information on system macros see:
https://duet3d.dozuki.com/Wiki/Macros#Section_System_MacrosIn this case the M915 command that sets up the sensor less homing would normally go in config.g and the home macros would have the commands you want the the printer to follow when actually homing.