Werkzeuglängensensor mit UGS Platform oder CNCjs


ich habe mir einen Werkzeuglängensensor gebaut, Aluminium Block > Kabel Krokodilklemme > Kabel, und v ersuche jetzt seit geraumer Zeit es unter ugs Platform oder CNCjs (MacUser) so hin zu bekommen, dass es sich so verhält, wie in dem Video: fährt runter bis Berührung, dann wieder hoch.

Ich habe es nach dieser Anleitung gemacht: https://www.instructables.com/Setup-a-Touch-Probe-With-a-Arduino-Cbc-Shield-and-/
Ich denke, ich habe alles richtig gemacht, aber ich bekomme immer ein Error:

[Error] An error was detected while sending ‘G38.2 Z-10 F100’: ALARM: Probe fail. Streaming has been paused.
An unexpected error was detected: error: Alarm lock

[Caution: Unlocked]
G90 G21

Kann mir jemand sagen, was ich falsch mache?

There are few GRBL users on this forum. Most of us use Marlin, so you might have a better chance of getting an accurate answer on a GRBL forum of some sort. Before I give my answer, know that I have limited GRBL experience, and, since it is on one of my laser engravers, I’ve never used the G38.2 command.

According to the documentation, there are two reasons that you will get that alarm. The first is if the Z travels more than the specified distance…that would be 10mm in your example G38.2 command above. Second, you will get that error if your starting state is not what is expected by the firmware. Note this error is coming from the GRBL running on the board, not from CNCjs.

Assuming the error is coming because of the state, there are a number of things that can be checked.

  • The $6 GRBL setting may be set wrong. I think it needs to be set to 0, but you could simply change it to see if it makes a difference. Remember to change it back if it does not solve your problem.

  • Your router is grounded and you are attaching the signal pin to the bit rather than the ground wire. The signal pin should be attached to the block not to the bit.

  • Your signal pin is not being pulled high. Carefully and with the control board running, check with a voltmeter that the signal pin is being pulled high. I would expect a value near 5V, but any value above about 3.5 is okay. If it is not being pulled high, then it is possible the internal pullup resistor is not functioning, or that you are using the wrong pin (one that is not being pulled high). If you are certain the pin is correct, and it is not being pulled high, then you can add an external pullup resistor ( 1K to 10K) to pull the pin high. The resistor would go between the signal pin and a 5V pin.

  • Unlikely, but electrical noise can cause a failure.

Thank you for your detailed reply, Robert!

$6 shows

  • $6 = 0 (probe pin invert, bool) …what is the meaning of bool?
  • signal pin goes to the block

How do I measure this? I’m not an expert with multimeters :slight_smile:

Use your multimeter in DC mode. Check the voltage between the block and the clip with the negative side of the multimeter connected to the clip. You should see something around 5V. If you see -5V, then you have the signal and ground switched.

If you get something near 0V, then you have one of:

  • A break in either of two wires going to the control board.
  • Your signal pin is somehow grounded.
  • Your signal pin is burned out.
  • You are using the wrong pin

If you get near 2.5V, then the pin is floating, and you need to add an external pullup resistor.

If you suspect a break, you can use your multimeter to measure the resistance through the wire. You want something near 0V.

A quick search indicated that $6=0 is correct for a touch plate (normally open connection).

If you have some extra Dupont wires, you can plug them into the signal and ground and simulate touching the plate by starting the G38.2 and then shorting the two wires during the probe. If it works, you know 1) you have the right pin, 2) the pin works, and 3) the issue is in the wiring. If it does not work, it is likely a board issue or you are using the wrong pin.

Bool is short for Boolean, so set to true/false 1/0 on/off. So, $6=0 would mean don’t invert the signal logic, i.e. “trigger the signal pin when the circuit changes from open to closed” and $6=1 would mean “trigger the signal pin when the circuit changes from closed to open.”

Some of the grbl options take numerical values (things like how many mm to pull off the homing switch, or how many steps per mm on a given axis), some are bit masks (to control homing directions and axis reversing), and others take boolean on/off settings.

To check the wiring twice was a very good advice! I did a really stupid mistake with the bushing for the probe, I used the wrong connector! Now all is working fine!
Thank you for all the help, much appreciated!!!
Next step: learning to draw and convert to a usable file!