Mapping Endstops
-
@Lukrative You can use the S1 (H1 in RRF3) or S3 (H3 in RRF3) option in G1 commands to reset axis limits to where it physically finds the switch. I think that's what you are trying to do with the toolchanger... maybe.
Is it a "go pick up and lock a tool" type changer? Or ?? Any photos?
-
@Danal Strictly speaking it's more of a filament changer. It's very similar to the Prusa MMU2, but with only two filaments. My printer design has two bowden extruders which feed into a y splitter, and from there into a direct drive extruder. So at any given point in time, there is one filament being driven by two extruders in series, with the other bowden extruder just holding on to the other filament.
The problem I see with doing dual extrusion this way is that the tips become shaped in an inconsistent fashion after retracting them from the hot end, often leading to stringy tips. After a number of tool changes, these strings pile up and bind the filament being loaded, leading to a jam.
My filament changer will incorporate a mechanism just after each bowden extruder that cuts the filament, moves the bowden tube laterally out of alignment with the extruder, and uses compressed air fed into the print head side of the bowden tube to eject the tip that was cut off. I'm hoping that the compressed air will force the strings out of the bowden tubes before they have a chance to pile up.
The limit switches would be used after each filament change to precisely re-align the bowden tube with its extruder so that filament could be advanced through it. As I only have one more stepper driver available (even with the expansion board), the mechanism will use only one stepper. It is for this reason that I want limit switches on both ends.
I'm still putting together a proof of concept to make sure that blowing compressed air into the bowden tube will even push stringy filament tips out. After that I will finish the model of the filament changer.
For reference, this is what my printer looks like now:
https://imgur.com/259eiRH -
Thank you! Very nifty.
-
With regard to the limit switches, whatever axis is defined for that driver that moves the bowden laterally, that axis can have two limit switches. You can move at high speed near the switches, then probe for them. You can also wire two NC switches in series and treat them as a single input. Several tool changing printers do this on their tool lock.
Example of probing the low switch:
G1 U10 F1000
G1 H1 U0 F100 ; H1 at low end, H3 at high end.You may or may not want to reset axis limits after H1/H3. They do set them to the probe point. Repeat probes won't go past the limits. I normally reset them.
-
@Danal So assuming I wired two NC endstops in series, my config file would look something like this?
M584 U6 ; use drive 6 for the U axis
M574 U1 S1 ; U axis endstop on low end, active highWhat about if I wanted to use two separate limit switches? Would this work?
M584 U6 V6
M574 U1 V2 S1Then I could create homing files for the U and V axes, where "home U" is move to the low end and "home V" is move to the high end. Then I could put in an if statement (in the homeu.g file) where while homing U, it will back off of the endstop if it's already triggered, but not if it's already away from it.
Is there any reason this wouldn't work?
-
That would probably work, but there is no need for V.
U can have a high and a low homing switch.
Probe with H1 when near the low. Edit: "when trying to find" is probably better phrase than "near"
Probe with H3 when near the high. Edit: Ditto
-
M574 U1 S1
M574 U2 S1 -
Lovely! Thanks for the reply.
-
@Danal said in Mapping Endstops:
M574 U1 S1
M574 U2 S1That's not supported (yet). The second command will override the first.
-
Oh drat. @dc42, Thanks for the clarification!
@Lukrative then wire two NC switches in series, and you can still use H1, with appropriate numeric coordinates to find hi or lo.
I know this works, because the U axis for my toolchanger is wired and configured this way.
-
To expand on that:
Homing U uses a microswitch in a very conventional fashion. Homing unlocks a tool.
The second switch, wired in series with the first, is between two disks with a spring arrangement such that when locking a tool, the lock reaches a certain amount of torque and the spring stretches and the disks move in relation to each other, thus opening the second switch.
This forms a "torque sensor" so the lock is moved to a specific torque (not a specific position) when locking a tool.
Tool Unlock Macro. Moving the same direction that homing moves, that is, toward 0 (rotation), in this case via negative numbers because we want a relative move. Note the H1.
G91 ; Set relative movements G1 U-4 F9000 H2 ; Back off the limit switch with a small move G1 U-360 F9000 H1 ; Perform up to one rotation looking for the home limit switch G90 ; Restore absolute movements
Tool lock macro. Note the H1, even though we are now rotating positive it is still H1, not H3. Only one (logical) switch... that is really two physical, one at 'each end'.
; Engage the toolchanger lock G91 ; Set relative mode G1 U10 F9000 H0 ; Back off the limit switch with a small move G1 U360 F9000 H1 ; Perform up to one rotation looking for the torque limit switch G90 ; Set absolute mode
This all applies directly to your linear axis. Two switches, series wired, always probe with H1, relative moves set positive/negative for the appropriate end.
Make sense?
-
@Danal It's good to know that wiring in series is an option, but I want my tool change macros to work even if somehow the filament changer is out of alignment or if I'm just starting the machine. For example, suppose I call tool 0, which is on the left side of my printer. If the filament changer is already at the left endstop, I want it to move off the endstop to the right first, then go back to the endstop. If it's sitting at the right endstop, I would like it to just move to the left endstop without moving to the right first. As far as I understand, RRF3 allows you to do this with conditional statements. But if both endstops are wired in series, there's no way of knowing which of these options to choose without prior information.
@dc42 is this a viable method of tricking the firmware into having min and max endstops?
M584 U6 V6
M574 U1 V2 S1 -
I remap my endstops within my tool locking and unlocking macros.
; Engage the toolchanger lock M400 ; Make sure everything has stopped before we make changes ; ################## Prepare Axis ######################### M584 P4 ; Unhides U axis ; ################## Endstop Mapping ###################### M574 U2 S3 ; set U axis (tool changer) maxima to use motor stall ;################### Stall Detection ###################### M915 U S3 F0 H20 R4700 ; Coupler ;################### Locking Procedure #################### G91 ; Use relative positioning G1 H1 U180 F5000 ; Move all carriages up 700mm, stopping at the endstops G90 ; Back to absolute positioning ; ################## Reset System ######################### M584 P3 ; Hides U axis
; Unlock the toolchanger lock M400 ; Make sure everything has stopped before we make changes ; ################## Prepare Axis ######################### M584 P4 ; Unhides U axis ; ################## Endstop Mapping ###################### M574 U1 S1 P"io3.in" ; configure active-high endstop for low end on U via pin io3.in ;################### Locking Procedure #################### G91 ; Use relative positioning G1 H1 U-90 F5000 ; Move all carriages up 700mm, stopping at the endstops G1 H1 U5 F5000 G90 ; Back to absolute positioning ; ################## Reset System ######################### M584 P3 ; Hides U axis
-
No problem... at startup, home, just like any other axis. I can't overstress that I'm doing EXACTLY what you are doing, just in a circle instead of a line. It all works. No jams, no funny startups. G28 and/or G28 U work normally. etc, etc, etc.
Do include homeu.g in homeall.g
homeu.g
G91 ; Set relative mode G1 U-360 F9000 H1 ; Big negative move to search for home endstop G1 U6 F600 ; Back off the endstop G1 U-10 F600 H1 ; Find endstop again slowly G90 ; Set absolute mode
Jay is remapping so he can use stall detect. Which also works great, after you tune it. (Jay and I talk a lot on the Jubilee discord).