Homing and limit switches #651
-
Hi, I tried to use homing via UGS, but seems to be i faced one issue. Maybe it is a software or hardware issue. In the setup wizard when pressing "try homing" with x+ y+ z+ limit switches. Z axis goes to the Z+ limit switch and stops with alarm. No other actions. Only manual change position of spindle helps to fix this issue with locked machine. X and Y axes do not move during homing. My limit switches use signal and ground. By default the switches are grounded. When they are triggered, the signal loses contact with ground. Additionally it works strange. When hold a limit switch in triggered state with active "verbose output" setting, not every line of the output shows that the switch is triggered, such line appears randomly. Is this behavior OK? Are the switches connected correctly? I have probe on D69(K7, PCINT23) pin and for me is the problem find right ISR value. The formula -(INT# + 1) does not work in this case. Can you advice how to properly find ISR value. I use Ramp 1.6 with Mega. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
This is indicative that the switch input is unstable and floating around or not making proper contact. Did you enabled pins PULL UP?
Which alarm code? Again this is indicative of the problem. The list of alarms is here. After the initial hit the firmware waits a few milliseconds to debounce the signal. If it fails to read the limit the second time it will throw an error.
The explanation might made it a bit confusing. That formula is of external interrupt pins. For interrupt on change pins it's a the group number (0 to PCINT0-PCINT7, 1 to PCINT8-PCINT15, 2 to PCINT16-PCINT23). That is for PCINT23 Another way to think about this is to use the bitshift operation. Each port has 8 interruptable on change pins (3 bits). Just apply the int number right shifted of 3 bits. 23>>3 = 2 To be able to help you a bit more I need to know your configuration. |
Beta Was this translation helpful? Give feedback.
-
I fixed my switches according to the this https://forum.arduino.cc/t/premature-limit-switches/690893/3 image. Now homing works. One more strange behavior that i noticed. In setup wizard, homing step, when +Z is selected, the spindle goes down during a limit switch seek. In my expectation it should go up. is it expected behavior? |
Beta Was this translation helpful? Give feedback.
Usually the way I do it is enable signals (like limits and controls) pull up. I then wire limits and buttons using normally closed switches with the common connected to ground.
This has the advantage of (in case of a faulty wire or an unconnected switch by accident) detecting a connection interruption an trigger the pin. Also you only need GND to connect the switch.
You can then, if necessary use optocouplers to work with higher voltages to make the circuit more noise immune.
Please read this discussion with a somewhat similar problem and solution.