grblHAL / core

grblHAL core code and master Wiki
Other
326 stars 85 forks source link

Wiring limits and setup settings. #274

Closed Demitrius closed 1 year ago

Demitrius commented 1 year ago

Hello! I want to try limits on my SKR-3 board and wiring similar attached scheme (NC). The wire schema taken from Wiring Limit Switches

My goal is use limits for homing and emergency stop when one of limit trigger. What do I need to setup in GrblHAL settings?

$5=0 (or 1?) $14=7 (or ?) $20=1 $21=1 $22=1

Kindly guide me on defining configuration and wiring scheme if Im wrong.

image

terjeio commented 1 year ago

$5=0 $14 is for estop/reset and some other input signals. Set to 0 if using NC switches. $20 is for enabling soft limits, not related to switches. $21=1 $22=1 or odd values >=1, $$=21 for info. $44=4 - home Z first $45=3 - then X and Y

More info here.

Demitrius commented 1 year ago

Thanks!

Im a bit confused, SKR 3 has 3.3V logic signal level.

If I wiring like this scheme, It will equals: 5V -> Resistor -> 3.3V signal pin. Question, what kind of resistor I need? 1K, 4.7K or 10K ohms ?

dresco commented 1 year ago

If you have a look at the top left of the schematic for the SKR3, you can see those pins are not directly connected to the MCU.

Am assuming their intent for passive switches is to place them between GND and the signal pin. The MCU will then either see 3.3v if open, or 0v if closed..

Note: looking at the H743 datasheet, the Y endstop (PC2) input is not 5v tolerant for the LQFP part.

Demitrius commented 1 year ago

$5=0 $14 is for estop/reset and some other input signals. Set to 0 if using NC switches. $20 is for enabling soft limits, not related to switches. $21=1 $22=1 or odd values >=1, $$=21 for info. $44=4 - home Z first $45=3 - then X and Y

More info here.

Are you sure $5=0 for Normal Close scheme?

I found two different descriptions, and think, may be need to do inversion. By default, GRBL trigger when I shorted the signal and ground pins. As I understand NC, line between signal and ground pins always "shorted" and GRBL must trigger then the pins are disconnected (line broken or switch triggered on NC contact) and no current flows.

$5 - Limit pins invert, boolean By default, the limit pins are held normally-high with the Arduino's internal pull-up resistor. When a limit pin is low, Grbl interprets this as triggered. For the opposite behavior, just invert the limit pins by typing $5=1. Disable with $5=0. You may need a power cycle to load the change.

NOTE: If you invert your limit pins, you will need an external pull-down resistor wired in to all of the limit pins to prevent overloading the pins with current and frying them.

$5 – Limit pins invert, boolean For NO or NPN, this setting should be $5=0, so that the input and output pins are set to the proper voltage level to function properly. For NC or PNP, this setting should be set to $5=1.

terjeio commented 1 year ago

Are you sure $5=0 for Normal Close scheme?

Yes - for best practice reasons (better EMI immunity and safer if a wire breaks) grblHAL defaults to normally closed switches for all inputs.

Demitrius commented 1 year ago

$14 is for estop/reset and some other input signals. Set to 0 if using NC switches.

I have no one connected sensors/buttons, only one Limit switch on X. Now $14=7 and board start success without warnings, any way, need I set $14=0 or not mandatory and leaves $14=7?

Demitrius commented 1 year ago

Thanks all guys! Wired, connected, works!

Chears