Good day! I'm new to GCODE. I have an old 3D printer with an Anet A1284-base board. For my project, I would like to do a little experiment before I start redoing the mechanics. What I want to do:
When you launch a GCODE file through the regular printer menu from SD card, the X axis moves 1 cm in any direction, freezes for 5 seconds and moves back. After that, I press the limit switch of the Z axis with my finger and the Z axis moves 1 cm in any direction. I release the limit switch and the Z axis returns back. Ideally, this action should be repeated indefinitely. Is it possible to do this? Please help me figure this out. Thank you!
What did you already try to solve it?
I tried this code. Does not work!
G91 ; Set relative coordinates
G1 Z-10 F100 ; Move the Z axis down 10 mm at a speed of 100 mm/min
M400; Wait for the movement to complete
M119; Check the condition of the Z axis limit switch
IF [Z_MIN] = 1 ; If the Z-axis limit switch is turned on
G91 ; Set relative coordinates
G1 Z360 F100 ; Make the Z axis motor 20 revolutions at a speed of 100 mm/min
G90 ; Return to absolute coordinates
ENDIF
Have you tried running in safe mode?
WRITE HERE
Did running in safe mode solve the problem?
WRITE HERE
Systeminfo Bundle
You can download this in OctoPrint's System Information dialog ... no bundle, no support!)
WRITE HERE
Additional information about your setup
What kind of hardware precisely, OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible
This seems like something you need to do in the Firmware for the printer. The IO points for the end stops is part of that system. It would have to report the status in some way for a plugin to know what was happening at the printer. There is some Marlin GCode that might get that info for you but i think it also puts the printer in some kind of debug mode.
Why is it that a standard Home of the Axis system does not solve whatever it is that you are attempting to solve?
You could not do this with standard gcode as there is no flow control like the if statements you're using. Modifying the firmware to run this routine would be possible (if you can understand it & write c++), or creating a plugin for OctoPrint that handled the control.
Because first I need to press the limit switch button with my finger and then the engine should start, and not vice versa by moving to the button and pressing it.