M574 am i allowed to change endstop type on the fly?
-
my b axis is configured to be a sensorless endstop for homing and this works well as it loads filament during a tool change, on unloading id like it to home in reverse to a physical switch by changing M574 from sensorless to using a switch, then revert back to sensorless for the rest of the tool change.
is this allowed by the firmware?
or am i able to configure sensorless for max endstop and switch for minimum?
cheers
-
You can configure the firmware in real time. So any gcode commands you issue will be in effect when you issue them and in the order you issue them. In other words, you can do pretty much anything you want in a macro.
-
ok cheers, thanks mate
-
hmmm, i dont think it sticks during macro, i cant get this to reliably change endstop config on the fly. does it only work within config.g?
-
Can you post your files?
-
@gavatron3000 said in M574 am i allowed to change endstop type on the fly?:
hmmm, i dont think it sticks during macro, i cant get this to reliably change endstop config on the fly. does it only work within config.g?
You can use M574 at any time. If you need it to be delayed until all previous moves have completed, you might need to use M400 before it. I'm out if the office so I can't easily check right now.
-
Here's one of the macro's that I switch the endstops, I'll add M400 hopefully tomorrow when I get a chance and see if that improves things
M591 D0 P2 C3 S0 ; deactivate filament sensor
M574 B2 S0 ; set B axis max endstop to switched low
G91 ; relative moves
G1 B30 S1 F3000 ; feed filament to filament sensor
G92 B0 ; force B to 0mm
G1 B20 F3000 ; feed a bit more to reliably switch sensor and reach tube
M400 ; wait till moves finish
M574 B2 S3 ; set B axis max endstop to sensorless
M581 E0 S0 T2 C0 ; activate trigger 2 on falling edge
M582 T2 ; check filament sensor to confirm loading successful
G4 P4000 ; trial wait to signify it progress
M913 B50 ; reduce motor current to 50% to prevent grinding
M915 B S5 F0 ; set stall guard parameters
G1 S1 B550 F3600 ; fast feed filament into extruder
M591 D0 P2 C3 S1 ; activate filament sensor
G92 B0 ; force B to 0mm
G90 ; absolute moves -
I've checked, and you do need to use M400 before M574 if you need to guarantee that any regular moves have completed before the M574 takes effect. But endstop configuration doesn't affect regulator moves, and any homing move causes a pipeline stall anyway. So at present I can't think of a case where the M400 would actually be essential.
-
Ok no worries. I assume as soon as the m574 is issued the effect is instant?
-
@gavatron3000 said in M574 am i allowed to change endstop type on the fly?:
Ok no worries. I assume as soon as the m574 is issued the effect is instant?
Yes.
-
thought id report back....
so i had my offending B-axis playing up as described by not conforming to the on the fly M574 commands. originally it was connected to the E2 driver on my duex2. i read on the wiki in regards to M591 not being able to be used on these pins so i thought id see if it affected the endstops too. so i changed A and B around so the B axis is now on the E1 driver on the duet main board and it works as intended!