Page MenuHomeAleph Objects Inc

Enable M226 ability to pause gcode until Z-Min (probe) triggered
Closed, ResolvedPublic


While writing gcode for T3694 I am unable to trigger the Z-Min/Probe
Previous test stand gcode utilizes M226 (wait for pin state) to force the tester to trigger the probe before the test will proceed.
This is necessary to verify the circuit is functioning properly.
I am able to walk the unit through G29 by triggering the probe and holding the switch while running M119 reads triggered, so I know everything is set up properly on the hardware end of things.

M226 P31 S1

prevents the unit from proceeding through the remaining gcode, however I am unable to trigger to allow the gcode to proceed.

M226 P32 S1

gives the same result

M226 P31(or32) S0

the unit ignores this line and proceeds.

M42 S1 I am unable to read voltage between nozzle and bed ground
M42 S0 I am able to read 1.8-2v between nozzle and bed ground
Running either prior to the M226 does not affect results.

If you know of another way to do this I am open to ideas. The goal is to have a test that starts from a gcode with stock FW and have the test unable to proceed if:
a) the test is running unsupervised
b) a failure occurs

Event Timeline

logan created this task.Dec 6 2018, 12:06 PM
logan created this object with edit policy "LulzBot Hardware Products (Project)".
logan updated the task description. (Show Details)Dec 6 2018, 12:10 PM
logan added a comment.Dec 6 2018, 12:54 PM

I am just guessing here, but could this have something to do with the pins being protected?

logan triaged this task as High priority.Dec 10 2018, 7:36 AM

@logan: Could you test other pins on the board and see if they work with M226? Marlin is using Arduino's digitalRead function to poll the pins and it is entirely possible that particular pin isn't supported. This happens to be the case for a couple pins on the Archim board.

Also, try M226 P29 S1 for Z_MIN and M226 P50 S1 for Z_MAX... I'm not sure where you got P31 and P32 from, but that doesn't seem correct.

logan added a comment.Dec 10 2018, 8:57 AM

@marcio I will give that a try, I got those from "pins_ARCHIM2.h" on Marlin (master)

@logan: On further investigation, it seems like the issue is that Z_MIN is one of those pins that is present on the Archim, but not present on Arduino. Therefore, M226 won't work with it.

I added a workaround for our FW. It will be present in Quiver I'll also make it so it isn't necessary to enable the pin and will also invert it so has the correct value (on the TAZ7 everything is normally closed).

In general, it seems like if we want to use "M226" on a pin, we have to write custom code.

@marcio Thanks for looking into this. So M226 P29 S1 should work on Quiver for Z-Min(probe)?
Off the top of my head this should be the only thing I need M226 for to perform the needed tests.

marcio added a comment.EditedDec 10 2018, 11:44 AM

@logan: Yes, it should now work. Let me know if it doesn't.

UPDATE: not -> now

logan added a comment.EditedDec 11 2018, 8:19 AM

@marcio On I tried M226 P29 S1 and I'm guessing that is the default pin state because it ignored that line and proceeded. It would not respond to a state change with M226 P29 S0 or M226 P29 S-1
I have that line preceded by an M400 at the advice of @west
I have also ensured that the Z-Min(probe) is still responsive by manually walking the unit through a G29
With a multimeter connected to the test stands probe switch, if I run M42 S1 I get voltage and it drops to zero upon pressing the switch. M42 in either direction prior to M226 did not affect results.

I am also not able to abort the print once it hits that line of code, the LCD responds but the print wont actually abort.

@logan: You were correct initially. It should be M226 P31 S0 or M226 P32 S0 to match "pins_ARCHIM2.h"

logan added a comment.Dec 11 2018, 9:20 AM

@marcio I will try those with *fingers crossed*

logan closed this task as Resolved.Dec 11 2018, 10:11 AM

M226 P31 S1 gave me what I needed, thank you @marcio !